|
@@ -261,7 +261,7 @@ skipChars(std::istream& in, const char* chars, int& line, int& pos) {
|
|
} else {
|
|
} else {
|
|
++pos;
|
|
++pos;
|
|
}
|
|
}
|
|
- in.get();
|
|
|
|
|
|
+ in.ignore();
|
|
c = in.peek();
|
|
c = in.peek();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -291,7 +291,7 @@ skipTo(std::istream& in, const std::string& file, int& line,
|
|
pos = 1;
|
|
pos = 1;
|
|
++line;
|
|
++line;
|
|
}
|
|
}
|
|
- in.get();
|
|
|
|
|
|
+ in.ignore();
|
|
++pos;
|
|
++pos;
|
|
}
|
|
}
|
|
in.putback(c);
|
|
in.putback(c);
|
|
@@ -352,7 +352,7 @@ strFromStringstream(std::istream& in, const std::string& file,
|
|
throwJSONError("Bad escape", file, line, pos);
|
|
throwJSONError("Bad escape", file, line, pos);
|
|
}
|
|
}
|
|
// drop the escaped char
|
|
// drop the escaped char
|
|
- in.get();
|
|
|
|
|
|
+ in.ignore();
|
|
++pos;
|
|
++pos;
|
|
}
|
|
}
|
|
ss.put(c);
|
|
ss.put(c);
|
|
@@ -490,14 +490,14 @@ fromStringstreamMap(std::istream& in, const std::string& file, int& line,
|
|
throwJSONError(std::string("Unterminated map, <string> or } expected"), file, line, pos);
|
|
throwJSONError(std::string("Unterminated map, <string> or } expected"), file, line, pos);
|
|
} else if (c == '}') {
|
|
} else if (c == '}') {
|
|
// empty map, skip closing curly
|
|
// empty map, skip closing curly
|
|
- c = in.get();
|
|
|
|
|
|
+ in.ignore();
|
|
} else {
|
|
} else {
|
|
while (c != EOF && c != '}') {
|
|
while (c != EOF && c != '}') {
|
|
std::string key = strFromStringstream(in, file, line, pos);
|
|
std::string key = strFromStringstream(in, file, line, pos);
|
|
|
|
|
|
skipTo(in, file, line, pos, ":", WHITESPACE);
|
|
skipTo(in, file, line, pos, ":", WHITESPACE);
|
|
// skip the :
|
|
// skip the :
|
|
- in.get();
|
|
|
|
|
|
+ in.ignore();
|
|
pos++;
|
|
pos++;
|
|
|
|
|
|
ConstElementPtr value = Element::fromJSON(in, file, line, pos);
|
|
ConstElementPtr value = Element::fromJSON(in, file, line, pos);
|