NDEVR
API Documentation
JSONNode

JavaScript Object Notation or JSON is an open - standard file format that uses human - readable text to transmit data objects consisting of attribute–value pairs and array data types(or any other serializable value). More...

Collaboration diagram for JSONNode:
[legend]

Public Types

enum  NodeType {
  e_number , e_array , e_bool , e_object ,
  e_node , e_root
}
 Describes the type of data stored by a JSONNode. More...

Public Member Functions

 JSONNode ()
 JSONNode (const JSONNode &node)
 JSONNode (const String &node, const StringView &json_string)
 Creates a JSONNode by parsing a named node from a JSON string.
 JSONNode (File &file)
 JSONNode (JSONNode &&node) noexcept
 JSONNode (Scanner &scan)
 ~JSONNode ()
 Destroys the JSONNode and frees all child nodes.
decltype(auto) begin ()
 Returns a mutable iterator to the beginning of the children dictionary.
decltype(auto) begin () const
 Returns a const iterator to the beginning of the children dictionary.
const Buffer< JSONNode * > & children () const
 Returns the ordered list of child node pointers.
JSONNodecreateChildNode (const StringView &child_node, NodeType type)
 Creates a named child node with the specified type.
JSONNodecreateChildNode (NodeType type=NodeType::e_node)
 Creates an unnamed child node with the specified type.
decltype(auto) end ()
 Returns a mutable iterator to the end of the children dictionary.
decltype(auto) end () const
 Returns a const iterator to the end of the children dictionary.
const JSONNodeget (const StringView &child_node) const
template<class t_type>
t_type get (const StringView &child_node, const t_type &default_value) const
 Gets the value if it exists, otherwise returns the default value.
template<class t_type>
decltype(auto) getAs () const
template<class t_type>
bool getIfExists (const StringView &child_node, t_type &value) const
 Retrieves a child value if the node exists, returning whether it was found.
bool hasNode (const StringView &child_node) const
 Checks whether a child node with the given name exists.
bool isEmpty () const
const StringnodeName () const
 Returns the name of this node.
template<class t_type>
JSONNodeoperator= (const Angle< t_type > &value)
 Assigns an Angle value to this node, storing it as degrees.
template<class String>
JSONNodeoperator= (const Buffer< String > &buffer)
 Assigns a Buffer of Strings to this node as a quoted comma-separated array.
template<class String>
JSONNodeoperator= (const Buffer< StringView > &buffer)
 Assigns a Buffer of StringViews to this node as a quoted comma-separated array.
template<class t_type, class t_allocator>
JSONNodeoperator= (const Buffer< t_type, t_allocator > &buffer)
 Assigns a typed Buffer to this node as a comma-separated array.
JSONNodeoperator= (const JSONNode &node)
 A special case of the = operator for nodes.
template<uint01 t_dims, class t_type>
JSONNodeoperator= (const Ray< t_dims, t_type > &buffer)
 Assigns a Ray value to this node as a comma-separated array.
JSONNodeoperator= (const StringView &value)
 Assigns a string value to this node, setting the type to e_object.
template<class t_type>
JSONNodeoperator= (const t_type &value)
JSONNodeoperator= (const Time &time)
template<uint01 t_dims, class t_type>
JSONNodeoperator= (const Vector< t_dims, t_type > &buffer)
 Assigns a Vector value to this node as a comma-separated array.
template<uint01 t_dims, class t_type>
JSONNodeoperator= (const Vertex< t_dims, t_type > &buffer)
 Assigns a Vertex value to this node as a comma-separated array.
JSONNodeoperator[] (const StringView &child_node)
 Returns a mutable reference to the named child node, creating it if it does not exist.
const JSONNodeoperator[] (const StringView &child_node) const
JSONNodeoperator[] (const uint04 &child_idx)
const JSONNodeoperator[] (const uint04 &child_idx) const
 Returns a const reference to the child node at the given index.
void remove (const StringView &child_node)
 Removes the child node with the given name from this node.
template<class t_type>
void setOrClearIfDefault (const StringView &child_node, const t_type &value, const t_type &default_value)
 Sets the value of the child node if value differs from the default value, otherwise clears the child.
uint04 size ()
NodeType type () const
void write (File &file)
 Writes the JSON structure out to a file with no frills.
void write (std::ostream &file)
 Writes the JSON structure to an output stream.
void write (String &stream) const
void writePretty (File &file)
 Writes our structure out to a file using tabs and new lines.
