HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_AutoJSONParser Class Reference

#include <UT_JSONParser.h>

Public Member Functions

 UT_AutoJSONParser (UT_IStream &is)
 Load JSON from the given UT_IStream. More...
 
 UT_AutoJSONParser (const char *buffer, int64 size)
 Load JSON from the given string. More...
 
 UT_AutoJSONParser (const UT_JSONValue &v)
 Load JSON from the UT_JSONValue. More...
 
 ~UT_AutoJSONParser ()
 
 operator UT_JSONParser & ()
 
void close ()
 Close the parser. More...
 
UT_JSONParserparser ()
 
UT_JSONParseroperator* ()
 
UT_JSONParseroperator-> ()
 

Detailed Description

Convenience class to create a JSON parser from a simple input

For example:

// Function to parse the JSON stream
bool load(UT_JSONParser &p) { ... }
// Function to parse from a std::string
bool load(const std::string &str)
{
UT_JSONAutoParser p(str.c_str(), str.size());
return load(*p);
}
// Function to parse from a UT_JSONValue
bool load(const UT_JSONValue &v)
{
UT_JSONAutoParser p(v);
return load(*p);
}

Definition at line 842 of file UT_JSONParser.h.

Constructor & Destructor Documentation

UT_AutoJSONParser::UT_AutoJSONParser ( UT_IStream is)

Load JSON from the given UT_IStream.

UT_AutoJSONParser::UT_AutoJSONParser ( const char *  buffer,
int64  size 
)

Load JSON from the given string.

UT_AutoJSONParser::UT_AutoJSONParser ( const UT_JSONValue v)

Load JSON from the UT_JSONValue.

UT_AutoJSONParser::~UT_AutoJSONParser ( )
inline

Definition at line 854 of file UT_JSONParser.h.

Member Function Documentation

void UT_AutoJSONParser::close ( )

Close the parser.

UT_AutoJSONParser::operator UT_JSONParser & ( )
inline

Definition at line 867 of file UT_JSONParser.h.

UT_JSONParser& UT_AutoJSONParser::operator* ( void  )
inline

Access to the parser

Definition at line 862 of file UT_JSONParser.h.

UT_JSONParser* UT_AutoJSONParser::operator-> ( void  )
inline

Access to the parser

Definition at line 863 of file UT_JSONParser.h.

UT_JSONParser& UT_AutoJSONParser::parser ( )
inline

Access to the parser

Definition at line 861 of file UT_JSONParser.h.


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