IOSS  2.0
json-forwards.h File Reference
#include "value.h"
#include <ostream>
#include <string>
#include <vector>

Go to the source code of this file.

Macros

#define JSON_WRITER_H_INCLUDED
 

Functions

cause an exception This is a security issue (seg-faults caused by deeply nested JSON)
 
cause an exception This is a security so the default is low parse()` returns false when extra non-whitespace trails the JSON value in the input string. - `"rejectDupKeys" CharReaderBuilder ()
 
virtual ~CharReaderBuilder ()
 
virtual CharReader * newCharReader () const
 
bool validate (Json::Value *invalid) const
 
Value & operator[] (std::string key)
 
static void setDefaults (Json::Value *settings)
 
static void strictMode (Json::Value *settings)
 
bool JSON_API parseFromStream (CharReader::Factory const &, std::istream &, Value *root, std::string *errs)
 
JSON_API std::istream & operator>> (std::istream &, Value &)
 Read from 'sin' into 'root'. More...
 

Variables

cause an exception This is a security so the default is low failIfExtra
 

Macro Definition Documentation

◆ JSON_WRITER_H_INCLUDED

#define JSON_WRITER_H_INCLUDED

Function Documentation

◆ CharReaderBuilder()

cause an exception This is a security so the default is low parse ()` returns false when extra non-whitespace trails the JSON value in the input string. - `"rejectDupKeys" CharReaderBuilder ( )

◆ issue()

cause an exception This is a security issue ( seg-faults caused by deeply nested  JSON)

◆ newCharReader()

virtual CharReader* newCharReader ( ) const
virtual

◆ operator>>()

JSON_API std::istream& operator>> ( std::istream &  ,
Value &   
)

Read from 'sin' into 'root'.

Always keep comments from the input JSON.

This can be used to read a file into a particular sub-object. For example:

cin >> root["dir"]["file"];
cout << root;

Result:

{
"dir": {
    "file": {
    // The input stream JSON would be nested here.
    }
}
}
Exceptions
std::exceptionon parse error.
See also
Json::operator<<()

◆ operator[]()

Value& operator[] ( std::string  key)

A simple way to update a specific setting.

◆ parseFromStream()

bool JSON_API parseFromStream ( CharReader::Factory const &  ,
std::istream &  ,
Value *  root,
std::string *  errs 
)

Consume entire stream and use its begin/end. Someday we might have a real StreamReader, but for now this is convenient.

◆ setDefaults()

static void setDefaults ( Json::Value settings)
static

Called by ctor, but you can use this to reset settings_.

Precondition
'settings' != NULL (but Json::null is fine)
Remarks
Defaults:

◆ strictMode()

static void strictMode ( Json::Value settings)
static

Same as old Features::strictMode().

Precondition
'settings' != NULL (but Json::null is fine)
Remarks
Defaults:

◆ validate()

bool validate ( Json::Value invalid) const
Returns
true if 'settings' are legal and consistent; otherwise, indicate bad settings via 'invalid'.

◆ ~CharReaderBuilder()

virtual ~CharReaderBuilder ( )
virtual

Variable Documentation

◆ failIfExtra

cause an exception This is a security so the default is low failIfExtra