void writePretty (std::ostream &file)
 Writes the JSON structure to an output stream with human-readable formatting.
void writePretty (String &stream, const uint04 tab_indention=0) const
 Same as write, but adds tabs and new lines to make it easier to read, though will result in larger file.
void writeValue (String &stream) const
 Writes only the value portion of this node to the given string stream.

Static Public Member Functions

static JSONNode ParseYAML (Scanner &scan)
 Parses a YAML document from the given scanner and returns it as a JSONNode tree.

Protected Member Functions

 JSONNode (const StringView &name)
bool parseJSON (Scanner &scan)
bool parseJSONContent (char start, Scanner &scan)
 Parses JSON content starting from the given character.
void parseYAMLContent (StringView value)
 Parses a YAML value from a string view and sets this node accordingly.
bool parseYAMLContent (uint04 indentention, Scanner &scan)
void readArray (Scanner &scan)
void readChildrenNodes (Scanner &scan)
void readData (Scanner &scan)
template<uint01 t_dims, class t_type>
void setVector (const Vector< t_dims, t_type > &buffer)
 Sets the node value from a Vector, storing it as a comma-separated array string.

Static Protected Member Functions

static TranslatedString BadChildErrorString (const Scanner &scan)
 Generates a translated error message for a malformed child node.
static void ConvertFromJSONString (String &string)
 Unescapes JSON escape sequences in the string back to their original characters.
static void ConvertToJSONString (String &string)
 Escapes special characters in the string for JSON output.
static TranslatedString DuplicateChildErrorString (const StringView &child, const Scanner &scan)
 Generates a translated error message for a duplicate child node name.
static TranslatedString UnexpectedCharErrorString (char current_char, const Scanner &scan)
 Generates a translated error message for an unexpected character during parsing.
static void WriteTabs (String &stream, uint04 tab_indention)

Protected Attributes

Dictionary< StringView, JSONNode * > m_json_children
 Dictionary of child nodes keyed by name. Empty if the node type is not e_node or e_root.
const String m_name
 The name of this node.
Buffer< JSONNode * > m_sorted_json_children
 Ordered list of child node pointers preserving insertion order.
NodeType m_type
 The type classification of this node.
String m_value
 The stored value of this node as a string.

Detailed Description

JavaScript Object Notation or JSON is an open - standard file format that uses human - readable text to transmit data objects consisting of attribute–value pairs and array data types(or any other serializable value).


Class: JSONNode

It is a very common data format used for asynchronous browser–server communication, including as a replacement for XML in some AJAX - style systems.

The JSONNode class serves as a container for data and it's children. Includes options to read and write from streams and files.

Author: Tyler Parke

Date: 2017-11-13

See also
INIFactory, File

Definition at line 148 of file JSONParser.h.

Member Enumeration Documentation

◆ NodeType

Describes the type of data stored by a JSONNode.

Enumerator
e_number 

Stores a number (may be integer or floating point).

e_array 

Stores an array of values.

e_bool 

Stores a boolean true/false.

e_object 

Stores an object with data that is not a number type.

e_node 

Is a node storing a number of children JSON nodes.

e_root 

Is a root node, meaning it has no parent.

Definition at line 155 of file JSONParser.h.

Constructor & Destructor Documentation

◆ JSONNode() [1/7]

◆ JSONNode() [2/7]

JSONNode::JSONNode ( const StringView & name)
protected

Creates a JSONNode with a given name

Author: Tyler Parke

Date: 2017-11-19

◆ JSONNode() [3/7]

JSONNode::JSONNode ( const JSONNode & node)

Very basic copy constructor.

Author: Tyler Parke

Date: 2017-11-19

References JSONNode().

◆ JSONNode() [4/7]

JSONNode::JSONNode ( JSONNode && node)
noexcept

Very basic move constructor.

Author: Tyler Parke

Date: 2017-11-19

References JSONNode().

◆ JSONNode() [5/7]

JSONNode::JSONNode ( Scanner & scan)

Creates a JSONNode by parsing it from the scanner. Scanner should be at the start of the file or stream just before the opening '{'

Author: Tyler Parke

Date: 2017-11-19

◆ JSONNode() [6/7]

JSONNode::JSONNode ( const String & node,
const StringView & json_string )

Creates a JSONNode by parsing a named node from a JSON string.


Parameters
[in]nodeThe name to assign to this node.
[in]json_stringThe JSON string to parse.

