class::var::JsonDocument

class var::JsonDocument
  : public api::WorkObject

The Json class is a JsonValue that can be loaded and saved from either memory or the filesystem.

Summary

[JsonDocument](#classvar_1_1_json_document_1abcd7631c263e58607d89d771eebd31fa)(  

u32 o_flags
)

const JsonError & error() const

u32 flags() const

JsonValue load(

const arg::SourceFilePath path
)

JsonValue load(

const arg::JsonEncodedString json
)

JsonValue load(

const arg::SourceFile file
)

JsonValue load(

json_load_callback_t callback,
void * context
)

int save(

const arg::SourceJsonValue value,
const arg::DestinationFilePath path
) const

int save(

const arg::SourceJsonValue value,
const arg::DestinationFile file
) const

int save(

const JsonValue & value,
json_dump_callback_t callback,
void * context
) const

void set_flags(

u32 flags
)

var::String stringify(

const arg::ImplicitSourceJsonValue value
) const

var::String to_string(

const arg::ImplicitSourceJsonValue value
) const

enum flags

Members

JsonDocument(

u32 o_flags
)

Constructs a Json object from a JsonValue.

Parameters

  • value JsonValue in memory that this class will refer to.

const JsonError & error() const

u32 flags() const

JsonValue load(

const arg::SourceFilePath path
)

Loads a JSON value from a file

Parameters

  • path The path to the file

Returns

Zero on success


JsonValue load(

const arg::JsonEncodedString json
)

Loads a JSON value from a data object

Parameters

  • data A reference to the data object containing the JSON

Returns


JsonValue load(

const arg::SourceFile file
)

Loads a JSON value from an already open file

Parameters

  • file A reference to the file containing JSON

Returns

Zero on success


JsonValue load(

json_load_callback_t callback,
void * context
)

Loads a JSON value from streaming data

Parameters

  • callback The function to call when more data is available

  • context This is passed to callback but not used internally

Returns

Zero on success


int save(

const arg::SourceJsonValue value,
const arg::DestinationFilePath path
) const


int save(

const arg::SourceJsonValue value,
const arg::DestinationFile file
) const


int save(

const JsonValue & value,
json_dump_callback_t callback,
void * context
) const


void set_flags(

u32 flags
)


var::String stringify(

const arg::ImplicitSourceJsonValue value
) const


var::String to_string(

const arg::ImplicitSourceJsonValue value
) const


enum flags
  • REJECT_DUPLICATES
  • DISABLE_EOF_CHECK
  • DECODE_ANY
  • DECODE_INT_AS_REAL
  • ALLOW_NULL
  • INDENT_1
  • INDENT_2
  • INDENT_3
  • INDENT_4
  • INDENT_5
  • INDENT_6
  • INDENT_7
  • INDENT_8
  • COMPACT
  • ENSURE_ASCII
  • ENCODE_ANY
  • PRESERVE_ORDER
  • ESCAPE_SLASH
  • EMBED

X

Thanks for Coming!

Subscribe to news and updates