PTLib  Version 2.10.11
PXMLElement Class Reference

#include <pxml.h>

Inheritance diagram for PXMLElement:
PXMLObject PObject

Public Member Functions

 PXMLElement (PXMLElement *parent, const char *name=NULL)
 
 PXMLElement (PXMLElement *parent, const PString &name, const PString &data)
 
PBoolean IsElement () const
 
void PrintOn (ostream &strm) const
 Output the contents of the object to the stream. More...
 
void Output (ostream &strm, const PXMLBase &xml, int indent) const
 
PCaselessString GetName () const
 
PCaselessString GetPathName () const
 Get the completely qualified name for the element inside the XML tree, for example "root:trunk:branch:subbranch:leaf". More...
 
void SetName (const PString &v)
 
PINDEX GetSize () const
 
PXMLObjectAddSubObject (PXMLObject *elem, bool dirty=true)
 
PXMLElementAddChild (PXMLElement *elem, bool dirty=true)
 
PXMLDataAddChild (PXMLData *elem, bool dirty=true)
 
PXMLElementAddElement (const char *name)
 
PXMLElementAddElement (const PString &name, const PString &data)
 
PXMLElementAddElement (const PString &name, const PString &attrName, const PString &attrVal)
 
void SetAttribute (const PCaselessString &key, const PString &value, bool setDirty=true)
 
PString GetAttribute (const PCaselessString &key) const
 
PString GetKeyAttribute (PINDEX idx) const
 
PString GetDataAttribute (PINDEX idx) const
 
bool HasAttribute (const PCaselessString &key) const
 
bool HasAttributes () const
 
PINDEX GetNumAttributes () const
 
PXMLElementGetElement (const PCaselessString &name, const PCaselessString &attr, const PString &attrval) const
 
PXMLElementGetElement (const PCaselessString &name, PINDEX idx=0) const
 
PXMLObjectGetElement (PINDEX idx=0) const
 
bool RemoveElement (PINDEX idx)
 
PINDEX FindObject (const PXMLObject *ptr) const
 
bool HasSubObjects () const
 
PXMLObjectArray GetSubObjects () const
 
PXMLObjectGetSubObject (PINDEX idx=0) const
 
PString GetData () const
 
void SetData (const PString &data)
 
void AddData (const PString &data)
 
PXMLObjectClone (PXMLElement *parent) const
 
void GetFilePosition (unsigned &col, unsigned &line) const
 
void SetFilePosition (unsigned col, unsigned line)
 
void AddNamespace (const PString &prefix, const PString &uri)
 
void RemoveNamespace (const PString &prefix)
 
bool GetDefaultNamespace (PCaselessString &str) const
 
bool GetNamespace (const PCaselessString &prefix, PCaselessString &str) const
 
PCaselessString PrependNamespace (const PCaselessString &name) const
 
bool GetURIForNamespace (const PCaselessString &prefix, PCaselessString &uri)
 
- Public Member Functions inherited from PXMLObject
 PXMLObject (PXMLElement *par)
 
PXMLElementGetParent () const
 
PXMLObjectGetNextObject () const
 
void SetParent (PXMLElement *newParent)
 
PString AsString () const
 
void SetDirty ()
 
bool IsDirty () const
 
- Public Member Functions inherited from PObject
virtual ~PObject ()
 
virtual PObjectClone () const
 Create a copy of the class on the heap. More...
 
virtual PINDEX HashFunction () const
 This function yields a hash value required by the PDictionary class. More...
 
virtual const char * GetClass (unsigned ancestor=0) const
 Get the current dynamic type of the object instance. More...
 
PBoolean IsClass (const char *cls) const
 
virtual PBoolean InternalIsDescendant (const char *clsName) const
 Determine if the dynamic type of the current instance is a descendent of the specified class. More...
 
virtual Comparison Compare (const PObject &obj) const
 Compare the two objects and return their relative rank. More...
 
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
 Determine the byte wise comparison of two objects. More...
 
bool operator== (const PObject &obj) const
 Compare the two objects. More...
 
bool operator!= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator< (const PObject &obj) const
 Compare the two objects. More...
 
bool operator> (const PObject &obj) const
 Compare the two objects. More...
 
bool operator<= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator>= (const PObject &obj) const
 Compare the two objects. More...
 
virtual void ReadFrom (istream &strm)
 Input the contents of the object from the stream. More...
 

Protected Attributes

PCaselessString name
 
PStringToString attributes
 
PXMLObjectArray subObjects
 
bool dirty
 
unsigned column
 
unsigned lineNumber
 
PStringToString m_nameSpaces
 
PCaselessString m_defaultNamespace
 
- Protected Attributes inherited from PXMLObject
PXMLElementparent
 
bool dirty
 

Additional Inherited Members

- Public Types inherited from PObject
enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
 Result of the comparison operation performed by the Compare() function. More...
 
- Static Public Member Functions inherited from PObject
static const char * Class ()
 Get the name of the class as a C string. More...
 
static Comparison InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
 Internal function caled from CompareObjectMemoryDirect() More...
 
- Protected Member Functions inherited from PObject
 PObject ()
 Constructor for PObject, made protected so cannot ever create one on its own. More...
 

Constructor & Destructor Documentation

§ PXMLElement() [1/2]

PXMLElement::PXMLElement ( PXMLElement parent,
const char *  name = NULL 
)

§ PXMLElement() [2/2]