◆ JSONNode() [7/7]

JSONNode::JSONNode ( File & file)

Creates a JSONNode by parsing it from the File.

Author: Tyler Parke

Date: 2017-11-19

◆ ~JSONNode()

JSONNode::~JSONNode ( )

Destroys the JSONNode and frees all child nodes.


Member Function Documentation

◆ BadChildErrorString()

TranslatedString JSONNode::BadChildErrorString ( const Scanner & scan)
staticprotected

Generates a translated error message for a malformed child node.

Parameters
[in]scanThe scanner providing position context for the error.
Returns
A TranslatedString describing the error.

◆ begin() [1/2]

decltype(auto) JSONNode::begin ( )
inlinenodiscard

Returns a mutable iterator to the beginning of the children dictionary.

Returns
An iterator to the first child entry.

Definition at line 681 of file JSONParser.h.

References m_json_children.

◆ begin() [2/2]

decltype(auto) JSONNode::begin ( ) const
inlinenodiscard

Returns a const iterator to the beginning of the children dictionary.

Returns
A const iterator to the first child entry.

Definition at line 689 of file JSONParser.h.

References m_json_children.

◆ children()

const Buffer< JSONNode * > & JSONNode::children ( ) const
inline

Returns the ordered list of child node pointers.

Returns
A const reference to the buffer of child JSONNode pointers.

Definition at line 392 of file JSONParser.h.

References m_sorted_json_children.

Referenced by IconManager::fromJSON().

◆ ConvertFromJSONString()

void JSONNode::ConvertFromJSONString ( String & string)
staticprotected

Unescapes JSON escape sequences in the string back to their original characters.

Parameters
[in]stringThe JSON string to convert in place to its unescaped form.

◆ ConvertToJSONString()

void JSONNode::ConvertToJSONString ( String & string)
staticprotected

Escapes special characters in the string for JSON output.

Parameters
[in]stringThe string to convert in place to a JSON-safe representation.

◆ createChildNode() [1/2]

JSONNode & JSONNode::createChildNode ( const StringView & child_node,
NodeType type )

Creates a named child node with the specified type.

Parameters
[in]child_nodeThe name for the new child node.
[in]typeThe NodeType for the new child node.
Returns
A reference to the newly created child JSONNode.

References JSONNode(), and type().

◆ createChildNode() [2/2]

JSONNode & JSONNode::createChildNode ( NodeType type = NodeType::e_node)
inline

Creates an unnamed child node with the specified type.

Parameters
[in]typeThe NodeType for the new child node, defaults to e_node.
Returns
A reference to the newly created child JSONNode.

Definition at line 462 of file JSONParser.h.

References JSONNode(), createChildNode(), e_node, and type().

Referenced by createChildNode().

◆ DuplicateChildErrorString()

TranslatedString JSONNode::DuplicateChildErrorString ( const StringView & child,
const Scanner & scan )
staticprotected

Generates a translated error message for a duplicate child node name.

Parameters
[in]childThe name of the duplicate child node.
[in]scanThe scanner providing position context for the error.
Returns
A TranslatedString describing the error.

◆ end() [1/2]

decltype(auto) JSONNode::end ( )
inlinenodiscard

Returns a mutable iterator to the end of the children dictionary.

Returns
An iterator past the last child entry.

Definition at line 698 of file JSONParser.h.

References m_json_children.

◆ end() [2/2]

decltype(auto) JSONNode::end ( ) const
inlinenodiscard

Returns a const iterator to the end of the children dictionary.

Returns
A const iterator past the last child entry.

Definition at line 706 of file JSONParser.h.

References m_json_children.

◆ get()

const JSONNode & JSONNode::get ( const StringView & child_node) const
inline

returns the child, if it exists. Is read only. Same as (*this)[child_node]

Author: Tyler Parke

Date: 2017-11-19

Parameters: child_node - The name of the node you want to return. Must be an existing child node.

Definition at line 330 of file JSONParser.h.

References JSONNode(), and m_json_children.

◆ getAs()

template<class t_type>
decltype(auto) JSONNode::getAs ( ) const
inline

Returns this object as the type specified.

Author: Tyler Parke

Date: 2017-11-19

Definition at line 315 of file JSONParser.h.

References JSONToStringHelper< t_type >::Convert(), and m_value.

Referenced by Customer::company(), Customer::email(), IconDefinition::fromJSON(), CustomerDevice::osName(), CustomerDevice::serialNumber(), and HardwareCommandQueue< t_type >::setFromJSONInfo().

