OBT::ArgsOp Class Reference

Inheritance diagram for OBT::ArgsOp:
[legend]
Collaboration diagram for OBT::ArgsOp:
[legend]

List of all members.

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

Detailed Description

Definition at line 12 of file OBTOptionArgHandler.cpp.


Constructor & Destructor Documentation

virtual OBT::ArgsOp::~ArgsOp (  )  [inline, virtual]

Definition at line 16 of file OBTOptionArgHandler.cpp.

00016 {} 


Member Function Documentation

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]
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 }


Member Data Documentation


Generated on 1 Jan 2010 for OBT by  doxygen 1.6.1