40 #include <ptbuildopts.h>
151 void PrintOn(ostream & strm)
const;
315 virtual void Output(ostream & strm,
const PXMLBase & xml,
int indent)
const = 0;
343 void Output(ostream & strm,
const PXMLBase & xml,
int indent)
const;
361 void PrintOn(ostream & strm)
const;
362 void Output(ostream & strm,
const PXMLBase & xml,
int indent)
const;
390 bool setDirty =
true);
479 bool Parse(
const char * data,
int dataLen,
bool final);
482 virtual void StartElement(
const char * name,
const char **attrs);
489 int hasInternalSubSet);
531 #endif // PTLIB_PXML_H
PXMLParser(int options=NoOptions)
This class waits for the semaphore on construction and automatically signals the semaphore on destruc...
Definition: psync.h:86
PCaselessString GetDocumentType() const
PXMLElement * AddChild(PXMLElement *elem, bool dirty=true)
PXMLObjectArray subObjects
Definition: pxml.h:435
void SetOptions(int opts)
Definition: pxml.h:93
unsigned m_maxEntityLength
Definition: pxml.h:110
PString GetVersion() const
Definition: pxml.h:494
PString m_defaultNameSpace
Definition: pxml.h:252
PString GetDocType() const
Definition: pxml.h:222
unsigned m_errorLine
Definition: pxml.h:246
PCaselessString PrependNamespace(const PCaselessString &name) const
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:55
PXMLElement * currentElement
Definition: pxml.h:506
void SetData(const PString &data)
PINDEX GetNumAttributes() const
Definition: pxml.h:397
PString encoding
Definition: pxml.h:508
unsigned GetErrorColumn() const
Definition: pxml.h:219
PXMLBase(int opts=NoOptions)
PXMLObject * GetNextObject() const
void Output(ostream &strm, const PXMLBase &xml, int indent) const
bool loadFromFile
Definition: pxml.h:240
unsigned GetErrorLine() const
Definition: pxml.h:220
ValidationOp m_op
Definition: pxml.h:199
PString GetDataAttribute(PINDEX idx) const
void SetAttribute(const PCaselessString &key, const PString &value, bool setDirty=true)
bool LoadFile(const PFilePath &fn, Options options=NoOptions)
PString value
Definition: pxml.h:348
bool HasAttributes() const
Definition: pxml.h:396
PINDEX m_maxCount
Definition: pxml.h:210
__inline friend Options operator|(Options o1, Options o2)
Definition: pxml.h:81
void SetAttribute(const PCaselessString §ion, const PString &key, const PString &value)
virtual void Output(ostream &strm, const PXMLBase &xml, int indent) const =0
A class representing a configuration for the application.
Definition: config.h:67
ValidationOp
Definition: pxml.h:167
bool Load(const PString &data, Options options=NoOptions)
This class is a standard C++ stream class descendent for reading or writing streamed data to or from ...
Definition: pstring.h:1878
static PString CreateTagNoData(const PString &text)
PINDEX m_minCount
Definition: pxml.h:209
This is a dictionary collection class of PString objects, keyed by another string.
Definition: pstring.h:2784
This class describes a full description for a file on the particular platform.
Definition: filepath.h:65
bool SaveFile(const PFilePath &fn, Options options=NoOptions)
PQueue< PXML > messages
Definition: pxml.h:525
void SetFilePosition(unsigned col, unsigned line)
Definition: pxml.h:422
This class is a variation of a string that ignores case.
Definition: pstring.h:1708
__inline friend Options operator&(Options o1, Options o2)
Definition: pxml.h:82
PXMLElement * AddElement(const char *name)
PXMLObject(PXMLElement *par)
Definition: pxml.h:299
PBoolean IsNoIndentElement(const PString &elementName) const
unsigned lineNumber
Definition: pxml.h:438
void GetFilePosition(unsigned &col, unsigned &line) const
Definition: pxml.h:421
ignored
Definition: pxml.h:76
bool Validate(const ValidationInfo *validator)
bool GetURIForNamespace(const PCaselessString &prefix, PCaselessString &uri)
PXML(int options=NoOptions, const char *noIndentElements=NULL)
PCaselessString GetName() const
Definition: pxml.h:364
const char * m_attributeValues
Definition: pxml.h:204
PString GetEncoding() const
Definition: pxml.h:495
PXMLElement(PXMLElement *parent, const char *name=NULL)
ValidationInfo * m_subElement
Definition: pxml.h:205
StandAloneType m_standAlone
Definition: pxml.h:243
virtual void StartDocTypeDecl(const char *docTypeName, const char *sysid, const char *pubid, int hasInternalSubSet)
PTimeInterval autoLoadWaitTime
Definition: pxml.h:286
PMutex & GetMutex()
Definition: pxml.h:225
PXMLElement * GetElement(const PCaselessString &name, const PCaselessString &attr, const PString &attrval) const
PXMLElement * GetRootElement() const
Definition: pxml.h:159
bool StartAutoReloadURL(const PURL &url, const PTimeInterval &timeout, const PTimeInterval &refreshTime, Options options=NoOptions)
PXMLObject * GetSubObject(PINDEX idx=0) const
Definition: pxml.h:412
virtual void XmlDecl(const char *version, const char *encoding, int standAlone)
bool IsDirty() const
Definition: pxml.h:320
PINDEX GetSize() const
Definition: pxml.h:376
PXMLElement * GetXMLTree() const
bool HasSubObjects() const
Definition: pxml.h:406
bool Save(Options options=NoOptions)
A class representing a system timer.
Definition: timer.h:181
BOOL PBoolean
Definition: object.h:102
PXML_HTTP(int options=NoOptions, const char *noIndentElements=NULL)
PINDEX FindObject(const PXMLObject *ptr) const
const char * m_name
Definition: pxml.h:200
ignored
Definition: pxml.h:75
void GetErrorInfo(PString &errorString, unsigned &errorCol, unsigned &errorLine)
PXMLElement * SetRootElement(PXMLElement *p)
PString GetAttribute(const PCaselessString &key) const
virtual void StartNamespaceDeclHandler(const char *prefix, const char *uri)
bool GetDefaultNamespace(PCaselessString &str) const
static PString EscapeSpecialChars(const PString &string)
PString GetAutoReloadStatus()
Definition: pxml.h:273
PStringToString m_nameSpaces
Definition: pxml.h:195
This is a sorted list collection class of PString objects.
Definition: pstring.h:2296
PString version
Definition: pxml.h:242
PXMLSettings(Options options=NewLineAfterElement)
bool LoadFile(const PFilePath &fn)
StandAloneType m_standAlone
Definition: pxml.h:509
bool RemoveElement(PINDEX idx)
PString GetString() const
Definition: pxml.h:341
void ReadFrom(istream &strm)
Input the contents of the object from the stream.
Abstract class defining I/O channel semantics.
Definition: channel.h:107
virtual PBoolean IsNoIndentElement(const PString &) const
Definition: pxml.h:98
PXMLElement * GetElement(const PCaselessString &name, const PCaselessString &attr, const PString &attrval) const
unsigned GetMaxEntityLength() const
Definition: pxml.h:106
bool LoadAndValidate(const PString &body, const PXML::ValidationInfo *validator, PString &error, int options=NoOptions)
int GetOptions() const
Definition: pxml.h:96
PXMLObject * AddSubObject(PXMLObject *elem, bool dirty=true)
virtual PINDEX GetSize() const
Get the current size of the container.
int m_options
Definition: pxml.h:109
bool LoadURL(const PURL &url)
void RemoveNamespace(const PString &prefix)
void SetParent(PXMLElement *newParent)
Definition: pxml.h:307
static PString CreateEndTag(const PString &text)
bool HasAttribute(const PCaselessString §ion, const PString &key) const
void AddNamespace(const PString &prefix, const PString &uri)
PCaselessString GetPathName() const
Get the completely qualified name for the element inside the XML tree, for example "root:trunk:branch...
PString GetErrorString() const
Definition: pxml.h:218
static PString CreateStartTag(const PString &text)
PString autoLoadError
Definition: pxml.h:288
PXMLElement * GetParent() const
Definition: pxml.h:302
PMutex autoLoadMutex
Definition: pxml.h:287
The character string class.
Definition: pstring.h:108
PINDEX GetNumElements() const
virtual void AddCharacterData(const char *data, int len)
void SetName(const PString &v)
Definition: pxml.h:373
void * expat
Definition: pxml.h:503
PStringToString m_tempNamespaceList
Definition: pxml.h:510
PDECLARE_NOTIFIER(PTimer, PXML_HTTP, AutoReloadTimeout)
virtual void StartElement(const char *name, const char **attrs)
const void * m_placeHolder
Definition: pxml.h:203
void Construct(int options, const char *noIndentElements)
PString encoding
Definition: pxml.h:242
virtual void OnAutoLoad(PBoolean ok)
PString docType
Definition: pxml.h:251
This class defines a thread of execution in the system.
Definition: thread.h:66
bool IsLoaded() const
Definition: pxml.h:132
PXMLElement * rootElement
Definition: pxml.h:237
virtual void OnLoaded()
Definition: pxml.h:138
PXMLElement * SetXMLTree(PXMLElement *newRoot)
void AddData(const PString &data)
PXMLObjectArray GetSubObjects() const
Definition: pxml.h:409
bool HasAttribute(const PCaselessString &key) const
StandAloneType
Definition: pxml.h:84
bool Load(const PString &data)
PString version
Definition: pxml.h:508
virtual PBoolean IsElement() const =0
bool Parse(const char *data, int dataLen, bool final)
PFilePath loadFilename
Definition: pxml.h:241
bool dirty
Definition: pxml.h:436
PURL autoloadURL
Definition: pxml.h:285
PCaselessString m_defaultNamespace
Definition: pxml.h:440
PMutex rootMutex
Definition: pxml.h:238
bool ValidateElement(ValidationContext &context, PXMLElement *element, const ValidationInfo *elements)
PXMLData(PXMLElement *parent, const PString &data)
void Output(ostream &strm, const PXMLBase &xml, int indent) const
static PString CreateTag(const PString &text, const PString &data)
void SetMaxEntityLength(unsigned len)
Definition: pxml.h:105
bool rootOpen
Definition: pxml.h:505
virtual void EndElement(const char *name)
bool dirty
Definition: pxml.h:326
void ToConfig(PConfig &cfg) const
PStringToString attributes
Definition: pxml.h:434
PBoolean IsElement() const
Definition: pxml.h:337
#define PAssert(b, msg)
This macro is used to assert that a condition must be true.
Definition: object.h:192
PARRAY(PXMLObjectArray, PXMLObject)
virtual PObject * Clone() const
Create a copy of the class on the heap.
void SetDocType(const PString &v)
Definition: pxml.h:223
PString GetAttribute(const PCaselessString §ion, const PString &key) const
virtual void EndElement(const char *name)
void SetString(const PString &str, bool dirty=true)
PCaselessString name
Definition: pxml.h:433
virtual void EndDocTypeDecl()
PXMLElement * parent
Definition: pxml.h:325
XML fragment, not complete document.
Definition: pxml.h:78
virtual void EndNamespaceDeclHandler(const char *prefix)
StandAloneType GetStandAlone() const
Definition: pxml.h:497
virtual PXML * Read(PChannel *channel)
Options
Definition: pxml.h:71
PXMLData * lastElement
Definition: pxml.h:507
const char * m_namespace
Definition: pxml.h:206
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PStringStream m_errorString
Definition: pxml.h:245
bool GetNamespace(const PCaselessString &prefix, PCaselessString &str) const
PSortedStringList noIndentElements
Definition: pxml.h:249
This class describes a Universal Resource Locator.
Definition: url.h:54
void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
bool ValidateElements(ValidationContext &context, PXMLElement *baseElement, const ValidationInfo *elements)
PString m_defaultNameSpace
Definition: pxml.h:194
PXMLElement * rootElement
Definition: pxml.h:504
PStringToString m_nameSpaces
Definition: pxml.h:439
bool SaveFile(const PFilePath &fn)
PTimer autoLoadTimer
Definition: pxml.h:284
PString GetKeyAttribute(PINDEX idx) const
unsigned column
Definition: pxml.h:437
PBoolean IsElement() const
Definition: pxml.h:359
bool RemoveElement(PINDEX idx)
void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
unsigned m_errorColumn
Definition: pxml.h:247