◆ getIfExists()

template<class t_type>
bool JSONNode::getIfExists ( const StringView & child_node,
t_type & value ) const
inline

Retrieves a child value if the node exists, returning whether it was found.

Parameters
[in]child_nodeThe name of the child node to look up.
[in]valueReference to store the retrieved value if found.
Returns
True if the child node was found and the value was set, false otherwise.

Definition at line 444 of file JSONParser.h.

References m_json_children.

◆ hasNode()

bool JSONNode::hasNode ( const StringView & child_node) const
inline

Checks whether a child node with the given name exists.

Parameters
[in]child_nodeThe name of the child node to look for.
Returns
True if the child node exists, false otherwise.

Definition at line 401 of file JSONParser.h.

References m_json_children.

Referenced by HardwareCommandQueue< t_type >::setFromJSONInfo().

◆ isEmpty()

bool JSONNode::isEmpty ( ) const
inlinenodiscard

Returns true if the node contains no information.

Author: Tyler Parke

Date: 2019-14-12

Definition at line 637 of file JSONParser.h.

References m_json_children, and m_value.

◆ nodeName()

const String & JSONNode::nodeName ( ) const
inline

Returns the name of this node.

Returns
A const reference to the node name string.

Definition at line 410 of file JSONParser.h.

References m_name.

Referenced by operator=(), and operator[]().

◆ operator=() [1/11]

template<class t_type>
JSONNode & JSONNode::operator= ( const Angle< t_type > & value)
inline

Assigns an Angle value to this node, storing it as degrees.

Parameters
[in]valueThe Angle value to assign.
Returns
A reference to this JSONNode.

Definition at line 517 of file JSONParser.h.

References JSONNode(), e_object, m_type, and m_value.

◆ operator=() [2/11]

template<class String>
JSONNode & JSONNode::operator= ( const Buffer< String > & buffer)
inline

Assigns a Buffer of Strings to this node as a quoted comma-separated array.

Parameters
[in]bufferThe buffer of strings to assign.
Returns
A reference to this JSONNode.

Definition at line 563 of file JSONParser.h.

References JSONNode(), e_array, m_type, and m_value.

◆ operator=() [3/11]

template<class String>
JSONNode & JSONNode::operator= ( const Buffer< StringView > & buffer)
inline

Assigns a Buffer of StringViews to this node as a quoted comma-separated array.

Parameters
[in]bufferThe buffer of string views to assign.
Returns
A reference to this JSONNode.

Definition at line 583 of file JSONParser.h.

References JSONNode(), e_array, m_type, and m_value.

◆ operator=() [4/11]

template<class t_type, class t_allocator>
JSONNode & JSONNode::operator= ( const Buffer< t_type, t_allocator > & buffer)
inline

Assigns a typed Buffer to this node as a comma-separated array.

Parameters
[in]bufferThe buffer of values to assign.
Returns
A reference to this JSONNode.

Definition at line 544 of file JSONParser.h.

References JSONNode(), e_array, m_type, and m_value.

◆ operator=() [5/11]

JSONNode & JSONNode::operator= ( const JSONNode & node)
inline

A special case of the = operator for nodes.

Note that this will not set the name of the node, but set the contents equal to that of another

Definition at line 477 of file JSONParser.h.

References JSONNode(), e_node, e_root, m_json_children, m_sorted_json_children, m_type, m_value, and nodeName().

◆ operator=() [6/11]

template<uint01 t_dims, class t_type>
JSONNode & JSONNode::operator= ( const Ray< t_dims, t_type > & buffer)
inline

Assigns a Ray value to this node as a comma-separated array.

Parameters
[in]bufferThe Ray to assign.
Returns
A reference to this JSONNode.

Definition at line 625 of file JSONParser.h.

References JSONNode(), and setVector().

◆ operator=() [7/11]

JSONNode & JSONNode::operator= ( const StringView & value)
inline

Assigns a string value to this node, setting the type to e_object.

Parameters
[in]valueThe string value to assign.
Returns
A reference to this JSONNode.

Definition at line 505 of file JSONParser.h.

References JSONNode(), e_object, m_type, and m_value.

◆ operator=() [8/11]

template<class t_type>
JSONNode & JSONNode::operator= ( const t_type & value)
inline

A general case t_type equals. Sets the value internal and predicts the type.

Author: Tyler Parke

Date: 2017-11-19

Definition at line 650 of file JSONParser.h.

References JSONNode(), e_array, e_bool, e_number, e_object, m_type, and m_value.

◆ operator=() [9/11]

JSONNode & JSONNode::operator= ( const Time & time)
inline

A special case Time equals. writes in YYYY/MM/DDTHH:mm:ss.fffZ format.

Author: Tyler Parke

Date: 2017-11-19

Definition at line 531 of file JSONParser.h.

References JSONNode(), e_object, Time::getAsString(), m_type, and m_value.

◆ operator=() [10/11]

template<uint01 t_dims, class t_type>
JSONNode & JSONNode::operator= ( const Vector< t_dims, t_type > & buffer)
inline

Assigns a Vector value to this node as a comma-separated array.

Parameters
[in]bufferThe Vector to assign.
Returns
A reference to this JSONNode.

Definition at line 603 of file JSONParser.h.

References JSONNode(), and setVector().

◆ operator=() [11/11]

template<uint01 t_dims, class t_type>
JSONNode & JSONNode::operator= ( const Vertex< t_dims, t_type > & buffer)
inline

Assigns a Vertex value to this node as a comma-separated array.

Parameters
[in]bufferThe Vertex to assign.
Returns
A reference to this JSONNode.

Definition at line 614 of file JSONParser.h.

References JSONNode(), and setVector().

◆ operator[]() [1/4]

JSONNode & JSONNode::operator[] ( const StringView & child_node)
inline

Returns a mutable reference to the named child node, creating it if it does not exist.

Parameters
[in]child_nodeThe name of the child node to access or create.
Returns
A mutable reference to the child JSONNode.

Definition at line 353 of file JSONParser.h.

References JSONNode(), m_json_children, m_sorted_json_children, and nodeName().

◆ operator[]() [2/4]

const JSONNode & JSONNode::operator[] ( const StringView & child_node) const
inline

returns the child, if it exists. Is read only. Same as get

Author: Tyler Parke

Date: 2017-11-19

Parameters: child_node - The name of the node you want to return. Must be an existing child node.

Definition at line 344 of file JSONParser.h.

References JSONNode(), and m_json_children.

◆ operator[]() [3/4]

JSONNode & JSONNode::operator[] ( const uint04 & child_idx)
inline

Returns the child, if it exists.

Author: Tyler Parke

Date: 2017-11-19

Parameters: child_idx - The index of the node you want to return.

Definition at line 374 of file JSONParser.h.

References JSONNode(), and m_sorted_json_children.

◆ operator[]() [4/4]

const JSONNode & JSONNode::operator[] ( const uint04 & child_idx) const
inline

Returns a const reference to the child node at the given index.

Parameters
[in]child_idxThe index of the child node.
Returns
A const reference to the child JSONNode.

Definition at line 383 of file JSONParser.h.

References JSONNode(), and m_sorted_json_children.

◆ parseJSON()

bool JSONNode::parseJSON ( Scanner & scan)
protected

Reads in the next JSON item and adds it to this node's children

Parameters: scan - The object tasked with reading in our data. Shold be just past the second '"' at the end of the node's title at this point.

Author: Tyler Parke

Date: 2017-11-19

Returns
true if there is an adjacent child next to this one, false if end of stream or no additional children.

◆ parseJSONContent()

bool JSONNode::parseJSONContent ( char start,
Scanner & scan )
protected

Parses JSON content starting from the given character.

Parameters
[in]startThe character that begins this content section.
[in]scanThe scanner to read from.
Returns
True if there is an adjacent sibling to parse, false otherwise.

◆ ParseYAML()

JSONNode JSONNode::ParseYAML ( Scanner & scan)
static

Parses a YAML document from the given scanner and returns it as a JSONNode tree.

Parameters
[in]scanThe scanner positioned at the start of the YAML content.
Returns
A JSONNode representing the parsed YAML structure.

References JSONNode().

◆ parseYAMLContent() [1/2]

void JSONNode::parseYAMLContent ( StringView value)
protected

Parses a YAML value from a string view and sets this node accordingly.

Parameters
[in]valueThe string view containing the YAML value to parse.

◆ parseYAMLContent() [2/2]

bool JSONNode::parseYAMLContent ( uint04 indentention,
Scanner & scan )
protected

Reads in the next YAML item and adds it to this node's children

Parameters: scan - The object tasked with reading in our data. Shold be just past the second '"' at the end of the node's title at this point.

