#include <expandlib-vartype-list.h>
Inherits expander::expandvartype< StringType >< StringType >.
Inheritance diagram for expander::expvartype_list< StringType, ItemType >:
Public Methods | |
expvartype_list (const _TCHAR *const is=_T(",")) | |
Default contructor, inits the list to nothing. | |
expvartype_list (const StringType &s, const _TCHAR *const is=_T(",")) | |
Constructor with a parameter of type StringType, inits the string to 's'. | |
expvartype_list (const _TCHAR *s, const _TCHAR *const is=_T(",")) | |
Constructor with a C-style string as parameter, inits the string to 's'. | |
template<class T> | expvartype_list (T beg, const T end, const _TCHAR *const is=_T(",")) |
Constructor using a begin and end iterator. | |
template<class T> | expvartype_list (const::std::vector< ItemType >::size_type n, const T val, const _TCHAR *const is=_T(",")) |
Constructor using a count and a value (generates n elements with value v). | |
virtual void | AppendValue (StringType &dest) const throw () |
Appends the value of the var to a string. | |
virtual void | AppendValue (StringType &dest, const FParamVectorType ¶ms, const FVarMapType &vars, ExpandResultsType &results) const throw () |
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. | |
inline::std::vector< ItemType > & | get_list () |
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 | |
::std::vector< ItemType > | list |
const _TCHAR *const | ItemSeparator |
This class can be used in the program using ExpandLib for lists of variables of a specific type.
Normally this will return a list of the elements separated by a comma and a space. It can however also receive parameters, the syntax for this is: ${listvar([(index|separator|'|')[,extraparams]])} If a number is given as the first parameter it is interpreted as an index into the list, it this index is -1 it will return the last item in the list. extraparams is passed on to each item in the list. If a | (pipe) is given as the first parameter extraparams will just be passed on to each item in the list. If neither a pipe nor a number is given as the first parameter it is used as separator. extraparams is passed on to each item in the list.
Since this class is also derived from std::vector<ItemType> any of its member functions can also be used on this type.
Definition at line 65 of file expandlib-vartype-list.h.
|
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(). |
|
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. |
|
Default contructor, inits the list to nothing.
Definition at line 73 of file expandlib-vartype-list.h. |
|
Constructor with a parameter of type StringType, inits the string to 's'.
Definition at line 76 of file expandlib-vartype-list.h. References expander::expvartype_list< StringType, ItemType >::SetValue(). |
|
Constructor with a C-style string as parameter, inits the string to 's'.
Definition at line 79 of file expandlib-vartype-list.h. References expander::expvartype_list< StringType, ItemType >::SetValue(). |
|
Constructor using a begin and end iterator. This constructor lets you initialize the list with another list (or in general anything that can be behave as an iterator). Definition at line 85 of file expandlib-vartype-list.h. References expander::expvartype_list< StringType, ItemType >::list. |
|
Constructor using a count and a value (generates n elements with value v).
Definition at line 93 of file expandlib-vartype-list.h. References expander::expvartype_list< StringType, ItemType >::list. |
|
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 105 of file expandlib-vartype-list.h. References expander::expandvartype< StringType >::FParamVectorType, and expander::expvartype_list< StringType, ItemType >::list. |
|
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-list.h. References expander::expvartype_list< StringType, ItemType >::list. |
|
Definition at line 179 of file expandlib-vartype-list.h. References expander::expvartype_list< StringType, ItemType >::list. |
|
Sets this variable to the string specified.
Implements expander::expandvartype< StringType >. Definition at line 177 of file expandlib-vartype-list.h. Referenced by expander::expvartype_list< StringType, ItemType >::expvartype_list(). |
|
Definition at line 68 of file expandlib-vartype-list.h. |
|