wxXml2
Public Member Functions | Protected Member Functions | List of all members
wxXml2Property Class Reference

Represents a node property. More...

#include <xml2.h>

Inheritance diagram for wxXml2Property:
Inheritance graph
[legend]
Collaboration diagram for wxXml2Property:
Collaboration graph
[legend]

Public Member Functions

 wxXml2Property ()
 Constructs an empty property; it cannot be used until you Create() it.
 
 wxXml2Property (const wxString &name, const wxString &value, wxXml2Node &owner=wxXml2EmptyNode)
 Constructs a property associated with the given node.
 
 wxXml2Property (xmlAttr *pattr)
 Wraps the given XML structure.
 
 wxXml2Property (const wxXml2Property &prop)
 Copies the given wrapper (does not imply the XML structure copy).
 
virtual ~wxXml2Property ()
 Destructor.
 
bool operator== (const wxXml2Property &p) const
 Returns TRUE if the two wxXml2Properties have the same name (case insensitive comparison is performed) and same values (case sensitive comparison).
 
bool operator!= (const wxXml2Property &p) const
 Returns NOT operator==.
 
wxXml2Propertyoperator= (const wxXml2Property &p)
 Assignment operator.
 
void Create (const wxString &name, const wxString &value, wxXml2Node &owner=wxXml2EmptyNode)
 Builds this XML property.
 
bool IsUnlinked () const
 Returns TRUE if this property is not linked to any wider XML tree.
 
bool IsNonEmpty () const
 Returns TRUE if this object is wrapping a non-NULL object.
 
wxString GetName () const
 
wxString GetValue () const
 
wxXml2Property GetNext () const
 
wxXml2Property GetPrevious () const
 
wxXml2Node GetOwner () const
 
xmlAttr * GetObj () const
 Returns the XML structure wrapped by this class.
 
void SetValue (const wxString &value)
 
void SetName (const wxString &name)
 
void SetNext (wxXml2Property &next)
 
void SetPrevious (wxXml2Property &prev)
 
void SetOwner (wxXml2Node &owner)
 Links this class with a wxXml2Node: it will have the duty of destroy this object.
 
- Public Member Functions inherited from wxXml2Wrapper
 wxXml2Wrapper ()
 Constructs this wrapper but not its wrapped data.
 
virtual ~wxXml2Wrapper ()
 The wxXml2Wrapper destructor will free the memory of the underlying libxml2 structure only if it is not linked to any XML tree.
 
virtual void DestroyIfUnlinked ()
 Destroys the wrapped data if it is unlinked.
 

Protected Member Functions

void Destroy ()
 Destroys the data wrapped by this class freeing its memory.
 
void SetAsEmpty ()
 Sets this element as empty: that is wrapping a NULL pointer.
 
void Copy (const wxXml2Property &prop)
 
int & GetPrivate () const
 Copies the given object.
 
- Protected Member Functions inherited from wxXml2Wrapper
void ResetRefCount ()
 
void IncRefCount ()
 
void DecRefCount ()
 
int GetRefCount () const
 
void UnwrappingOld ()
 This function should be called each time the internal pointer of the class is going to be replaced by another one.
 
void JustWrappedNew ()
 This function should be called each time the internal pointer of the class has been replaced by another one.
 

Detailed Description

Represents a node property.

Example: in

"src" is property with value "hello.gif" and "id" is a property with value "3".

Constructor & Destructor Documentation

wxXml2Property::wxXml2Property ( )
inline

Constructs an empty property; it cannot be used until you Create() it.

wxXml2Property::wxXml2Property ( const wxString &  name,
const wxString &  value,
wxXml2Node owner = wxXml2EmptyNode 
)
inline

Constructs a property associated with the given node.

wxXml2Property::wxXml2Property ( xmlAttr *  pattr)
inline

Wraps the given XML structure.

References wxXml2Wrapper::JustWrappedNew().

wxXml2Property::wxXml2Property ( const wxXml2Property prop)
inline

Copies the given wrapper (does not imply the XML structure copy).

virtual wxXml2Property::~wxXml2Property ( )
inlinevirtual

Destructor.

References wxXml2Wrapper::DestroyIfUnlinked().

Member Function Documentation

void wxXml2Property::Copy ( const wxXml2Property prop)
inlineprotected
void wxXml2Property::Create ( const wxString &  name,
const wxString &  value,
wxXml2Node owner = wxXml2EmptyNode 
)
void wxXml2Property::Destroy ( )
inlineprotectedvirtual

Destroys the data wrapped by this class freeing its memory.

This function should not try to update the reference count since it should have been already updated by the caller.

Implements wxXml2Wrapper.

References wxXml2Wrapper::SetAsEmpty().

wxString wxXml2Property::GetName ( ) const
inline
wxXml2Property wxXml2Property::GetNext ( ) const
inline
xmlAttr* wxXml2Property::GetObj ( ) const
inline

Returns the XML structure wrapped by this class.

Referenced by operator==(), SetNext(), SetPrevious(), and wxXml2Node::SetProperties().

wxXml2Node wxXml2Property::GetOwner ( ) const

References wxXml2Node.

wxXml2Property wxXml2Property::GetPrevious ( ) const
inline

References wxXml2EmptyProperty, and wxXml2Property.

Referenced by SetPrevious().

int& wxXml2Property::GetPrivate ( ) const
inlineprotectedvirtual

Copies the given object.

This function should be used to implement copy constructor and assignment operators. Returns the private member of the wrapped structure.

Implements wxXml2Wrapper.

wxString wxXml2Property::GetValue ( ) const
inline
bool wxXml2Property::IsNonEmpty ( ) const
inlinevirtual

Returns TRUE if this object is wrapping a non-NULL object.

Implements wxXml2Wrapper.

bool wxXml2Property::IsUnlinked ( ) const
virtual

Returns TRUE if this property is not linked to any wider XML tree.

Implements wxXml2Wrapper.

bool wxXml2Property::operator!= ( const wxXml2Property p) const
inline

Returns NOT operator==.

wxXml2Property& wxXml2Property::operator= ( const wxXml2Property p)
inline

Assignment operator.

bool wxXml2Property::operator== ( const wxXml2Property p) const

Returns TRUE if the two wxXml2Properties have the same name (case insensitive comparison is performed) and same values (case sensitive comparison).

References GetName(), GetObj(), GetValue(), and wxCHECK_NULL_POINTERS.

void wxXml2Property::SetAsEmpty ( )
inlineprotectedvirtual

Sets this element as empty: that is wrapping a NULL pointer.

This function must not free the memory of the currently wrapped pointer: it must just reset that pointer to NULL. This function is used by DestroyIfUnlinked().

Implements wxXml2Wrapper.

void wxXml2Property::SetName ( const wxString &  name)

References WX2XML.

void wxXml2Property::SetNext ( wxXml2Property next)
void wxXml2Property::SetOwner ( wxXml2Node owner)

Links this class with a wxXml2Node: it will have the duty of destroy this object.

References Create(), GetName(), and GetValue().

void wxXml2Property::SetPrevious ( wxXml2Property prev)

References GetObj(), GetPrevious(), SetNext(), and wxXml2EmptyProperty.

Referenced by SetNext().

void wxXml2Property::SetValue ( const wxString &  value)

References WX2XML.


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