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

expander::expvartype_bool< StringType, DefaultValue > Class Template Reference

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

#include <expandlib-vartype-bool.h>

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

Inheritance diagram for expander::expvartype_bool< StringType, DefaultValue >:

Inheritance graph
Collaboration diagram for expander::expvartype_bool< StringType, DefaultValue >:

Collaboration graph
List of all members.

Public Methods

 expvartype_bool ()
 Default contructor, inits the value to DefaultValue.

 expvartype_bool (const StringType &ts, const StringType &fs)
 Constructor with just TrueString and FalseString, inits the value to DefaultValue.

 expvartype_bool (const bool b)
 Constructor with a parameter of type bool, inits the value to 'b' (converted).

 expvartype_bool (const bool b, const StringType &ts, const StringType &fs)
 Constructor with a parameter of type bool, inits the value to 'b' (converted) and TrueString and FalseString.

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

 expvartype_bool (const _TCHAR *cs, const StringType &ts, const StringType &fs)
 Constructor with a C-style string as parameter, inits the value to 's' (converted) and TrueString and FalseString.

 expvartype_bool (const StringType s)
 Constructor with a string as parameter, inits the value to 's' (converted).

 expvartype_bool (const StringType s, const StringType &ts, const StringType &fs)
 Constructor with a string as parameter, inits the value to 's' (converted).

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) throw ()
 Sets this variable to the string specified.

void operator= (const StringType &s)
bool & get_value ()
 Conversion to bool.


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

bool val
const StringType TrueString
const StringType FalseString

Detailed Description

template<class StringType = ::std::string, bool DefaultValue = false>
class expander::expvartype_bool< StringType, DefaultValue >

The class that supplies the bool vartype.

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

It accepts both yes/no and true/false (as well as TrueString/FalseString), and it outputs according to the TrueString and FalseString variables.

Definition at line 49 of file expandlib-vartype-bool.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, bool DefaultValue = false>
expander::expvartype_bool< StringType, DefaultValue >::expvartype_bool   [inline]
 

Default contructor, inits the value to DefaultValue.

Definition at line 58 of file expandlib-vartype-bool.h.

template<class StringType = ::std::string, bool DefaultValue = false>
expander::expvartype_bool< StringType, DefaultValue >::expvartype_bool const StringType &    ts,
const StringType &    fs
[inline]
 

Constructor with just TrueString and FalseString, inits the value to DefaultValue.

Definition at line 61 of file expandlib-vartype-bool.h.

template<class StringType = ::std::string, bool DefaultValue = false>
expander::expvartype_bool< StringType, DefaultValue >::expvartype_bool const bool    b [inline]
 

Constructor with a parameter of type bool, inits the value to 'b' (converted).

Definition at line 64 of file expandlib-vartype-bool.h.

template<class StringType = ::std::string, bool DefaultValue = false>
expander::expvartype_bool< StringType, DefaultValue >::expvartype_bool const bool    b,
const StringType &    ts,
const StringType &    fs
[inline]
 

Constructor with a parameter of type bool, inits the value to 'b' (converted) and TrueString and FalseString.

Definition at line 67 of file expandlib-vartype-bool.h.

template<class StringType = ::std::string, bool DefaultValue = false>
expander::expvartype_bool< StringType, DefaultValue >::expvartype_bool const _TCHAR *    cs [inline]
 

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

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

References expander::expvartype_bool< StringType, DefaultValue >::SetValue().

template<class StringType = ::std::string, bool DefaultValue = false>
expander::expvartype_bool< StringType, DefaultValue >::expvartype_bool const _TCHAR *    cs,
const StringType &    ts,
const StringType &    fs
[inline]
 

Constructor with a C-style string as parameter, inits the value to 's' (converted) and TrueString and FalseString.

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

References expander::expvartype_bool< StringType, DefaultValue >::SetValue().

template<class StringType = ::std::string, bool DefaultValue = false>
expander::expvartype_bool< StringType, DefaultValue >::expvartype_bool const StringType    s [inline]
 

Constructor with a string as parameter, inits the value to 's' (converted).

Definition at line 84 of file expandlib-vartype-bool.h.

References expander::expvartype_bool< StringType, DefaultValue >::SetValue().

template<class StringType = ::std::string, bool DefaultValue = false>
expander::expvartype_bool< StringType, DefaultValue >::expvartype_bool const StringType    s,
const StringType &    ts,
const StringType &    fs
[inline]
 

Constructor with a string as parameter, inits the value to 's' (converted).

Definition at line 90 of file expandlib-vartype-bool.h.

References expander::expvartype_bool< StringType, DefaultValue >::SetValue().


Member Function Documentation

template<class StringType = ::std::string, bool DefaultValue = false>
virtual void expander::expvartype_bool< StringType, DefaultValue >::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 97 of file expandlib-vartype-bool.h.

template<class StringType = ::std::string, bool DefaultValue = false>
virtual void expander::expvartype_bool< StringType, DefaultValue >::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 95 of file expandlib-vartype-bool.h.

template<class StringType = ::std::string, bool DefaultValue = false>
bool& expander::expvartype_bool< StringType, DefaultValue >::get_value   [inline]
 

Conversion to bool.

Definition at line 122 of file expandlib-vartype-bool.h.

template<class StringType = ::std::string, bool DefaultValue = false>
void expander::expvartype_bool< StringType, DefaultValue >::operator= const StringType &    s [inline]
 

Definition at line 110 of file expandlib-vartype-bool.h.

template<class StringType = ::std::string, bool DefaultValue = false>
virtual void expander::expvartype_bool< StringType, DefaultValue >::SetValue const StringType &    s throw () [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 99 of file expandlib-vartype-bool.h.

Referenced by expander::expvartype_bool< StringType, DefaultValue >::expvartype_bool().


Member Data Documentation

template<class StringType = ::std::string, bool DefaultValue = false>
const StringType expander::expvartype_bool< StringType, DefaultValue >::FalseString [protected]
 

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

template<class StringType = ::std::string, bool DefaultValue = false>
const StringType expander::expvartype_bool< StringType, DefaultValue >::TrueString [protected]
 

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

template<class StringType = ::std::string, bool DefaultValue = false>
bool expander::expvartype_bool< StringType, DefaultValue >::val [protected]
 

Definition at line 51 of file expandlib-vartype-bool.h.


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