Orcus
Public Types | Public Member Functions | List of all members
orcus::json_document_tree Class Reference

#include <json_document_tree.hpp>

Public Types

typedef json::detail::node node
 

Public Member Functions

 json_document_tree (string_pool &pool)
 
void load (const std::string &strm, const json_config &config)
 
void load (const char *p, size_t n, const json_config &config)
 
node get_document_root () const
 
std::string dump () const
 
std::string dump_xml () const
 

Detailed Description

This class stores a parsed JSON document tree structure.

Member Function Documentation

std::string orcus::json_document_tree::dump ( ) const

Dump the JSON document tree to string.

Returns
a string representation of the JSON document tree.
std::string orcus::json_document_tree::dump_xml ( ) const

Dump the JSON document tree to an XML structure.

Returns
a string containing an XML structure representing the JSON content.
node orcus::json_document_tree::get_document_root ( ) const

Get the root node of the document.

Returns
root node of the document.
void orcus::json_document_tree::load ( const std::string &  strm,
const json_config config 
)

Load raw string stream containing a JSON structure to populate the document tree.

Parameters
strmstream containing a JSON structure.
configconfiguration object.
void orcus::json_document_tree::load ( const char *  p,
size_t  n,
const json_config config 
)

Load raw string stream containing a JSON structure to populate the document tree.

Parameters
ppointer to the stream containing a JSON structure.
nsize of the stream.
configconfiguration object.