PXMLElement::PXMLElement ( PXMLElement parent,
const PString name,
const PString data 
)

Member Function Documentation

§ AddChild() [1/2]

PXMLElement* PXMLElement::AddChild ( PXMLElement elem,
bool  dirty = true 
)

§ AddChild() [2/2]

PXMLData* PXMLElement::AddChild ( PXMLData elem,
bool  dirty = true 
)

§ AddData()

void PXMLElement::AddData ( const PString data)

§ AddElement() [1/3]

PXMLElement* PXMLElement::AddElement ( const char *  name)

§ AddElement() [2/3]

PXMLElement* PXMLElement::AddElement ( const PString name,
const PString data 
)

§ AddElement() [3/3]

PXMLElement* PXMLElement::AddElement ( const PString name,
const PString attrName,
const PString attrVal 
)

§ AddNamespace()

void PXMLElement::AddNamespace ( const PString prefix,
const PString uri 
)

§ AddSubObject()

PXMLObject* PXMLElement::AddSubObject ( PXMLObject elem,
bool  dirty = true 
)

§ Clone()

PXMLObject* PXMLElement::Clone ( PXMLElement parent) const
virtual

Implements PXMLObject.

§ FindObject()

PINDEX PXMLElement::FindObject ( const PXMLObject ptr) const

§ GetAttribute()

PString PXMLElement::GetAttribute ( const PCaselessString key) const

§ GetData()

PString PXMLElement::GetData ( ) const

§ GetDataAttribute()

PString PXMLElement::GetDataAttribute ( PINDEX  idx) const

§ GetDefaultNamespace()

bool PXMLElement::GetDefaultNamespace ( PCaselessString str) const

§ GetElement() [1/3]

PXMLElement* PXMLElement::GetElement ( const PCaselessString name,
const PCaselessString attr,
const PString attrval 
) const

§ GetElement() [2/3]

PXMLElement* PXMLElement::GetElement ( const PCaselessString name,
PINDEX  idx = 0 
) const

§ GetElement() [3/3]

PXMLObject* PXMLElement::GetElement ( PINDEX  idx = 0) const

§ GetFilePosition()

void PXMLElement::GetFilePosition ( unsigned &  col,
unsigned &  line 
) const
inline

§ GetKeyAttribute()

PString PXMLElement::GetKeyAttribute ( PINDEX  idx) const

§ GetName()

PCaselessString PXMLElement::GetName ( ) const
inline

§ GetNamespace()

bool PXMLElement::GetNamespace ( const PCaselessString prefix,
PCaselessString str 
) const

§ GetNumAttributes()

PINDEX PXMLElement::GetNumAttributes ( ) const
inline

§ GetPathName()

PCaselessString PXMLElement::GetPathName ( ) const

Get the completely qualified name for the element inside the XML tree, for example "root:trunk:branch:subbranch:leaf".

§ GetSize()

PINDEX PXMLElement::GetSize ( ) const
inline

§ GetSubObject()

PXMLObject* PXMLElement::GetSubObject ( PINDEX  idx = 0) const
inline

§ GetSubObjects()

PXMLObjectArray PXMLElement::GetSubObjects ( ) const
inline

§ GetURIForNamespace()

bool PXMLElement::GetURIForNamespace ( const PCaselessString prefix,
PCaselessString uri 
)

§ HasAttribute()

bool PXMLElement::HasAttribute ( const PCaselessString key) const

§ HasAttributes()

bool PXMLElement::HasAttributes ( ) const
inline

§ HasSubObjects()

bool PXMLElement::HasSubObjects ( ) const
inline

§ IsElement()

PBoolean PXMLElement::IsElement ( ) const
inlinevirtual

Implements PXMLObject.

References PXML::PrintOn().

§ Output()

void PXMLElement::Output ( ostream &  strm,
const PXMLBase xml,
int  indent 
) const
virtual

Implements PXMLObject.

§ PrependNamespace()

PCaselessString PXMLElement::PrependNamespace ( const PCaselessString name) const

§ PrintOn()

void PXMLElement::PrintOn ( ostream &  strm) const
virtual

Output the contents of the object to the stream.

The exact output is dependent on the exact semantics of the descendent class. This is primarily used by the standard operator<< function.

The default behaviour is to print the class name.

Reimplemented from PObject.

§ RemoveElement()

bool PXMLElement::RemoveElement ( PINDEX  idx)

§ RemoveNamespace()

void PXMLElement::RemoveNamespace ( const PString prefix)

§ SetAttribute()

void PXMLElement::SetAttribute ( const PCaselessString key,
const PString value,
bool  setDirty = true 
)

§ SetData()

void PXMLElement::SetData ( const PString data)

§ SetFilePosition()

void PXMLElement::SetFilePosition ( unsigned  col,
unsigned  line 
)
inline

§ SetName()

void PXMLElement::SetName ( const PString v)
inline

Member Data Documentation

§ attributes

PStringToString PXMLElement::attributes
protected

§ column

unsigned PXMLElement::column
protected

§ dirty

bool PXMLElement::dirty
protected

§ lineNumber

unsigned PXMLElement::lineNumber
protected

§ m_defaultNamespace

PCaselessString PXMLElement::m_defaultNamespace
protected

§ m_nameSpaces

PStringToString PXMLElement::m_nameSpaces
protected

§ name

PCaselessString PXMLElement::name
protected

§ subObjects

PXMLObjectArray PXMLElement::subObjects
protected

The documentation for this class was generated from the following file: