rippled
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Json::Array Class Reference

Represents a JSON array being written to a Writer. More...

Inheritance diagram for Json::Array:
Inheritance graph
[legend]
Collaboration diagram for Json::Array:
Collaboration graph
[legend]

Public Member Functions

template<typename Scalar >
void append (Scalar const &)
 Append a scalar to the Arrary. More...
 
void append (Json::Value const &)
 Appends a Json::Value to an array. More...
 
Object appendObject ()
 Append a new Object and return it. More...
 
Array appendArray ()
 Append a new Array and return it. More...
 

Protected Member Functions

 Array (Collection *parent, Writer *w)
 

Private Member Functions

void checkWritable (std::string const &label)
 

Private Attributes

Collectionparent_
 
Writerwriter_
 
bool enabled_
 

Friends

class Object
 

Detailed Description

Represents a JSON array being written to a Writer.

Definition at line 245 of file Object.h.

Constructor & Destructor Documentation

◆ Array()

Json::Array::Array ( Collection parent,
Writer w 
)
protected

Definition at line 282 of file Object.h.

Member Function Documentation

◆ append() [1/2]

template<typename Scalar >
void Json::Array::append ( Scalar const &  value)

Append a scalar to the Arrary.

Throws an exception if this array is disabled (which means that one of its sub-collections is enabled).

Definition at line 397 of file Object.h.

◆ append() [2/2]

void Json::Array::append ( Json::Value const &  v)

Appends a Json::Value to an array.

Throws an exception if this Array was disabled.

Definition at line 140 of file Object.cpp.

◆ appendObject()

Object Json::Array::appendObject ( )

Append a new Object and return it.

This Array is disabled until that sub-object is destroyed. Throws an exception if this Array was disabled.

Definition at line 101 of file Object.cpp.

◆ appendArray()

Array Json::Array::appendArray ( )

Append a new Array and return it.

This Array is disabled until that sub-array is destroyed. Throws an exception if this Array was already disabled.

Definition at line 110 of file Object.cpp.

◆ checkWritable()

void Json::Collection::checkWritable ( std::string const &  label)
protectedinherited

Definition at line 65 of file Object.cpp.

Friends And Related Function Documentation

◆ Object

friend class Object
friend

Definition at line 281 of file Object.h.

Member Data Documentation

◆ parent_

Collection* Json::Collection::parent_
protectedinherited

Definition at line 168 of file Object.h.

◆ writer_

Writer* Json::Collection::writer_
protectedinherited

Definition at line 169 of file Object.h.

◆ enabled_

bool Json::Collection::enabled_
protectedinherited

Definition at line 170 of file Object.h.