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

expander::expvartype_time< StringType, NotimeMSValue > Class Template Reference

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

#include <expandlib-vartype-time.h>

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

Inheritance diagram for expander::expvartype_time< StringType, NotimeMSValue >:

Inheritance graph
Collaboration diagram for expander::expvartype_time< StringType, NotimeMSValue >:

Collaboration graph
List of all members.

Public Methods

 expvartype_time (int H=0, int M=0, int S=0, int MS=0, bool nt=false)
 Constructor with a parameter of type bool, inits the value to H:M:S.MS.

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

 expvartype_time (const StringType s)
 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)
 Sets this variable to the string specified.

long get_milliseconds ()
 Conversion to long (ms).

StringType get_string ()
 Conversion to 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 Methods

StringType PadWithZeroes (const StringType &s, const unsigned int num) const
 Returns s, padded with zeroes from the left.

void PadWithZeroesTo (StringType &d, const StringType &s, const unsigned int num) const
 Pads s from the left (with zeroes), result goes into d.


Protected Attributes

expander::expvartype_time::TimeType Time
 Used to store the time.

bool notime
 Used to specify NO TIME.


Detailed Description

template<class StringType = ::std::string, long NotimeMSValue = -1>
class expander::expvartype_time< StringType, NotimeMSValue >

The class that supplies the time vartype.

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

Todo:
Make it possible to define the way the time is formatted, using parameters

Definition at line 50 of file expandlib-vartype-time.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, long NotimeMSValue = -1>
expander::expvartype_time< StringType, NotimeMSValue >::expvartype_time int    H = 0,
int    M = 0,
int    S = 0,
int    MS = 0,
bool    nt = false
[inline]
 

Constructor with a parameter of type bool, inits the value to H:M:S.MS.

Definition at line 100 of file expandlib-vartype-time.h.

References expander::expvartype_time< StringType, NotimeMSValue >::Time.

template<class StringType = ::std::string, long NotimeMSValue = -1>
expander::expvartype_time< StringType, NotimeMSValue >::expvartype_time const _TCHAR *    cs [inline]
 

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

Definition at line 103 of file expandlib-vartype-time.h.

References expander::expvartype_time< StringType, NotimeMSValue >::SetValue().

template<class StringType = ::std::string, long NotimeMSValue = -1>
expander::expvartype_time< StringType, NotimeMSValue >::expvartype_time const StringType    s [inline]
 

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

Definition at line 109 of file expandlib-vartype-time.h.

References expander::expvartype_time< StringType, NotimeMSValue >::SetValue().


Member Function Documentation

template<class StringType = ::std::string, long NotimeMSValue = -1>
virtual void expander::expvartype_time< StringType, NotimeMSValue >::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 169 of file expandlib-vartype-time.h.

References expander::expvartype_time< StringType, NotimeMSValue >::AppendValue().

template<class StringType = ::std::string, long NotimeMSValue = -1>
virtual void expander::expvartype_time< StringType, NotimeMSValue >::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 113 of file expandlib-vartype-time.h.

References expander::expvartype_time< StringType, NotimeMSValue >::TimeType::h, expander::expvartype_time< StringType, NotimeMSValue >::TimeType::m, expander::expvartype_time< StringType, NotimeMSValue >::TimeType::ms, expander::expvartype_time< StringType, NotimeMSValue >::PadWithZeroes(), expander::expvartype_time< StringType, NotimeMSValue >::PadWithZeroesTo(), expander::expvartype_time< StringType, NotimeMSValue >::TimeType::s, and expander::expvartype_time< StringType, NotimeMSValue >::Time.

Referenced by expander::expvartype_time< StringType, NotimeMSValue >::AppendValue(), and expander::expvartype_time< StringType, NotimeMSValue >::get_string().

template<class StringType = ::std::string, long NotimeMSValue = -1>
long expander::expvartype_time< StringType, NotimeMSValue >::get_milliseconds   [inline]
 

Conversion to long (ms).

Definition at line 264 of file expandlib-vartype-time.h.

References expander::expvartype_time< StringType, NotimeMSValue >::TimeType::h, expander::expvartype_time< StringType, NotimeMSValue >::TimeType::m, expander::expvartype_time< StringType, NotimeMSValue >::TimeType::ms, expander::expvartype_time< StringType, NotimeMSValue >::TimeType::s, and expander::expvartype_time< StringType, NotimeMSValue >::Time.

template<class StringType = ::std::string, long NotimeMSValue = -1>
StringType expander::expvartype_time< StringType, NotimeMSValue >::get_string   [inline]
 

Conversion to string.

Definition at line 267 of file expandlib-vartype-time.h.

References expander::expvartype_time< StringType, NotimeMSValue >::AppendValue().

template<class StringType = ::std::string, long NotimeMSValue = -1>
StringType expander::expvartype_time< StringType, NotimeMSValue >::PadWithZeroes const StringType &    s,
const unsigned int    num
const [inline, protected]
 

Returns s, padded with zeroes from the left.

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

Referenced by expander::expvartype_time< StringType, NotimeMSValue >::AppendValue().

template<class StringType = ::std::string, long NotimeMSValue = -1>
void expander::expvartype_time< StringType, NotimeMSValue >::PadWithZeroesTo StringType &    d,
const StringType &    s,
const unsigned int    num
const [inline, protected]
 

Pads s from the left (with zeroes), result goes into d.

Definition at line 80 of file expandlib-vartype-time.h.

Referenced by expander::expvartype_time< StringType, NotimeMSValue >::AppendValue().

template<class StringType = ::std::string, long NotimeMSValue = -1>
virtual void expander::expvartype_time< StringType, NotimeMSValue >::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 173 of file expandlib-vartype-time.h.

References expander::expvartype_time< StringType, NotimeMSValue >::TimeType::h, expander::expvartype_time< StringType, NotimeMSValue >::TimeType::m, expander::expvartype_time< StringType, NotimeMSValue >::TimeType::ms, expander::expvartype_time< StringType, NotimeMSValue >::TimeType::s, and expander::expvartype_time< StringType, NotimeMSValue >::Time.

Referenced by expander::expvartype_time< StringType, NotimeMSValue >::expvartype_time().


Member Data Documentation

template<class StringType = ::std::string, long NotimeMSValue = -1>
bool expander::expvartype_time< StringType, NotimeMSValue >::notime [protected]
 

Used to specify NO TIME.

Definition at line 92 of file expandlib-vartype-time.h.

template<class StringType = ::std::string, long NotimeMSValue = -1>
class expander::expvartype_time::TimeType expander::expvartype_time< StringType, NotimeMSValue >::Time [protected]
 

Used to store the time.

Referenced by expander::expvartype_time< StringType, NotimeMSValue >::AppendValue(), expander::expvartype_time< StringType, NotimeMSValue >::expvartype_time(), expander::expvartype_time< StringType, NotimeMSValue >::get_milliseconds(), and expander::expvartype_time< StringType, NotimeMSValue >::SetValue().


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