Files Classes Functions Hierarchy
#include <commandline.h>
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 |
| bool & | operator() () |
Definition at line 184 of file commandline.h.
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 }
1.5.8