BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

#include <json.hpp>

Inheritance diagram for pj::JsonDocument:
pj::PersistentDocument

Public Member Functions

 JsonDocument ()
 
 ~JsonDocument ()
 
virtual void loadFile (const string &filename) throw (Error)
 
virtual void loadString (const string &input) throw (Error)
 
virtual void saveFile (const string &filename) throw (Error)
 
virtual string saveString () throw (Error)
 
virtual ContainerNodegetRootContainer () const
 
pj_json_elemallocElement () const
 
pj_pool_tgetPool ()
 
- Public Member Functions inherited from pj::PersistentDocument
virtual ~PersistentDocument ()
 
virtual void loadFile (const string &filename)=0 throw (Error)
 
virtual void loadString (const string &input)=0 throw (Error)
 
virtual void saveFile (const string &filename)=0 throw (Error)
 
virtual string saveString ()=0 throw (Error)
 
virtual ContainerNodegetRootContainer () const =0
 
bool hasUnread () const
 
string unreadName () const throw (Error)
 
int readInt (const string &name="") const throw (Error)
 
float readNumber (const string &name="") const throw (Error)
 
bool readBool (const string &name="") const throw (Error)
 
string readString (const string &name="") const throw (Error)
 
StringVector readStringVector (const string &name="") const throw (Error)
 
void readObject (PersistentObject &obj) const throw (Error)
 
ContainerNode readContainer (const string &name="") const throw (Error)
 
ContainerNode readArray (const string &name="") const throw (Error)
 
void writeNumber (const string &name, float num) throw (Error)
 
void writeInt (const string &name, int num) throw (Error)
 
void writeBool (const string &name, bool value) throw (Error)
 
void writeString (const string &name, const string &value) throw (Error)
 
void writeStringVector (const string &name, const StringVector &arr) throw (Error)
 
void writeObject (const PersistentObject &obj) throw (Error)
 
ContainerNode writeNewContainer (const string &name) throw (Error)
 
ContainerNode writeNewArray (const string &name) throw (Error)
 

Detailed Description

Persistent document (file) with JSON format.

Constructor & Destructor Documentation

◆ JsonDocument()

pj::JsonDocument::JsonDocument ( )

Default constructor

◆ ~JsonDocument()

pj::JsonDocument::~JsonDocument ( )

Destructor

Member Function Documentation

◆ loadFile()

virtual void pj::JsonDocument::loadFile ( const string &  filename)
throw (Error
)
virtual

Load this document from a file.

Parameters
filenameThe file name.

Implements pj::PersistentDocument.

◆ loadString()

virtual void pj::JsonDocument::loadString ( const string &  input)
throw (Error
)
virtual

Load this document from string.

Parameters
inputThe string.

Implements pj::PersistentDocument.

◆ saveFile()

virtual void pj::JsonDocument::saveFile ( const string &  filename)
throw (Error
)
virtual

Write this document to a file.

Parameters
filenameThe file name.

Implements pj::PersistentDocument.

◆ saveString()

virtual string pj::JsonDocument::saveString ( )
throw (Error
)
virtual

Write this document to string.

Implements pj::PersistentDocument.

◆ getRootContainer()

virtual ContainerNode & pj::JsonDocument::getRootContainer ( ) const
virtual

Get the root container node for this document

Implements pj::PersistentDocument.

◆ allocElement()

pj_json_elem * pj::JsonDocument::allocElement ( ) const

An internal function to create JSON element.

◆ getPool()

pj_pool_t * pj::JsonDocument::getPool ( )

An internal function to get the pool.


The documentation for this class was generated from the following file:
  • json.hpp

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.