Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

plist::Primitive< std::string > Class Template Reference

#include <plistPrimitives.h>

Inheritance diagram for plist::Primitive< std::string >:

List of all members.


Detailed Description

template<>
class plist::Primitive< std::string >

Provides a std::string specialization of Primitive<T>.

Doesn't need to provide a operator cast because we subclass std::string itself!

Definition at line 325 of file plistPrimitives.h.


Public Member Functions

 Primitive ()
 constructor
 Primitive (const std::string &v)
 casting constructor
 Primitive (const std::string &v, size_type off, size_type count=npos)
 casting constructor
 Primitive (const char *v, size_type count)
 casting constructor
 Primitive (const char *v)
 casting constructor
 Primitive (size_type count, char v)
 casting constructor
Primitiveoperator= (const std::string &v)
 assignment
Primitiveoperator= (const char *v)
 assignment
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)
const std::string & operator * () const
 dereference will return data storage as a string (for uniformity with the other Primitives, although unnecessary with this instantiation)
const std::string * operator-> () const
 returns a pointer to this (for uniformity with the other Primitives, although unnecessary with this instantiation)
void loadXML (xmlNode *node)
 interprets node as a string
void saveXML (xmlNode *node) const
 saves the content of the string into node
void set (const std::string &str)
 assign a new value
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< std::string > * clone () const __attribute__((warn_unused_result))
 clone definition for Primitive<std::string>
const std::string & getPreviousValue () const
 returns the previously assigned value

Protected Attributes

std::string prevVal
 stores the previously assigned value for reference/reset by a value listener

Classes

struct  conversion_policy

Constructor & Destructor Documentation

plist::Primitive< std::string >::Primitive (  )  [inline]

constructor

Definition at line 328 of file plistPrimitives.h.

plist::Primitive< std::string >::Primitive ( const std::string &  v  )  [inline]

casting constructor

Definition at line 329 of file plistPrimitives.h.

plist::Primitive< std::string >::Primitive ( const std::string &  v,
size_type  off,
size_type  count = npos 
) [inline]

casting constructor

Definition at line 330 of file plistPrimitives.h.

plist::Primitive< std::string >::Primitive ( const char *  v,
size_type  count 
) [inline]

casting constructor

Definition at line 331 of file plistPrimitives.h.

plist::Primitive< std::string >::Primitive ( const char *  v  )  [inline]

casting constructor

Definition at line 332 of file plistPrimitives.h.

plist::Primitive< std::string >::Primitive ( size_type  count,
char  v 
) [inline]

casting constructor

Definition at line 333 of file plistPrimitives.h.


Member Function Documentation

Primitive& plist::Primitive< std::string >::operator= ( const std::string &  v  )  [inline]

assignment

Reimplemented from plist::PrimitiveBase.

Definition at line 334 of file plistPrimitives.h.

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

assignment

Definition at line 335 of file plistPrimitives.h.

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

assignment

Definition at line 336 of file plistPrimitives.h.

virtual Primitive& plist::Primitive< std::string >::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 337 of file plistPrimitives.h.

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

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

Definition at line 339 of file plistPrimitives.h.

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

dereference will return data storage as a string (for uniformity with the other Primitives, although unnecessary with this instantiation)

Definition at line 341 of file plistPrimitives.h.

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

returns a pointer to this (for uniformity with the other Primitives, although unnecessary with this instantiation)

Definition at line 343 of file plistPrimitives.h.

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

interprets node as a string

Reimplemented from plist::ObjectBase.

Definition at line 207 of file plistPrimitives.cc.

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

saves the content of the string into node

Implements plist::ObjectBase.

Definition at line 229 of file plistPrimitives.cc.

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

assign a new value

Implements plist::PrimitiveBase.

Definition at line 348 of file plistPrimitives.h.

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

return current value as a string

Implements plist::PrimitiveBase.

Definition at line 350 of file plistPrimitives.h.

long plist::Primitive< std::string >::toLong (  )  const [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 235 of file plistPrimitives.cc.

double plist::Primitive< std::string >::toDouble (  )  const [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 236 of file plistPrimitives.cc.

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

clone definition for Primitive<std::string>

implements the clone function for Primitive<std::string>

Implements plist::ObjectBase.

Definition at line 238 of file plistPrimitives.cc.

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

returns the previously assigned value

Definition at line 357 of file plistPrimitives.h.


Member Data Documentation

std::string plist::Primitive< std::string >::prevVal [protected]

stores the previously assigned value for reference/reset by a value listener

Definition at line 360 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