proj home

Files   Classes   Functions   Hierarchy  

map_var< bool & > Class Template Reference

Specialization of class for boolean values. More...

#include <commandline.h>

Collaboration diagram for map_var< bool & >:

List of all members.

Public Member Functions

 map_var (bool &var_, map< string, string > &tbl_, stringc &key)
 Read in a boolean value as true, false, 0 or 1.
boolc foundGet () const
booloperator() ()


Detailed Description

template<>
class map_var< bool & >

Specialization of class for boolean values.

Definition at line 184 of file commandline.h.


Constructor & Destructor Documentation

map_var< bool & >::map_var ( bool var_,
map< string, string > &  tbl_,
stringc key 
) [inline]

Read in a boolean value as true, false, 0 or 1.

Definition at line 192 of file commandline.h.

00193     : var(var_), tbl(tbl_)
00194   {
00195     map<string,string>::iterator pos = tbl.find(key);
00196     found = (pos!=tbl.end());
00197     if (found)
00198     {
00199       string s = tbl[key];
00200       transform (s.begin(), s.end(), s.begin(), ::tolower );
00201       if ((s=="false") || (s=="0"))
00202         var = false;
00203       if ((s=="true") || (s=="1"))
00204         var = true;
00205     }
00206   }


Member Function Documentation

boolc map_var< bool & >::foundGet (  )  const [inline]

Definition at line 208 of file commandline.h.

00208 { return found; }

bool& map_var< bool & >::operator() (  )  [inline]

Definition at line 209 of file commandline.h.

00209 { return var; }


The documentation for this class was generated from the following file:

Generated on Fri Mar 4 00:50:04 2011 for Chelton Evans Source by  doxygen 1.5.8