Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

plist::ObjectBase Class Reference

#include <plistBase.h>

Inheritance diagram for plist::ObjectBase:

Inheritance graph
[legend]
List of all members.

Detailed Description

This base class provides the root functionality for all plist entities -- Dictionary and the various templated subclasses of PrimitiveBase.

The subclasses may throw std::bad_format if the document is poorly structured or bad values are found.

Definition at line 124 of file plistBase.h.

Public Member Functions

 ObjectBase ()
 constructor
virtual ~ObjectBase ()=0
 destructor
virtual std::string toString () const =0
 return current value as a string
virtual void loadXML (xmlNode *node)=0
 subclasses are expected to provide a working implementation
virtual void saveXML (xmlNode *node) const =0
 subclasses are expected to provide a working implementation
virtual ObjectBaseclone () const __attribute__((warn_unused_result))=0
 allows a copy to be made of an event, supporting polymorphism

Protected Member Functions

Inherited from XMLLoadSave
virtual void setParseTree (xmlDoc *doc) const
 assigns a parse tree which you have obtained from some other source
virtual xmlNodeFindRootXMLElement (xmlDoc *doc) const
 returns the root element of the xml document

Static Protected Member Functions

static bool matchTrue (const std::string &str)
 returns true if str is some form of affirmative (e.g. "true" or "yes")
static bool matchFalse (const std::string &str)
 returns true if str is some form of negative (e.g. "false" or "no")
libxml Forwards
Provides accessor functions to struct fields without having to include libxml.h everywhere

static bool xNodeHasName (xmlNode *node, const char *name)
 returns true if the name of node matches name
static const xmlCharxNodeGetName (xmlNode *node)
 returns name of node (not a libxml function)
static xmlNodexNodeGetChildren (xmlNode *node)
 returns children of node (not a libxml function)
static xmlNodexNodeGetLastChild (xmlNode *node)
 returns last child of node (not a libxml function)
static xmlNodexNodeGetNextNode (xmlNode *node)
 returns next node (sibling) after node (not a libxml function)
static xmlNodexNodeGetPrevNode (xmlNode *node)
 returns previous node (sibling) before node (not a libxml function)
static xmlNodexNodeGetParent (xmlNode *node)
 returns parent node of node (not a libxml function)
static xmlDocxNodeGetDoc (xmlNode *node)
 returns document node of node (not a libxml function)
static bool xNodeIsText (xmlNode *node)
 returns true if node is an XML_TEXT_NODE (not a libxml function)
static bool xNodeIsElement (xmlNode *node)
 returns true if node is an XML_ELEMENT_NODE (not a libxml function)
static bool xNodeIsComment (xmlNode *node)
 returns true if node is an XML_COMMENT_NODE (not a libxml function)

Friends

ObjectBaseloadXML (xmlNode *node)
 From the name of node, will instantiate a new ObjectBase subclass to load it.

Classes

struct  conversion_policy


Member Function Documentation

void plist::ObjectBase::setParseTree ( xmlDoc doc  )  const [protected, virtual]

assigns a parse tree which you have obtained from some other source

This doesn't update the contents of the subclass's values. The values in doc will be overwritten by those in the subclass on the next Save. If you wish to have the subclass's values updated from doc, call readParseTree() after calling this.

Reimplemented from XMLLoadSave.

Definition at line 16 of file plistBase.cc.


Friends And Related Function Documentation

ObjectBase* loadXML ( xmlNode node  )  [friend]

From the name of node, will instantiate a new ObjectBase subclass to load it.

The mapping from node names to actual instantiated types is:

If successful, returns a pointer to a newly allocated region, which the caller is responsible for freeing. If an error occurs, NULL is returned.

Implements XMLLoadSave.

Reimplemented in plist::Dictionary, plist::ArrayBase, plist::Primitive< char >, plist::Primitive< unsigned char >, plist::Primitive< std::string >, plist::NamedEnumeration< T >, plist::NamedEnumeration< J_DCT_METHOD >, plist::NamedEnumeration< Config::transports >, plist::NamedEnumeration< gain_levels >, plist::NamedEnumeration< volume_levels >, plist::NamedEnumeration< encoding_t >, plist::NamedEnumeration< compression_t >, plist::NamedEnumeration< white_balance_levels >, plist::NamedEnumeration< consoleMode_t >, and plist::NamedEnumeration< shutter_speeds >.

Definition at line 7 of file plist.cc.

Referenced by plist::loadXML().


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

Tekkotsu v3.0
Generated Fri May 11 20:09:07 2007 by Doxygen 1.4.7