Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

expander::expvartype_text< StringType > Class Template Reference

The class that supplies the text vartype. More...

#include <expandlib-vartype-text.h>

Inherits expander::expandvartype< StringType >< StringType >.

Inheritance diagram for expander::expvartype_text< StringType >:

Inheritance graph
Collaboration diagram for expander::expvartype_text< StringType >:

Collaboration graph
List of all members.

Public Methods

 expvartype_text ()
 Default contructor, inits the string to "".

 expvartype_text (const StringType &s)
 Constructor with a parameter of type StringType, inits the string to 's'.

 expvartype_text (const _TCHAR *s)
 Constructor with a C-style string as parameter, inits the string to 's'.

virtual void AppendValue (StringType &dest) const
 Appends the value of the var to a string.

virtual void AppendValue (StringType &dest, const FParamVectorType &params, const FVarMapType &vars, ExpandResultsType &results) const
 Appends the value of the var to a string, using params and rvars, putting any expanding results into results.

virtual void SetValue (const StringType &s)
 Sets this variable to the string specified.

StringType & get_string ()
 Returns the string.


Protected Types

typedef ::std::vector< StringType > FParamVectorType
 The type used for the parameter vectors (MSVC wouldn't allow me to use template arguments in these typedefs, or I don't know how it should be done).

typedef ::std::map< StringType,
::expander::expandvartype<
StringType > * > 
FVarMapType
 The type used for the map of variables (MSVC wouldn't allow me to use template arguments in these typedefs, or I don't know how it should be done).


Protected Attributes

StringType value

Detailed Description

template<class StringType = ::std::string>
class expander::expvartype_text< StringType >

The class that supplies the text vartype.

This class can be used in the program using ExpandLib for simple text variables.

It is based on both expandvartype as well as StringType, this makes it very flexible, as it inherits all the great stuff you can do with StringType (assignments, all kinds of string operations, whatever that type has to offer).

NOTE: The following is somewhat obsolete:

This class should also be used (at least for now) for numeric variables, just convert them to a string. All numeric values are handled like strings at the moment, they are only converted to "real" (as in true, not as in floating point) numeric values when needed.

Definition at line 55 of file expandlib-vartype-text.h.


Member Typedef Documentation

template<class StringType = ::std::string>
typedef ::std::vector<StringType> expander::expandvartype< StringType >::FParamVectorType [protected, inherited]
 

The type used for the parameter vectors (MSVC wouldn't allow me to use template arguments in these typedefs, or I don't know how it should be done).

Definition at line 52 of file expandlib-vartype.h.

Referenced by expander::expvartype_list< StringType, ItemType >::AppendValue().

template<class StringType = ::std::string>
typedef ::std::map<StringType, ::expander::expandvartype<StringType>*> expander::expandvartype< StringType >::FVarMapType [protected, inherited]
 

The type used for the map of variables (MSVC wouldn't allow me to use template arguments in these typedefs, or I don't know how it should be done).

Definition at line 53 of file expandlib-vartype.h.


Constructor & Destructor Documentation

template<class StringType = ::std::string>
expander::expvartype_text< StringType >::expvartype_text   [inline]
 

Default contructor, inits the string to "".

Definition at line 62 of file expandlib-vartype-text.h.

template<class StringType = ::std::string>
expander::expvartype_text< StringType >::expvartype_text const StringType &    s [inline]
 

Constructor with a parameter of type StringType, inits the string to 's'.

Definition at line 65 of file expandlib-vartype-text.h.

template<class StringType = ::std::string>
expander::expvartype_text< StringType >::expvartype_text const _TCHAR *    s [inline]
 

Constructor with a C-style string as parameter, inits the string to 's'.

Definition at line 68 of file expandlib-vartype-text.h.


Member Function Documentation

template<class StringType = ::std::string>
virtual void expander::expvartype_text< StringType >::AppendValue StringType &    dest,
const FParamVectorType   params,
const FVarMapType   vars,
ExpandResultsType   results
const [inline, virtual]
 

Appends the value of the var to a string, using params and rvars, putting any expanding results into results.

This is called directly from 'expandable<StringType>::expand', when a variable with parameters has been found.

Implements expander::expandvartype< StringType >.

Definition at line 72 of file expandlib-vartype-text.h.

template<class StringType = ::std::string>
virtual void expander::expvartype_text< StringType >::AppendValue StringType &    dest const [inline, virtual]
 

Appends the value of the var to a string.

This is called by operator+=(StringType &s,::expander::expandvartype<StringType> *v), which is called by 'expandable<StringType>::expand' when a variable without parameters has been found.

Implements expander::expandvartype< StringType >.

Definition at line 70 of file expandlib-vartype-text.h.

template<class StringType = ::std::string>
StringType& expander::expvartype_text< StringType >::get_string   [inline]
 

Returns the string.

Definition at line 77 of file expandlib-vartype-text.h.

template<class StringType = ::std::string>
virtual void expander::expvartype_text< StringType >::SetValue const StringType &    s [inline, virtual]
 

Sets this variable to the string specified.

This isn't called from ExpandLib itself, but it can be used by other programs.

Implements expander::expandvartype< StringType >.

Definition at line 74 of file expandlib-vartype-text.h.


Member Data Documentation

template<class StringType = ::std::string>
StringType expander::expvartype_text< StringType >::value [protected]
 

Definition at line 57 of file expandlib-vartype-text.h.


The documentation for this class was generated from the following file:
Generated on Tue Feb 4 17:24:31 2003 for ExpandLib by doxygen1.3-rc2