HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
json.h File Reference
#include "pxr/pxr.h"
#include "pxr/base/js/api.h"
#include "pxr/base/js/value.h"
#include <iosfwd>
#include <string>
+ Include dependency graph for json.h:

Go to the source code of this file.

Classes

struct  JsParseError
 
class  JsWriter
 

Functions

JS_API JsValue JsParseStream (std::istream &istr, JsParseError *error=0)
 
JS_API JsValue JsParseString (const std::string &data, JsParseError *error=0)
 
JS_API void JsWriteToStream (const JsValue &value, std::ostream &ostr)
 
JS_API std::string JsWriteToString (const JsValue &value)
 Convert the JsValue value to JSON and return it as a string. More...
 
JS_API void JsWriteValue (JsWriter *writer, const JsValue &value)
 Write a json value. More...
 

Detailed Description

Top-level entrypoints for reading and writing JSON.

Definition in file json.h.

Function Documentation

JS_API JsValue JsParseStream ( std::istream &  istr,
JsParseError error = 0 
)

Parse the contents of input stream istr and return a JsValue. On failure, this returns a null JsValue.

JS_API JsValue JsParseString ( const std::string data,
JsParseError error = 0 
)

Parse the contents of the JSON string data and return it as a JsValue. On failure, this returns a null JsValue.

JS_API void JsWriteToStream ( const JsValue value,
std::ostream &  ostr 
)

Convert the JsValue value to JSON and write the result to output stream ostr.

JS_API std::string JsWriteToString ( const JsValue value)

Convert the JsValue value to JSON and return it as a string.

JS_API void JsWriteValue ( JsWriter writer,
const JsValue value 
)

Write a json value.