Document::Element Class Reference

#include <Pt/Json/Document.h>

Modifiable document element.

Public Member Functions

Element addElement ()
 Adds a sub element.
 
Element addMember (const char *name)
 Adds a sub element.
 
Element addMember (const std::string &name)
 Adds a sub element.
 
Element begin () const
 Begin of sub elements.
 
Element end () const
 End of sub elements.
 
Element getMember (const std::string &name) const
 Returns a sub element.
 
Element getMember (const char *name) const
 Returns a sub element.
 
template<typename T >
bool getValue (T &value) const
 Gets the value.
 
bool isNull () const
 Returns true if element is null.
 
const char * name () const
 Returns the element name.
 
bool operator! () const
 Returns true if element is invalid.
 
bool operator!= (const Element &other) const
 Allows using the element like an iterator.
 
Elementoperator* ()
 Allows using the element like an iterator.
 
Elementoperator++ ()
 Allows using the element like an iterator.
 
Elementoperator-> ()
 Allows using the element like an iterator.
 
bool operator== (const Element &other) const
 Allows using the element like an iterator.
 
Element operator[] (const std::string &name) const
 Returns a sub element.
 
Element operator[] (const char *name) const
 Returns a sub element.
 
Element parent () const
 Returns the parent element.
 
void removeElement (const Element &e)
 Removes a sub element.
 
void removeMember (const std::string &name)
 Removes a sub element.
 
void removeMember (const char *name)
 Removes a sub element.
 
void setNull ()
 Sets element to null.
 
template<typename T >
void setValue (const T &value)
 Sets the value.