#include <variable.h>
Public Member Functions | |
| const char * | c_str () const |
| CVariable (const char *commandName, const char *commandHelp, const std::string &defaultValue, uint nbMeanValue=0, bool useConfigFile=false, void(*cc)(IVariable &var)=NULL) | |
| virtual bool | execute (const std::vector< std::string > &args, NLMISC::CLog &log, bool quiet, bool human) |
| virtual void | fromString (const std::string &val, bool human=false) |
| const std::string & | get () const |
| operator const char * () const | |
| operator std::string () const | |
| CVariable< std::string > & | operator= (const std::string &val) |
| void | set (const std::string &val) |
| virtual std::string | toString (bool human=false) const |
Private Attributes | |
| std::string | _Value |
|
|
Definition at line 403 of file variable.h.
00404 {
00405 return get().c_str();
00406 }
|
|
||||||||||||||||||||||||||||
|
Definition at line 371 of file variable.h. References NLMISC::CVariable< T >::set(), uint, and value.
|
|
||||||||||||||||||||
|
Definition at line 425 of file variable.h. References NLMISC::CLog::displayNL(), NLMISC::fromString(), and NLMISC::toString().
00426 {
00427 if (args.size () > 1)
00428 return false;
00429
00430 if (args.size () == 1)
00431 {
00432 // set the value
00433 fromString (args[0], human);
00434 }
00435
00436 // display the value
00437 if (quiet)
00438 {
00439 log.displayNL (toString(human).c_str());
00440 }
00441 else
00442 {
00443 log.displayNL ("Variable %s = %s", _CommandName.c_str(), toString(human).c_str());
00444 }
00445 return true;
00446 }
|
|
||||||||||||
|
Definition at line 377 of file variable.h. References NLMISC::CVariable< T >::set().
00378 {
00379 set (val);
00380 }
|
|
|
Definition at line 420 of file variable.h.
00421 {
00422 return _Value;
00423 }
|
|
|
Definition at line 398 of file variable.h.
00399 {
00400 return get().c_str();
00401 }
|
|
|
Definition at line 393 of file variable.h. References NLMISC::CVariable< T >::get().
00394 {
00395 return get();
00396 }
|
|
|
Definition at line 387 of file variable.h. References NLMISC::CVariable< T >::set().
00388 {
00389 set (val);
00390 return *this;
00391 }
|
|
|
Definition at line 408 of file variable.h.
00409 {
00410 _Value = val;
00411 static bool RecurseSet = false;
00412 if (ChangeCallback && !RecurseSet)
00413 {
00414 RecurseSet = true;
00415 ChangeCallback(*this);
00416 RecurseSet = false;
00417 }
00418 }
|
|
|
Definition at line 382 of file variable.h.
00383 {
00384 return _Value;
00385 }
|
|
|
Definition at line 450 of file variable.h. |
1.3.6