Public Member Functions | |
virtual | ~ArgsOp () |
void | usage () const |
virtual void | testValidity () const |
virtual std::string | msg () const =0 |
virtual void | throwErrorMsg () const |
virtual bool | test (int nb) const =0 |
Public Attributes | |
ListArg | _optionsList |
Definition at line 12 of file OBTOptionArgHandler.cpp.
virtual OBT::ArgsOp::~ArgsOp | ( | ) | [inline, virtual] |
Definition at line 16 of file OBTOptionArgHandler.cpp.
virtual std::string OBT::ArgsOp::msg | ( | ) | const [pure virtual] |
Implemented in OBT::Imply, OBT::Exclusive, OBT::Inclusive, and OBT::AtLeastOne.
Referenced by throwErrorMsg(), and usage().
virtual bool OBT::ArgsOp::test | ( | int | nb | ) | const [pure virtual] |
Implemented in OBT::Imply, OBT::Exclusive, OBT::Inclusive, and OBT::AtLeastOne.
Referenced by testValidity().
void OBT::ArgsOp::testValidity | ( | ) | const [virtual] |
Reimplemented in OBT::Imply.
Definition at line 49 of file OBTOptionArgHandler.cpp.
References _optionsList, test(), and throwErrorMsg().
00050 { 00051 int nb = 0 ; 00052 for( ListArg::const_iterator option = _optionsList.begin() ; 00053 option != _optionsList.end() ; 00054 option++ ) 00055 { 00056 nb += ( *option )->nbPresent() ; 00057 } 00058 if( test( nb ) ) throwErrorMsg() ; 00059 }
void OBT::ArgsOp::throwErrorMsg | ( | ) | const [virtual] |
Definition at line 36 of file OBTOptionArgHandler.cpp.
References _optionsList, and msg().
Referenced by OBT::Imply::testValidity(), and testValidity().
00037 { 00038 std::stringstream error ; 00039 error << std::endl << msg() << std::endl ; 00040 for( ListArg::const_iterator option = _optionsList.begin() ; 00041 option != _optionsList.end() ; 00042 option++ ) 00043 { 00044 error << ( *option )->getHelp() << std::endl ; 00045 } 00046 throw ArgException( error.str() ) ; 00047 }
void OBT::ArgsOp::usage | ( | ) | const |
Definition at line 24 of file OBTOptionArgHandler.cpp.
References _optionsList, and msg().
00025 { 00026 std::cerr << msg() ; 00027 for( ListArg::const_iterator option = _optionsList.begin() ; 00028 option != _optionsList.end() ; 00029 option++ ) 00030 { 00031 std::cerr << ( *option )->getName() << " " ; 00032 } 00033 std::cerr << std::endl ; 00034 }
Definition at line 15 of file OBTOptionArgHandler.cpp.
Referenced by OBT::Inclusive::test(), OBT::Imply::testValidity(), testValidity(), throwErrorMsg(), and usage().