Author: Tyler Parke

Date: 2024-07-08

Returns
true if there is an adjacent child next to this one, false if end of stream or no additional children.

◆ readArray()

void JSONNode::readArray ( Scanner & scan)
protected

Reads in an array of items for this child.

Parameters: scan - The object tasked with reading in our data. Shold be just past the first '[' specifying the beginning of the array

Author: Tyler Parke

Date: 2017-11-19

◆ readChildrenNodes()

void JSONNode::readChildrenNodes ( Scanner & scan)
protected

Reads in all of the children nodes for this node and adds them to the children list

Parameters: scan - The object tasked with reading in our data. Shold be just before the first '"' specifying the title

Author: Tyler Parke

Date: 2017-11-19

◆ readData()

void JSONNode::readData ( Scanner & scan)
protected

Reads in a single object type for this child.

Parameters: scan - The object tasked with reading in our data. Shold be just past the first '"' specifying the data

Author: Tyler Parke

Date: 2017-11-19

◆ remove()

void JSONNode::remove ( const StringView & child_node)

Removes the child node with the given name from this node.

Parameters
[in]child_nodeThe name of the child node to remove.

Referenced by setOrClearIfDefault().

◆ setVector()

template<uint01 t_dims, class t_type>
void JSONNode::setVector ( const Vector< t_dims, t_type > & buffer)
inlineprotected

Sets the node value from a Vector, storing it as a comma-separated array string.

Parameters
[in]bufferThe Vector whose components are written as the node value.

Definition at line 829 of file JSONParser.h.

References e_array, m_type, and m_value.

Referenced by operator=(), operator=(), and operator=().

◆ size()

uint04 JSONNode::size ( )
inline

Returns the number of children within this node.

Author: Tyler Parke

Date: 2017-11-19

Definition at line 673 of file JSONParser.h.

References cast(), and m_json_children.

◆ type()

NodeType JSONNode::type ( ) const

Author: Tyler Parke

Date: 2017-11-19

Returns
The type of the node which will give a hint as to how the contents should be written to a file, or interpretted by the program

Referenced by createChildNode(), and createChildNode().

◆ UnexpectedCharErrorString()

TranslatedString JSONNode::UnexpectedCharErrorString ( char current_char,
const Scanner & scan )
staticprotected

Generates a translated error message for an unexpected character during parsing.

Parameters
[in]current_charThe unexpected character encountered.
[in]scanThe scanner providing position context for the error.
Returns
A TranslatedString describing the error.

◆ write() [1/3]

void JSONNode::write ( File & file)

Writes the JSON structure out to a file with no frills.


Same as write(String&) but for files.

Author: Tyler Parke

Date: 2017-11-19

Parameters: file - The file where you want the JSON node to be written

◆ write() [2/3]

void JSONNode::write ( std::ostream & file)

Writes the JSON structure to an output stream.

Parameters
[in]fileThe output stream to write to.

◆ write() [3/3]

void JSONNode::write ( String & stream) const

A no frills write routine. Useful for writing to a file.

Author: Tyler Parke

Date: 2017-11-19

Parameters: stream - The stream where you want the JSON node to be written

◆ writePretty() [1/3]

void JSONNode::writePretty ( File & file)

Writes our structure out to a file using tabs and new lines.


Same as writePretty(String&) but for files.

Author: Tyler Parke

Date: 2017-11-19

Parameters: file - The file where you want the JSON node to be written

◆ writePretty() [2/3]

void JSONNode::writePretty ( std::ostream & file)

Writes the JSON structure to an output stream with human-readable formatting.

Parameters
[in]fileThe output stream to write to.

◆ writePretty() [3/3]

void JSONNode::writePretty ( String & stream,
const uint04 tab_indention = 0 ) const

Same as write, but adds tabs and new lines to make it easier to read, though will result in larger file.


Author: Tyler Parke

Date: 2017-11-19

Parameters: stream - The stream where you want the JSON node to be written tab_indention - The number of tabs to place before writing data

◆ WriteTabs()

void JSONNode::WriteTabs ( String & stream,
uint04 tab_indention )
staticprotected

Writes tabs to the file

Parameters: stream - Where to append the tabs tab_indention - The number of tabs to write

Author: Tyler Parke

Date: 2017-11-19

◆ writeValue()

void JSONNode::writeValue ( String & stream) const

Writes only the value portion of this node to the given string stream.

Parameters
[in]streamThe string to append the value to.

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