namespace {
inline void
throwJSONError(const std::string& error, const std::string& file, int line,
- int pos)
-{
+ int pos) {
std::stringstream ss;
ss << error << " in " + file + ":" << line << ":" << pos;
isc_throw(JSONError, ss.str());
//
// It returns the found character (as an int value).
int
-skipTo(std::istream& in, const std::string& file, int& line,
- int& pos, const char* chars, const char* may_skip="")
-{
+skipTo(std::istream& in, const std::string& file, int& line, int& pos,
+ const char* chars, const char* may_skip="") {
int c = in.get();
++pos;
while (c != EOF) {
// error on the rest)?
std::string
strFromStringstream(std::istream& in, const std::string& file,
- const int line, int& pos)
-{
+ const int line, int& pos) {
std::stringstream ss;
int c = in.get();
++pos;
//
ElementPtr
fromStringstreamNumber(std::istream& in, const std::string& file,
- const int& line, int& pos) {
+ const int line, int& pos) {
// Remember position where the value starts. It will be set in the
// Position structure of the Element to be created.
const uint32_t start_pos = pos;
ElementPtr
fromStringstreamBool(std::istream& in, const std::string& file,
- const int line, int& pos)
-{
+ const int line, int& pos) {
// Remember position where the value starts. It will be set in the
// Position structure of the Element to be created.
const uint32_t start_pos = pos;
ElementPtr
fromStringstreamNull(std::istream& in, const std::string& file,
- const int line, int& pos)
-{
+ const int line, int& pos) {
// Remember position where the value starts. It will be set in the
// Position structure of the Element to be created.
const uint32_t start_pos = pos;
ElementPtr
fromStringstreamString(std::istream& in, const std::string& file, int& line,
- int& pos)
-{
+ int& pos) {
// Remember position where the value starts. It will be set in the
// Position structure of the Element to be created.
const uint32_t start_pos = pos;
ElementPtr
fromStringstreamList(std::istream& in, const std::string& file, int& line,
- int& pos)
-{
+ int& pos) {
int c = 0;
ElementPtr list = Element::createList(Element::Position(file, line, pos));
ElementPtr cur_list_element;
ElementPtr
fromStringstreamMap(std::istream& in, const std::string& file, int& line,
- int& pos)
-{
+ int& pos) {
ElementPtr map = Element::createMap(Element::Position(file, line, pos));
skipChars(in, WHITESPACE, line, pos);
int c = in.peek();
}
ElementPtr
-Element::fromJSON(std::istream& in, const std::string& file_name, bool preproc)
-{
+Element::fromJSON(std::istream& in, const std::string& file_name, bool preproc) {
int line = 1, pos = 1;
stringstream filtered;
if (preproc) {
ElementPtr
Element::fromJSON(std::istream& in, const std::string& file, int& line,
- int& pos)
-{
+ int& pos) {
int c = 0;
ElementPtr element;
bool el_read = false;
}
ElementPtr
-Element::fromJSONFile(const std::string& file_name,
- bool preproc) {
+Element::fromJSONFile(const std::string& file_name, bool preproc) {
// zero out the errno to be safe
errno = 0;
std::ifstream infile(file_name.c_str(), std::ios::in | std::ios::binary);
- if (!infile.is_open())
- {
+ if (!infile.is_open()) {
const char* error = strerror(errno);
isc_throw(InvalidOperation, "failed to read file '" << file_name
<< "': " << error);