Document::Element Class Reference

#include <Pt/Json/Document.h>

Modifiable document element.

Public Member Functions

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