Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

plist::Primitive< char > Class Template Reference

#include <plistPrimitives.h>

Inheritance diagram for plist::Primitive< char >:

List of all members.


Detailed Description

template<>
class plist::Primitive< char >

provides a char specialization of plist::Primitive<T>, adds a unique numeric property to the usual template implementation

A char can be treated as either a string or an integer, you can use the setNumeric(bool) function to indicate which style to use when saving

Definition at line 221 of file plistPrimitives.h.


Public Member Functions

 Primitive ()
 constructor
 Primitive (const char &v, bool isNum=false)
 casting constructor
Primitiveoperator= (char v)
 assignment
virtual Primitiveoperator= (const PrimitiveBase &pb)
 assignment (don't assign listeners); doesn't trigger fireValueChanged, subclass should do that from its own operator=() following assignment
Primitiveoperator= (const Primitive &p)
 assignment from primitive of the same type (just assign value)
Primitiveoperator+= (char v)
 add-assign
Primitiveoperator-= (char v)
 subtract-assign
Primitiveoperator *= (char v)
 multiply-assign
Primitiveoperator/= (char v)
 divide-assign
const char & operator * () const
 dereference will return data storage
const char * operator-> () const
 can use -> to access members of data storage
 operator char () const
 casting operator
void setNumeric (bool isNum)
 sets numeric
bool getNumeric () const
 returns numeric
void loadXML (xmlNode *node)
 interprets node as a char
void saveXML (xmlNode *node) const
 subclasses are expected to provide a working implementation
void set (const std::string &str)
 saves val into node
std::string get () const
 return current value as a string
virtual long toLong () const
 return current value as an (long) integer (throws std::runtime_error exception if incompatable, e.g. dictionary or array to value type)
virtual double toDouble () const
 return current value as a double (throws std::runtime_error exception if incompatable, e.g. dictionary or array to value type)
virtual Primitive< char > * clone () const __attribute__((warn_unused_result))
 clone definition for Primitive<char>
const char & getPreviousValue () const
 returns the previously assigned value

Protected Attributes

char val
 data storage
char prevVal
 following each assignment, this is the "old" value -- very handy for PrimitiveListeners
bool numeric
 if true, requests that saves store the numeric value instead of corresponding character

Classes

struct  conversion_policy

Constructor & Destructor Documentation

plist::Primitive< char >::Primitive (  )  [inline]

constructor

Definition at line 224 of file plistPrimitives.h.

plist::Primitive< char >::Primitive ( const char &  v,
bool  isNum = false 
) [inline]

casting constructor

Definition at line 225 of file plistPrimitives.h.


Member Function Documentation

Primitive& plist::Primitive< char >::operator= ( char  v  )  [inline]

assignment

Definition at line 226 of file plistPrimitives.h.

virtual Primitive& plist::Primitive< char >::operator= ( const PrimitiveBase pb  )  [inline, virtual]

assignment (don't assign listeners); doesn't trigger fireValueChanged, subclass should do that from its own operator=() following assignment

Reimplemented from plist::PrimitiveBase.

Definition at line 227 of file plistPrimitives.h.

Primitive& plist::Primitive< char >::operator= ( const Primitive< char > &  p  )  [inline]

assignment from primitive of the same type (just assign value)

Definition at line 229 of file plistPrimitives.h.

Primitive& plist::Primitive< char >::operator+= ( char  v  )  [inline]

add-assign

Definition at line 230 of file plistPrimitives.h.

Primitive& plist::Primitive< char >::operator-= ( char  v  )  [inline]

subtract-assign

Definition at line 231 of file plistPrimitives.h.

Primitive& plist::Primitive< char >::operator *= ( char  v  )  [inline]

multiply-assign

Definition at line 232 of file plistPrimitives.h.

Primitive& plist::Primitive< char >::operator/= ( char  v  )  [inline]

divide-assign

Definition at line 233 of file plistPrimitives.h.

const char& plist::Primitive< char >::operator * (  )  const [inline]

dereference will return data storage

Definition at line 235 of file plistPrimitives.h.

const char* plist::Primitive< char >::operator-> (  )  const [inline]

can use -> to access members of data storage

Definition at line 237 of file plistPrimitives.h.

plist::Primitive< char >::operator char (  )  const [inline]

casting operator

Definition at line 238 of file plistPrimitives.h.

void plist::Primitive< char >::setNumeric ( bool  isNum  )  [inline]

sets numeric

Definition at line 240 of file plistPrimitives.h.

bool plist::Primitive< char >::getNumeric (  )  const [inline]

returns numeric

Definition at line 241 of file plistPrimitives.h.

void plist::Primitive< char >::loadXML ( xmlNode node  )  [virtual]

interprets node as a char

Reimplemented from plist::ObjectBase.

Definition at line 63 of file plistPrimitives.cc.

void plist::Primitive< char >::saveXML ( xmlNode node  )  const [virtual]

subclasses are expected to provide a working implementation

Implements plist::ObjectBase.

Definition at line 98 of file plistPrimitives.cc.

void plist::Primitive< char >::set ( const std::string &  str  )  [virtual]

saves val into node

Implements plist::PrimitiveBase.

Definition at line 112 of file plistPrimitives.cc.

std::string plist::Primitive< char >::get (  )  const [inline, virtual]

return current value as a string

Implements plist::PrimitiveBase.

Definition at line 247 of file plistPrimitives.h.

virtual long plist::Primitive< char >::toLong (  )  const [inline, virtual]

return current value as an (long) integer (throws std::runtime_error exception if incompatable, e.g. dictionary or array to value type)

Implements plist::ObjectBase.

Definition at line 255 of file plistPrimitives.h.

virtual double plist::Primitive< char >::toDouble (  )  const [inline, virtual]

return current value as a double (throws std::runtime_error exception if incompatable, e.g. dictionary or array to value type)

Implements plist::ObjectBase.

Definition at line 256 of file plistPrimitives.h.

Primitive< char > * plist::Primitive< char >::clone (  )  const [virtual]

clone definition for Primitive<char>

implements the clone function for Primitive<char>

Implements plist::ObjectBase.

Definition at line 132 of file plistPrimitives.cc.

const char& plist::Primitive< char >::getPreviousValue (  )  const [inline]

returns the previously assigned value

Definition at line 261 of file plistPrimitives.h.


Member Data Documentation

char plist::Primitive< char >::val [protected]

data storage

Definition at line 264 of file plistPrimitives.h.

char plist::Primitive< char >::prevVal [protected]

following each assignment, this is the "old" value -- very handy for PrimitiveListeners

Definition at line 265 of file plistPrimitives.h.

bool plist::Primitive< char >::numeric [protected]

if true, requests that saves store the numeric value instead of corresponding character

Definition at line 266 of file plistPrimitives.h.


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

Tekkotsu v4.0
Generated Thu Nov 22 00:58:57 2007 by Doxygen 1.5.4