fix for getline usage with newer compilers
This commit is contained in:
@@ -199,7 +199,7 @@ string MainLoop::decodeMessage(const string& data, const bool isHttp, bool& conn
|
|||||||
bool escaped = false;
|
bool escaped = false;
|
||||||
|
|
||||||
char delim = ' ';
|
char delim = ' ';
|
||||||
while (getline(stream, token, delim) != 0) {
|
while (getline(stream, token, delim)) {
|
||||||
if (!isHttp) {
|
if (!isHttp) {
|
||||||
if (escaped) {
|
if (escaped) {
|
||||||
args.pop_back();
|
args.pop_back();
|
||||||
@@ -742,7 +742,7 @@ string MainLoop::executeFind(vector<string> &args)
|
|||||||
}
|
}
|
||||||
istringstream input(args[argPos]);
|
istringstream input(args[argPos]);
|
||||||
string column;
|
string column;
|
||||||
while (getline(input, column, ',') != 0) {
|
while (getline(input, column, ',')) {
|
||||||
size_t idx = columnCount;
|
size_t idx = columnCount;
|
||||||
for (size_t i = 0; i < columnCount; i++) {
|
for (size_t i = 0; i < columnCount; i++) {
|
||||||
if (strcasecmp(columnNames[i], column.c_str()) == 0) {
|
if (strcasecmp(columnNames[i], column.c_str()) == 0) {
|
||||||
@@ -1170,7 +1170,7 @@ string MainLoop::executeGet(vector<string> &args, bool& connected)
|
|||||||
string query = args[argPos++];
|
string query = args[argPos++];
|
||||||
istringstream stream(query);
|
istringstream stream(query);
|
||||||
string token;
|
string token;
|
||||||
while (getline(stream, token, '&') != 0) {
|
while (getline(stream, token, '&')) {
|
||||||
pos = token.find('=');
|
pos = token.find('=');
|
||||||
string qname, value;
|
string qname, value;
|
||||||
if (pos != string::npos) {
|
if (pos != string::npos) {
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ result_t DataField::create(vector<string>::iterator& it,
|
|||||||
divisor = parseSignedInt(divisorStr.c_str(), 10, -MAX_DIVISOR, MAX_DIVISOR, result);
|
divisor = parseSignedInt(divisorStr.c_str(), 10, -MAX_DIVISOR, MAX_DIVISOR, result);
|
||||||
else {
|
else {
|
||||||
istringstream stream(divisorStr);
|
istringstream stream(divisorStr);
|
||||||
while (getline(stream, token, VALUE_SEPARATOR) != 0) {
|
while (getline(stream, token, VALUE_SEPARATOR)) {
|
||||||
FileReader::trim(token);
|
FileReader::trim(token);
|
||||||
const char* str = token.c_str();
|
const char* str = token.c_str();
|
||||||
char* strEnd = NULL;
|
char* strEnd = NULL;
|
||||||
@@ -324,7 +324,7 @@ result_t DataField::create(vector<string>::iterator& it,
|
|||||||
|
|
||||||
bool firstType = true;
|
bool firstType = true;
|
||||||
istringstream stream(typeStr);
|
istringstream stream(typeStr);
|
||||||
while (result == RESULT_OK && getline(stream, token, VALUE_SEPARATOR) != 0) {
|
while (result == RESULT_OK && getline(stream, token, VALUE_SEPARATOR)) {
|
||||||
FileReader::trim(token);
|
FileReader::trim(token);
|
||||||
DataField* templ = templates->get(token);
|
DataField* templ = templates->get(token);
|
||||||
unsigned char length;
|
unsigned char length;
|
||||||
@@ -798,7 +798,7 @@ result_t StringDataField::writeSymbols(istringstream& input,
|
|||||||
case bt_dat:
|
case bt_dat:
|
||||||
if (m_length == 4 && i == 2)
|
if (m_length == 4 && i == 2)
|
||||||
continue; // skip weekday in between
|
continue; // skip weekday in between
|
||||||
if (input.eof() || getline(input, token, '.') == 0)
|
if (input.eof() || !getline(input, token, '.'))
|
||||||
return RESULT_ERR_EOF; // incomplete
|
return RESULT_ERR_EOF; // incomplete
|
||||||
if ((m_dataType.flags & REQ) == 0 && strcmp(token.c_str(), NULL_VALUE) == 0) {
|
if ((m_dataType.flags & REQ) == 0 && strcmp(token.c_str(), NULL_VALUE) == 0) {
|
||||||
value = m_dataType.replacement;
|
value = m_dataType.replacement;
|
||||||
@@ -829,7 +829,7 @@ result_t StringDataField::writeSymbols(istringstream& input,
|
|||||||
return RESULT_ERR_OUT_OF_RANGE; // invalid date part
|
return RESULT_ERR_OUT_OF_RANGE; // invalid date part
|
||||||
break;
|
break;
|
||||||
case bt_tim:
|
case bt_tim:
|
||||||
if (input.eof() || getline(input, token, LENGTH_SEPARATOR) == 0)
|
if (input.eof() || !getline(input, token, LENGTH_SEPARATOR))
|
||||||
return RESULT_ERR_EOF; // incomplete
|
return RESULT_ERR_EOF; // incomplete
|
||||||
if ((m_dataType.flags & REQ) == 0 && strcmp(token.c_str(), NULL_VALUE) == 0) {
|
if ((m_dataType.flags & REQ) == 0 && strcmp(token.c_str(), NULL_VALUE) == 0) {
|
||||||
value = m_dataType.replacement;
|
value = m_dataType.replacement;
|
||||||
@@ -1629,7 +1629,7 @@ result_t DataFieldSet::write(istringstream& input,
|
|||||||
if (m_fields.size() > 1) {
|
if (m_fields.size() > 1) {
|
||||||
if (field->isIgnored())
|
if (field->isIgnored())
|
||||||
token.clear();
|
token.clear();
|
||||||
else if (getline(input, token, separator) == 0)
|
else if (!getline(input, token, separator))
|
||||||
token.clear();
|
token.clear();
|
||||||
|
|
||||||
istringstream single(token);
|
istringstream single(token);
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ result_t Message::create(vector<string>::iterator& it, const vector<string>::ite
|
|||||||
istringstream stream(str);
|
istringstream stream(str);
|
||||||
string token;
|
string token;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
while (getline(stream, token, VALUE_SEPARATOR) != 0) {
|
while (getline(stream, token, VALUE_SEPARATOR)) {
|
||||||
FileReader::trim(token);
|
FileReader::trim(token);
|
||||||
unsigned char dstAddress = (unsigned char)parseInt(token.c_str(), 16, 0, 0xff, result);
|
unsigned char dstAddress = (unsigned char)parseInt(token.c_str(), 16, 0, 0xff, result);
|
||||||
if (result != RESULT_OK)
|
if (result != RESULT_OK)
|
||||||
@@ -275,7 +275,7 @@ result_t Message::create(vector<string>::iterator& it, const vector<string>::ite
|
|||||||
size_t chainLength = 16;
|
size_t chainLength = 16;
|
||||||
size_t chainPrefixLength = id.size();
|
size_t chainPrefixLength = id.size();
|
||||||
bool first = true, lastChainLengthSpecified = false;
|
bool first = true, lastChainLengthSpecified = false;
|
||||||
while (getline(stream, token, VALUE_SEPARATOR) != 0 || first) {
|
while (getline(stream, token, VALUE_SEPARATOR) || first) {
|
||||||
FileReader::trim(token);
|
FileReader::trim(token);
|
||||||
token = defaultIdPrefix+token;
|
token = defaultIdPrefix+token;
|
||||||
size_t lengthPos = token.find(LENGTH_SEPARATOR);
|
size_t lengthPos = token.find(LENGTH_SEPARATOR);
|
||||||
@@ -984,7 +984,7 @@ result_t splitValues(string valueList, vector<string>& values)
|
|||||||
{
|
{
|
||||||
istringstream stream(valueList);
|
istringstream stream(valueList);
|
||||||
string str;
|
string str;
|
||||||
while (getline(stream, str, VALUE_SEPARATOR) != 0) {
|
while (getline(stream, str, VALUE_SEPARATOR)) {
|
||||||
if (str.length()>0 && str[0]=='\'' && str[str.length()-1]=='\'') {
|
if (str.length()>0 && str[0]=='\'' && str[str.length()-1]=='\'') {
|
||||||
str = str.substr(1, str.length()-2);
|
str = str.substr(1, str.length()-2);
|
||||||
}
|
}
|
||||||
@@ -1003,7 +1003,7 @@ result_t splitValues(string valueList, vector<unsigned int>& valueRanges)
|
|||||||
istringstream stream(valueList);
|
istringstream stream(valueList);
|
||||||
string str;
|
string str;
|
||||||
result_t result;
|
result_t result;
|
||||||
while (getline(stream, str, VALUE_SEPARATOR) != 0) {
|
while (getline(stream, str, VALUE_SEPARATOR)) {
|
||||||
FileReader::trim(str);
|
FileReader::trim(str);
|
||||||
if (str.length()==0)
|
if (str.length()==0)
|
||||||
return RESULT_ERR_INVALID_ARG;
|
return RESULT_ERR_INVALID_ARG;
|
||||||
@@ -1533,7 +1533,7 @@ result_t MessageMap::addFromFile(vector<string>::iterator& begin, const vector<s
|
|||||||
istringstream stream(types);
|
istringstream stream(types);
|
||||||
string type;
|
string type;
|
||||||
vector<Message*> messages;
|
vector<Message*> messages;
|
||||||
while (getline(stream, type, VALUE_SEPARATOR) != 0) {
|
while (getline(stream, type, VALUE_SEPARATOR)) {
|
||||||
FileReader::trim(type);
|
FileReader::trim(type);
|
||||||
*restart = type;
|
*restart = type;
|
||||||
begin = restart;
|
begin = restart;
|
||||||
|
|||||||
Reference in New Issue
Block a user