![]() |
ATSC3
24.10.0
|
JSON (JavaScript Object Notation). More...
Classes | |
| class | OurFeatures |
| class | OurReader |
| class | OurCharReader |
| struct | CommentStyle |
| Scoped enums are not available until C++11. More... | |
| struct | BuiltStyledStreamWriter |
| class | Features |
| Configuration passed to reader and writer. This configuration object can be used to force the Reader or Writer to behave in a standard conforming way. More... | |
| class | Exception |
| class | RuntimeError |
| class | LogicError |
| class | StaticString |
| Lightweight wrapper to tag static string. More... | |
| class | Value |
| Represents a JSON value. More... | |
| class | PathArgument |
| Experimental and untested: represents an element of the "path" to access a node. More... | |
| class | Path |
| Experimental and untested: represents a "path" to access a node. More... | |
| class | ValueIteratorBase |
| base class for Value iterators. More... | |
| class | ValueConstIterator |
| const iterator for object and array value. More... | |
| class | ValueIterator |
| Iterator for object and array value. More... | |
| class | Reader |
| Unserialize a JSON document into a Value. More... | |
| class | CharReader |
| class | CharReaderBuilder |
| Build a CharReader implementation. More... | |
| class | StreamWriter |
| class | StreamWriterBuilder |
| Build a StreamWriter implementation. More... | |
Typedefs | |
| typedef char | UIntToStringBuffer[uintToStringBufferSize] |
| typedef std::auto_ptr< CharReader > | CharReaderPtr |
| typedef std::auto_ptr< StreamWriter > | StreamWriterPtr |
| typedef int | Int |
| typedef unsigned int | UInt |
| typedef int64_t | Int64 |
| typedef uint64_t | UInt64 |
| typedef Int64 | LargestInt |
| typedef UInt64 | LargestUInt |
| typedef unsigned int | ArrayIndex |
Enumerations | |
| enum | { uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 } |
| enum | ValueType { nullValue = 0 , intValue , uintValue , realValue , stringValue , booleanValue , arrayValue , objectValue } |
| Type of the value held by a Value object. More... | |
| enum | CommentPlacement { commentBefore = 0 , commentAfterOnSameLine , commentAfter , numberOfCommentPlacement } |
| enum | PrecisionType { significantDigits = 0 , decimalPlaces } |
| Type of precision for formatting of real values. More... | |
Functions | |
| template<typename Iter > | |
| Iter | fixNumericLocale (Iter begin, Iter end) |
| template<typename Iter > | |
| void | fixNumericLocaleInput (Iter begin, Iter end) |
| template<typename Iter > | |
| Iter | fixZerosInTheEnd (Iter begin, Iter end) |
| bool | parseFromStream (CharReader::Factory const &fact, JSONCPP_ISTREAM &sin, Value *root, JSONCPP_STRING *errs) |
| JSONCPP_ISTREAM & | operator>> (JSONCPP_ISTREAM &, Value &) |
| Read from 'sin' into 'root'. More... | |
| JSONCPP_NORETURN void | throwRuntimeError (JSONCPP_STRING const &msg) |
| used internally | |
| JSONCPP_NORETURN void | throwLogicError (JSONCPP_STRING const &msg) |
| used internally | |
| JSONCPP_STRING | valueToString (LargestInt value) |
| JSONCPP_STRING | valueToString (LargestUInt value) |
| JSONCPP_STRING | valueToString (Int value) |
| JSONCPP_STRING | valueToString (UInt value) |
| JSONCPP_STRING | valueToString (double value, unsigned int precision, PrecisionType precisionType) |
| JSONCPP_STRING | valueToString (bool value) |
| JSONCPP_STRING | valueToQuotedString (const char *value) |
| JSONCPP_STRING | writeString (StreamWriter::Factory const &factory, Value const &root) |
| Write into stringstream, then return string, for convenience. A StreamWriter will be created from the factory, used, and then deleted. | |
| JSONCPP_OSTREAM & | operator<< (JSONCPP_OSTREAM &, const Value &root) |
| Output using the StyledStreamWriter. More... | |
| void | swap (Value &a, Value &b) |
| bool JSON_API | parseFromStream (CharReader::Factory const &, JSONCPP_ISTREAM &, Value *root, std::string *errs) |
| class | JSONCPP_DEPRECATED ("Use StreamWriter instead") JSON_API Writer |
| Abstract class for writers. More... | |
| class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API FastWriter class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API StyledWriter class | JSONCPP_DEPRECATED ("Use StreamWriterBuilder instead") JSON_API StyledStreamWriter |
| Outputs a Value in JSON format without formatting (not human friendly). More... | |
JSON (JavaScript Object Notation).
| anonymous enum |
| enum Json::PrecisionType |
| enum Json::ValueType |
Type of the value held by a Value object.
| Iter Json::fixNumericLocale | ( | Iter | begin, |
| Iter | end | ||
| ) |
Change ',' to '.' everywhere in buffer.
We had a sophisticated way, but it did not work in WinCE.
| Iter Json::fixZerosInTheEnd | ( | Iter | begin, |
| Iter | end | ||
| ) |
Return iterator that would be the new end of the range [begin,end), if we were to delete zeros in the end of string, but not the last zero before '.'.
| class Json::JSONCPP_DEPRECATED | ( | "Use StreamWriter instead" | ) |
Abstract class for writers.
| class JSONCPP_DEPRECATED ("Use StreamWriterBuilder instead") JSON_API FastWriter class JSONCPP_DEPRECATED ("Use StreamWriterBuilder instead") JSON_API StyledWriter class Json::JSONCPP_DEPRECATED | ( | "Use StreamWriterBuilder instead" | ) |
Outputs a Value in JSON format without formatting (not human friendly).
The JSON document is written in a single line. It is not intended for 'human' consumption, but may be useful to support feature such as RPC where bandwidth is limited.
Writes a Value in JSON format in a human friendly way.
The rules for line break and indent are as follow:
If the Value have comments then they are outputed according to their CommentPlacement.
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string.
The rules for line break and indent are as follow:
If the Value have comments then they are outputed according to their CommentPlacement.
| indentation | Each level will be indented by this amount extra. |
Serialize a Value in JSON format.
| out | Stream to write to. (Can be ostringstream, e.g.) |
| root | Value to serialize. |
| JSON_API JSONCPP_OSTREAM & Json::operator<< | ( | JSONCPP_OSTREAM & | , |
| const Value & | root | ||
| ) |
Output using the StyledStreamWriter.
| JSON_API JSONCPP_ISTREAM & Json::operator>> | ( | JSONCPP_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:
Result:
{
"dir": {
"file": {
// The input stream JSON would be nested here.
}
}
}
| std::exception | on parse error. |
| bool JSON_API Json::parseFromStream | ( | CharReader::Factory const & | , |
| JSONCPP_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.