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

Static Public Member Functions

static void setDefaults (Json::Value *settings)
 
static void setDefaults (Json::Value *settings)
 
static void strictMode (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;
bool ok = parseFromStream(builder, std::cin, &value, &errs);

Definition at line 1541 of file third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h.

Constructor & Destructor Documentation

◆ CharReaderBuilder() [1/2]

Json::CharReaderBuilder::CharReaderBuilder ( )

◆ ~CharReaderBuilder() [1/2]

Json::CharReaderBuilder::~CharReaderBuilder ( )
override

◆ CharReaderBuilder() [2/2]

Json::CharReaderBuilder::CharReaderBuilder ( )

◆ ~CharReaderBuilder() [2/2]

Json::CharReaderBuilder::~CharReaderBuilder ( )
override

Member Function Documentation

◆ newCharReader() [1/2]

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

Allocate a CharReader via operator new().

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

Implements Json::CharReader::Factory.

Definition at line 2106 of file bloaty/third_party/protobuf/conformance/third_party/jsoncpp/jsoncpp.cpp.

◆ newCharReader() [2/2]

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

Allocate a CharReader via operator new().

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

Implements Json::CharReader::Factory.

◆ operator[]() [1/2]

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

A simple way to update a specific setting.

◆ operator[]() [2/2]

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

A simple way to update a specific setting.

Definition at line 2152 of file bloaty/third_party/protobuf/conformance/third_party/jsoncpp/jsoncpp.cpp.

◆ setDefaults() [1/2]

static 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:

◆ setDefaults() [2/2]

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]

[CharReaderBuilderDefaults]

[CharReaderBuilderDefaults]

Definition at line 2172 of file bloaty/third_party/protobuf/conformance/third_party/jsoncpp/jsoncpp.cpp.

◆ strictMode() [1/2]

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]

[CharReaderBuilderStrictMode]

[CharReaderBuilderStrictMode]

Definition at line 2157 of file bloaty/third_party/protobuf/conformance/third_party/jsoncpp/jsoncpp.cpp.

◆ strictMode() [2/2]

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

Same as old Features::strictMode().

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

◆ validate() [1/2]

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

◆ validate() [2/2]

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 2135 of file bloaty/third_party/protobuf/conformance/third_party/jsoncpp/jsoncpp.cpp.

Member Data Documentation

◆ settings_

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.
  • "allowSpecialFloats": false or true
    • If true, special float values (NaNs and infinities) are allowed and their values are lossfree restorable.

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 1581 of file third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h.


The documentation for this class was generated from the following files:
Json::CharReaderBuilder
Build a CharReader implementation.
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:1541
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
profile_analyzer.builder
builder
Definition: profile_analyzer.py:159
Json
JSON (JavaScript Object Notation).
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:227
Json::parseFromStream
bool JSON_API parseFromStream(CharReader::Factory const &, std::istream &, Value *root, std::string *errs)
Definition: bloaty/third_party/protobuf/conformance/third_party/jsoncpp/jsoncpp.cpp:2191
value
const char * value
Definition: hpack_parser_table.cc:165
ok
bool ok
Definition: async_end2end_test.cc:197
error_ref_leak.errs
list errs
Definition: error_ref_leak.py:27
Json::Value
Represents a JSON value.
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:547


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:40