Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Json::CharReaderBuilder Class Reference

Build a CharReader implementation. More...

#include <json.h>

Inheritance diagram for Json::CharReaderBuilder:
Inheritance graph
[legend]

Public Member Functions

 CharReaderBuilder ()
 
virtual CharReadernewCharReader () const
 Allocate a CharReader via operator new(). More...
 
Valueoperator[] (std::string key)
 
bool validate (Json::Value *invalid) const
 
virtual ~CharReaderBuilder ()
 
- Public Member Functions inherited from Json::CharReader::Factory
virtual ~Factory ()
 

Static Public Member Functions

static void setDefaults (Json::Value *settings)
 
static void strictMode (Json::Value *settings)
 

Public Attributes

Json::Value settings_
 

Detailed Description

Build a CharReader implementation.

Usage:

using namespace Json;
builder["collectComments"] = false;
Value value;
std::string errs;
bool ok = parseFromStream(builder, std::cin, &value, &errs);

Definition at line 1490 of file json.h.

Constructor & Destructor Documentation

Json::CharReaderBuilder::CharReaderBuilder ( )

Definition at line 2074 of file jsoncpp.cpp.

Json::CharReaderBuilder::~CharReaderBuilder ( )
virtual

Definition at line 2078 of file jsoncpp.cpp.

Member Function Documentation

CharReader * Json::CharReaderBuilder::newCharReader ( ) const
virtual

Allocate a CharReader via operator new().

Exceptions
std::exceptionif something goes wrong (e.g. invalid settings)

Implements Json::CharReader::Factory.

Definition at line 2080 of file jsoncpp.cpp.

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

A simple way to update a specific setting.

Definition at line 2124 of file jsoncpp.cpp.

void Json::CharReaderBuilder::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:

[CharReaderBuilderDefaults]

[CharReaderBuilderDefaults]

Definition at line 2142 of file jsoncpp.cpp.

void Json::CharReaderBuilder::strictMode ( Json::Value settings)
static

Same as old Features::strictMode().

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

[CharReaderBuilderStrictMode]

[CharReaderBuilderStrictMode]

Definition at line 2129 of file jsoncpp.cpp.

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

Definition at line 2107 of file jsoncpp.cpp.

Member Data Documentation

Json::Value Json::CharReaderBuilder::settings_

Configuration of this builder. These are case-sensitive. Available settings (case-sensitive):

  • "collectComments": false or true
    • true to collect comment and allow writing them back during serialization, false to discard comments. This parameter is ignored if allowComments is false.
  • "allowComments": false or true
    • true if comments are allowed.
  • "strictRoot": false or true
    • true if root must be either an array or an object value
  • "allowDroppedNullPlaceholders": false or true
  • "allowNumericKeys": false or true
    • true if numeric object keys are allowed.
  • "allowSingleQuotes": false or true
    • true if '' are allowed for strings (both keys and values)
  • "stackLimit": integer
    • Exceeding stackLimit (recursive depth of readValue()) will cause an exception.
    • This is a security issue (seg-faults caused by deeply nested JSON), so the default is low.
  • "failIfExtra": false or true
    • If true, parse() returns false when extra non-whitespace trails the JSON value in the input string.
  • "rejectDupKeys": false or true
    • If true, parse() returns false when a key is duplicated within an object.

You can examine 'settings_` yourself to see the defaults. You can also write and read them just like any JSON Value.

See Also
setDefaults()

Definition at line 1527 of file json.h.


The documentation for this class was generated from the following files:


mission_planning
Author(s): ivan
autogenerated on Thu Nov 12 2015 19:08:20