Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

plist::Array Class Reference

#include <plistCollections.h>

Inheritance diagram for plist::Array:

Inheritance graph
[legend]
List of all members.

Detailed Description

A collection of plist objects, similar to a Dictionary, but no keys -- order matters!

There's two versions of the plist array -- one is this Array class, the other is the Vector. This class is designed to be a fixed size -- you should add the entries which you expect to find in the array, and extra entries will be ignored when loading (with an optional warning). You can mix different primitive types in any order you choose.

The other class, Vector, takes the opposite tack -- it handles loading a variable number of entries, but handles the allocation of those objects internally.

Definition at line 237 of file plistCollections.h.

Public Types

typedef std::vector< ObjectBase * > storage_t
 shorthand for the type of the storage
typedef storage_t::iterator iterator
 shorthand for iterators to be returned
typedef storage_t::const_iterator const_iterator
 shorthand for iterators to be returned

Public Member Functions

 Array ()
 constructor
 Array (bool growable)
 constructor
 Array (const Array &d)
 copy constructor (don't assign listeners)
Arrayoperator= (const Array &d)
 assignment (don't assign listeners); subclass should call fireEntriesChanged after calling this (and updating it storage)
 ~Array ()
 destructor
template<typename T>
void addValue (const T &val, const std::string &comment="")
 insert a new entry to the end of the vector, and corresponding comment; expects val to be either a primitive type, like int, float, etc., or one of the variable-sized Collection's, like Vector, control of (de)allocation will be assumed by the Vector
virtual void addValue (const char val[], const std::string &comment="")
 "specialization" (actually just another override) for handling character arrays as strings
virtual void addEntry (ObjectBase &val, const std::string &comment="")
 replaces previous entry at the specified index, which must represent an integer value less than or equal to the current array size; clone of val will be added
virtual void addEntry (ObjectBase *val, const std::string &comment="")
 replaces previous entry at the specified index, which must represent an integer value less than or equal to the current array size; clone of val will be added
template<typename T>
void setValue (size_t index, const T &val, bool warnExists=false)
 replaces previous entry at the specified index, which must be less than or equal to the current array size, control of (de)allocation will be assumed by the Vector
template<typename T>
void addValue (size_t index, const T &val, const std::string &comment="")
 replaces previous entry at the specified index, which must be less than or equal to the current array size, control of (de)allocation will be assumed by the Vector
virtual void setValue (size_t index, const char val[], bool warnExists=false)
 "specialization" (actually just another override) for handling character arrays as strings
virtual void addValue (size_t index, const char val[], const std::string &comment="")
 "specialization" (actually just another override) for handling character arrays as strings
virtual void setEntry (size_t index, ObjectBase &val, bool warnExists=false)
 replaces previous entry at the specified index, which must be less than or equal to the current array size; clone will be added
virtual void addEntry (size_t index, ObjectBase &val, const std::string &comment="")
 replaces previous entry at the specified index, which must be less than or equal to the current array size; clone will be added
virtual void setEntry (size_t index, ObjectBase *val, bool warnExists=false)
 replaces previous entry at the specified index, which must be less than or equal to the current array size; clone will be added
virtual void addEntry (size_t index, ObjectBase *val, const std::string &comment="")
 replaces previous entry at the specified index, which must be less than or equal to the current array size; clone will be added
template<typename T>
void setValue (const std::string &name, const T &val, bool warnExists=false)
 replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size, control of (de)allocation will be assumed by the Vector
template<typename T>
void addValue (const std::string &name, const T &val, const std::string &comment="")
 replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size, control of (de)allocation will be assumed by the Vector
virtual void setValue (const std::string &name, const char val[], bool warnExists=false)
 "specialization" (actually just another override) for handling character arrays as strings
virtual void addValue (const std::string &name, const char val[], const std::string &comment="")
 "specialization" (actually just another override) for handling character arrays as strings
virtual void setEntry (const std::string &name, ObjectBase &val, bool warnExists=false)
 replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size; clone will be added
virtual void addEntry (const std::string &name, ObjectBase &val, const std::string &comment="")
 replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size; clone will be added
virtual void setEntry (const std::string &name, ObjectBase *val, bool warnExists=false)
 replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size; clone will be added
virtual void addEntry (const std::string &name, ObjectBase *val, const std::string &comment="")
 replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size; clone will be added
virtual void removeEntry (size_t index)
 remove the entry at position index
ObjectBasegetEntry (size_t index) const
 return the value at position index
ObjectBaseoperator[] (size_t index) const
 return the value of the key name, or NULL if it doesn't exist (equivalent to getEntry(index))
virtual void removeEntry (const std::string &name)
 remove the entry with key name
virtual ObjectBasegetEntry (const std::string &name) const
 return the value of the key name, or NULL if it doesn't exist
virtual ObjectBaseoperator[] (const std::string &name) const
 return the value of the key name, or NULL if it doesn't exist (equivalent to getEntry(name))
virtual void clear ()
 remove all entries in one fell swoop
const_iterator begin () const
 return an STL const_iterator to the first entry
const_iterator end () const
 return the one-past-end const_iterator
size_t size () const
 return the size of the dictionary
virtual void setComment (size_t index, const std::string &comment)
 replaces previous comment for name, or adds it if it doesn't already exist (can preceed actual entry!)
virtual const std::string & getComment (size_t index) const
 returns comment retrieved from loaded file, or any subsequent call to setComment
virtual void setComment (const std::string &name, const std::string &comment)
 replaces previous comment for name, or adds it if it doesn't already exist (can preceed actual entry!)
virtual const std::string & getComment (const std::string &name) const
 returns comment retrieved from loaded file, or any subsequent call to setComment
virtual void loadXML (xmlNode *node)
 From the name of node, will instantiate a new ObjectBase subclass to load it.
virtual void saveXML (xmlNode *node) const
 subclasses are expected to provide a working implementation
size_t getIndex (const std::string &name) const
 returns index corresponding to name, which should encode an integer value less than or equal to the current size
virtual std::string toString () const
 return current value as a string
virtual Arrayclone () const __attribute__((warn_unused_result))
 implements the clone function for Array
template<>
void addValue (const ObjectBase &val, const std::string &comment)
 specialization of Array::addValue() for ObjectBase subclasses
template<>
void addValue (const char *const &val, const std::string &comment)
 specialization of Array::addValue() for char* strings
template<>
void addValue (char *const &val, const std::string &comment)
 specialization of Array::addValue() for char* strings
template<>
void setValue (size_t index, const ObjectBase &val, bool warnExists)
 specialization of Array::setValue() for ObjectBase subclasses
template<>
void setValue (size_t index, const char *const &val, bool warnExists)
 specialization of Array::setValue() for char* strings
template<>
void setValue (size_t index, char *const &val, bool warnExists)
 specialization of Array::setValue() for char* strings
template<>
void addValue (size_t index, const ObjectBase &val, const std::string &comment)
 specialization of Array::addValue() for ObjectBase subclasses
template<>
void addValue (size_t index, const char *const &val, const std::string &comment)
 specialization of Array::addValue() for char* strings
template<>
void addValue (size_t index, char *const &val, const std::string &comment)
 specialization of Array::addValue() for char* strings
template<>
void setValue (const std::string &name, const ObjectBase &val, bool warnExists)
 specialization of Array::setValue() for ObjectBase subclasses
template<>
void setValue (const std::string &name, const char *const &val, bool warnExists)
 specialization of Array::setValue() for char* strings
template<>
void setValue (const std::string &name, char *const &val, bool warnExists)
 specialization of Array::setValue() for char* strings
template<>
void addValue (const std::string &name, const ObjectBase &val, const std::string &comment)
 specialization of Array::addValue() for ObjectBase subclasses
template<>
void addValue (const std::string &name, const char *const &val, const std::string &comment)
 specialization of Array::addValue() for char* strings
template<>
void addValue (const std::string &name, char *const &val, const std::string &comment)
 specialization of Array::addValue() for char* strings

Protected Types

typedef std::map< size_t,
std::string > 
comments_t
 shorthand for the type of comments

Protected Member Functions

virtual void fireEntryRemoved (ObjectBase &val)
 run through collectionListeners, calling CollectionListener::plistCollectionEntryRemoved(*this,val)
virtual void takeObject (size_t index, ObjectBase *obj)
 indicates that the storage implementation should mark this as an externally supplied heap reference, which needs to be deleted on removal/destruction
virtual bool loadXMLNode (size_t index, xmlNode *val, const std::string &comment)
 called with each node being loaded so subclass can handle appropriately
virtual unsigned int getLongestKeyLen () const
 return the length of the longest key for formatting purposes
iterator getSubEntry (const std::string &name, std::string::size_type &seppos)
 returns an entry matching just the prefix
const_iterator getSubEntry (const std::string &name, std::string::size_type &seppos) const
 returns an entry matching just the prefix
virtual void cloneMyRef ()
 called after an assignment or copy to clone the objects in myRef to perform a deep copy

Protected Attributes

storage_t arr
 storage of entries -- mapping from keys to value pointers
std::set< ObjectBase * > myRef
 objects which have been handed over to the collection for eventual de-allocation
comments_t comments
 storage of entry comments -- mapping from keys to help text comments for manual editing or user feedback

Friends

std::ostream & operator<< (std::ostream &os, const Array &d)
 provides textual output


Member Typedef Documentation

typedef std::map<size_t,std::string> plist::Array::comments_t [protected]

shorthand for the type of comments

Definition at line 382 of file plistCollections.h.

typedef storage_t::const_iterator plist::Array::const_iterator

shorthand for iterators to be returned

Definition at line 245 of file plistCollections.h.

typedef storage_t::iterator plist::Array::iterator

shorthand for iterators to be returned

Definition at line 243 of file plistCollections.h.

typedef std::vector<ObjectBase*> plist::Array::storage_t

shorthand for the type of the storage

Definition at line 241 of file plistCollections.h.


Constructor & Destructor Documentation

plist::Array::Array (  )  [inline]

constructor

Definition at line 248 of file plistCollections.h.

plist::Array::Array ( bool  growable  )  [inline, explicit]

constructor

Definition at line 250 of file plistCollections.h.

plist::Array::Array ( const Array d  )  [inline]

copy constructor (don't assign listeners)

Definition at line 252 of file plistCollections.h.

plist::Array::~Array (  )  [inline]

destructor

Definition at line 256 of file plistCollections.h.


Member Function Documentation

void plist::Array::addEntry ( const std::string &  name,
ObjectBase val,
const std::string &  comment = "" 
) [virtual]

replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size; clone will be added

Implements plist::Collection.

Definition at line 626 of file plistCollections.cc.

void plist::Array::addEntry ( const std::string &  name,
ObjectBase val,
const std::string &  comment = "" 
) [virtual]

replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size; clone will be added

Implements plist::Collection.

Definition at line 598 of file plistCollections.cc.

void plist::Array::addEntry ( size_t  index,
ObjectBase val,
const std::string &  comment = "" 
) [virtual]

replaces previous entry at the specified index, which must be less than or equal to the current array size; clone will be added

Definition at line 559 of file plistCollections.cc.

void plist::Array::addEntry ( size_t  index,
ObjectBase val,
const std::string &  comment = "" 
) [virtual]

replaces previous entry at the specified index, which must be less than or equal to the current array size; clone will be added

Definition at line 524 of file plistCollections.cc.

virtual void plist::Array::addEntry ( ObjectBase val,
const std::string &  comment = "" 
) [inline, virtual]

replaces previous entry at the specified index, which must represent an integer value less than or equal to the current array size; clone of val will be added

Definition at line 267 of file plistCollections.h.

virtual void plist::Array::addEntry ( ObjectBase val,
const std::string &  comment = "" 
) [inline, virtual]

replaces previous entry at the specified index, which must represent an integer value less than or equal to the current array size; clone of val will be added

Definition at line 265 of file plistCollections.h.

Referenced by addEntry(), addValue(), and loadXMLNode().

template<>
void plist::Array::addValue ( const std::string &  name,
char *const &  val,
const std::string &  comment 
) [inline]

specialization of Array::addValue() for char* strings

Definition at line 455 of file plistCollections.h.

template<>
void plist::Array::addValue ( const std::string &  name,
const char *const &  val,
const std::string &  comment 
) [inline]

specialization of Array::addValue() for char* strings

Definition at line 452 of file plistCollections.h.

template<>
void plist::Array::addValue ( const std::string &  name,
const ObjectBase val,
const std::string &  comment 
) [inline]

specialization of Array::addValue() for ObjectBase subclasses

Definition at line 449 of file plistCollections.h.

template<>
void plist::Array::addValue ( size_t  index,
char *const &  val,
const std::string &  comment 
) [inline]

specialization of Array::addValue() for char* strings

Definition at line 436 of file plistCollections.h.

template<>
void plist::Array::addValue ( size_t  index,
const char *const &  val,
const std::string &  comment 
) [inline]

specialization of Array::addValue() for char* strings

Definition at line 433 of file plistCollections.h.

template<>
void plist::Array::addValue ( size_t  index,
const ObjectBase val,
const std::string &  comment 
) [inline]

specialization of Array::addValue() for ObjectBase subclasses

Definition at line 430 of file plistCollections.h.

template<>
void plist::Array::addValue ( char *const &  val,
const std::string &  comment 
) [inline]

specialization of Array::addValue() for char* strings

Definition at line 417 of file plistCollections.h.

template<>
void plist::Array::addValue ( const char *const &  val,
const std::string &  comment 
) [inline]

specialization of Array::addValue() for char* strings

Definition at line 414 of file plistCollections.h.

template<>
void plist::Array::addValue ( const ObjectBase val,
const std::string &  comment 
) [inline]

specialization of Array::addValue() for ObjectBase subclasses

Definition at line 411 of file plistCollections.h.

virtual void plist::Array::addValue ( const std::string &  name,
const char  val[],
const std::string &  comment = "" 
) [inline, virtual]

"specialization" (actually just another override) for handling character arrays as strings

Definition at line 298 of file plistCollections.h.

template<typename T>
void plist::Array::addValue ( const std::string &  name,
const T &  val,
const std::string &  comment = "" 
) [inline]

replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size, control of (de)allocation will be assumed by the Vector

Definition at line 294 of file plistCollections.h.

virtual void plist::Array::addValue ( size_t  index,
const char  val[],
const std::string &  comment = "" 
) [inline, virtual]

"specialization" (actually just another override) for handling character arrays as strings

Definition at line 278 of file plistCollections.h.

template<typename T>
void plist::Array::addValue ( size_t  index,
const T &  val,
const std::string &  comment = "" 
) [inline]

replaces previous entry at the specified index, which must be less than or equal to the current array size, control of (de)allocation will be assumed by the Vector

Definition at line 274 of file plistCollections.h.

virtual void plist::Array::addValue ( const char  val[],
const std::string &  comment = "" 
) [inline, virtual]

"specialization" (actually just another override) for handling character arrays as strings

Definition at line 262 of file plistCollections.h.

template<typename T>
void plist::Array::addValue ( const T &  val,
const std::string &  comment = "" 
) [inline]

insert a new entry to the end of the vector, and corresponding comment; expects val to be either a primitive type, like int, float, etc., or one of the variable-sized Collection's, like Vector, control of (de)allocation will be assumed by the Vector

Definition at line 260 of file plistCollections.h.

const_iterator plist::Array::begin (  )  const [inline]

return an STL const_iterator to the first entry

Definition at line 323 of file plistCollections.h.

void plist::Array::clear (  )  [virtual]

remove all entries in one fell swoop

Implements plist::Collection.

Definition at line 965 of file plistCollections.cc.

Array * plist::Array::clone (  )  const [virtual]

implements the clone function for Array

Implements plist::ObjectBase.

Definition at line 833 of file plistCollections.cc.

void plist::Array::cloneMyRef (  )  [protected, virtual]

called after an assignment or copy to clone the objects in myRef to perform a deep copy

Definition at line 986 of file plistCollections.cc.

const_iterator plist::Array::end (  )  const [inline]

return the one-past-end const_iterator

Definition at line 325 of file plistCollections.h.

void plist::Array::fireEntryRemoved ( ObjectBase val  )  [protected, virtual]

run through collectionListeners, calling CollectionListener::plistCollectionEntryRemoved(*this,val)

Reimplemented from plist::Collection.

Definition at line 977 of file plistCollections.cc.

Referenced by removeEntry().

const std::string & plist::Array::getComment ( const std::string &  name  )  const [virtual]

returns comment retrieved from loaded file, or any subsequent call to setComment

Implements plist::Collection.

Definition at line 700 of file plistCollections.cc.

const std::string & plist::Array::getComment ( size_t  index  )  const [virtual]

returns comment retrieved from loaded file, or any subsequent call to setComment

Definition at line 677 of file plistCollections.cc.

Referenced by getComment().

ObjectBase * plist::Array::getEntry ( const std::string &  name  )  const [virtual]

return the value of the key name, or NULL if it doesn't exist

Implements plist::Collection.

Definition at line 655 of file plistCollections.cc.

ObjectBase& plist::Array::getEntry ( size_t  index  )  const [inline]

return the value at position index

Definition at line 312 of file plistCollections.h.

Referenced by getEntry().

size_t plist::Array::getIndex ( const std::string &  name  )  const

returns index corresponding to name, which should encode an integer value less than or equal to the current size

Definition at line 835 of file plistCollections.cc.

Referenced by addEntry(), getComment(), getEntry(), getSubEntry(), removeEntry(), setComment(), and setEntry().

unsigned int plist::Array::getLongestKeyLen (  )  const [protected, virtual]

return the length of the longest key for formatting purposes

Implements plist::Collection.

Definition at line 856 of file plistCollections.cc.

Array::const_iterator plist::Array::getSubEntry ( const std::string &  name,
std::string::size_type &  seppos 
) const [protected]

returns an entry matching just the prefix

Parameters:
[in] name the name being looked up
[out] seppos the position of the separator (sub-collections are separated by '.')
Returns:
iterator of the sub entry

Definition at line 882 of file plistCollections.cc.

Array::iterator plist::Array::getSubEntry ( const std::string &  name,
std::string::size_type &  seppos 
) [protected]

returns an entry matching just the prefix

Parameters:
[in] name the name being looked up
[out] seppos the position of the separator (sub-collections are separated by '.')
Returns:
iterator of the sub entry

Definition at line 868 of file plistCollections.cc.

Referenced by addEntry(), getComment(), getEntry(), removeEntry(), setComment(), and setEntry().

void plist::Array::loadXML ( xmlNode node  )  [virtual]

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

The mapping from node names to actual instantiated types is:

  • 'array' -> Vector
  • 'dict' -> Map
  • 'real' -> Primitive<double>
  • 'integer' -> Primitive<long>
  • 'string' -> Primitive<std::string>
  • 'true', 'false' -> Primitive<bool>

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

Reimplemented from plist::ObjectBase.

Definition at line 715 of file plistCollections.cc.

bool plist::Array::loadXMLNode ( size_t  index,
xmlNode val,
const std::string &  comment 
) [protected, virtual]

called with each node being loaded so subclass can handle appropriately

Definition at line 1044 of file plistCollections.cc.

Referenced by loadXML().

Array& plist::Array::operator= ( const Array d  )  [inline]

assignment (don't assign listeners); subclass should call fireEntriesChanged after calling this (and updating it storage)

Definition at line 254 of file plistCollections.h.

virtual ObjectBase* plist::Array::operator[] ( const std::string &  name  )  const [inline, virtual]

return the value of the key name, or NULL if it doesn't exist (equivalent to getEntry(name))

Reimplemented from plist::Collection.

Definition at line 318 of file plistCollections.h.

ObjectBase& plist::Array::operator[] ( size_t  index  )  const [inline]

return the value of the key name, or NULL if it doesn't exist (equivalent to getEntry(index))

Definition at line 314 of file plistCollections.h.

void plist::Array::removeEntry ( const std::string &  name  )  [virtual]

remove the entry with key name

Implements plist::Collection.

Definition at line 641 of file plistCollections.cc.

void plist::Array::removeEntry ( size_t  index  )  [virtual]

remove the entry at position index

Definition at line 575 of file plistCollections.cc.

Referenced by loadXML(), loadXMLNode(), and removeEntry().

void plist::Array::saveXML ( xmlNode node  )  const [virtual]

subclasses are expected to provide a working implementation

Implements plist::ObjectBase.

Definition at line 732 of file plistCollections.cc.

void plist::Array::setComment ( const std::string &  name,
const std::string &  comment 
) [virtual]

replaces previous comment for name, or adds it if it doesn't already exist (can preceed actual entry!)

Implements plist::Collection.

Definition at line 685 of file plistCollections.cc.

void plist::Array::setComment ( size_t  index,
const std::string &  comment 
) [virtual]

replaces previous comment for name, or adds it if it doesn't already exist (can preceed actual entry!)

Definition at line 670 of file plistCollections.cc.

Referenced by addEntry(), loadXMLNode(), and setComment().

void plist::Array::setEntry ( const std::string &  name,
ObjectBase val,
bool  warnExists = false 
) [virtual]

replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size; clone will be added

Implements plist::Collection.

Definition at line 612 of file plistCollections.cc.

void plist::Array::setEntry ( const std::string &  name,
ObjectBase val,
bool  warnExists = false 
) [virtual]

replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size; clone will be added

Implements plist::Collection.

Definition at line 584 of file plistCollections.cc.

void plist::Array::setEntry ( size_t  index,
ObjectBase val,
bool  warnExists = false 
) [virtual]

replaces previous entry at the specified index, which must be less than or equal to the current array size; clone will be added

Definition at line 536 of file plistCollections.cc.

void plist::Array::setEntry ( size_t  index,
ObjectBase val,
bool  warnExists = false 
) [virtual]

replaces previous entry at the specified index, which must be less than or equal to the current array size; clone will be added

Definition at line 509 of file plistCollections.cc.

Referenced by setEntry(), and setValue().

template<>
void plist::Array::setValue ( const std::string &  name,
char *const &  val,
bool  warnExists 
) [inline]

specialization of Array::setValue() for char* strings

Definition at line 446 of file plistCollections.h.

template<>
void plist::Array::setValue ( const std::string &  name,
const char *const &  val,
bool  warnExists 
) [inline]

specialization of Array::setValue() for char* strings

Definition at line 443 of file plistCollections.h.

template<>
void plist::Array::setValue ( const std::string &  name,
const ObjectBase val,
bool  warnExists 
) [inline]

specialization of Array::setValue() for ObjectBase subclasses

Definition at line 440 of file plistCollections.h.

template<>
void plist::Array::setValue ( size_t  index,
char *const &  val,
bool  warnExists 
) [inline]

specialization of Array::setValue() for char* strings

Definition at line 427 of file plistCollections.h.

template<>
void plist::Array::setValue ( size_t  index,
const char *const &  val,
bool  warnExists 
) [inline]

specialization of Array::setValue() for char* strings

Definition at line 424 of file plistCollections.h.

template<>
void plist::Array::setValue ( size_t  index,
const ObjectBase val,
bool  warnExists 
) [inline]

specialization of Array::setValue() for ObjectBase subclasses

Definition at line 421 of file plistCollections.h.

virtual void plist::Array::setValue ( const std::string &  name,
const char  val[],
bool  warnExists = false 
) [inline, virtual]

"specialization" (actually just another override) for handling character arrays as strings

Definition at line 296 of file plistCollections.h.

template<typename T>
void plist::Array::setValue ( const std::string &  name,
const T &  val,
bool  warnExists = false 
) [inline]

replaces previous entry of the same name, which must represent an integer value less than or equal to the current array size, control of (de)allocation will be assumed by the Vector

Definition at line 291 of file plistCollections.h.

virtual void plist::Array::setValue ( size_t  index,
const char  val[],
bool  warnExists = false 
) [inline, virtual]

"specialization" (actually just another override) for handling character arrays as strings

Definition at line 276 of file plistCollections.h.

template<typename T>
void plist::Array::setValue ( size_t  index,
const T &  val,
bool  warnExists = false 
) [inline]

replaces previous entry at the specified index, which must be less than or equal to the current array size, control of (de)allocation will be assumed by the Vector

Definition at line 271 of file plistCollections.h.

size_t plist::Array::size (  )  const [inline]

return the size of the dictionary

Definition at line 327 of file plistCollections.h.

Referenced by addEntry(), getComment(), getEntry(), getLongestKeyLen(), getSubEntry(), loadXML(), loadXMLNode(), removeEntry(), setComment(), and setEntry().

void plist::Array::takeObject ( size_t  index,
ObjectBase obj 
) [protected, virtual]

indicates that the storage implementation should mark this as an externally supplied heap reference, which needs to be deleted on removal/destruction

Definition at line 973 of file plistCollections.cc.

Referenced by addEntry(), and setEntry().

std::string plist::Array::toString (  )  const [virtual]

return current value as a string

Implements plist::ObjectBase.

Definition at line 826 of file plistCollections.cc.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Array d 
) [friend]

provides textual output

Definition at line 896 of file plistCollections.cc.


Member Data Documentation

storage of entries -- mapping from keys to value pointers

Definition at line 376 of file plistCollections.h.

Referenced by addEntry(), clear(), cloneMyRef(), getComment(), getEntry(), getLongestKeyLen(), getSubEntry(), loadXMLNode(), operator=(), removeEntry(), saveXML(), setComment(), and setEntry().

storage of entry comments -- mapping from keys to help text comments for manual editing or user feedback

not every key necessarily has a comment!

Definition at line 385 of file plistCollections.h.

Referenced by getComment(), operator=(), saveXML(), and setComment().

std::set<ObjectBase*> plist::Array::myRef [protected]

objects which have been handed over to the collection for eventual de-allocation

Definition at line 379 of file plistCollections.h.

Referenced by clear(), cloneMyRef(), fireEntryRemoved(), operator=(), setEntry(), and takeObject().


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

Tekkotsu v3.0
Generated Wed Oct 4 00:05:23 2006 by Doxygen 1.4.7