Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

sheep::CommandLineParser< T > Class Template Reference

#include <commandlineparser.h>

List of all members.

Public Types

typedef void(T::* PointerToMethodTakingVoid )()
typedef void(T::* PointerToMethodTakingInt )(int)
typedef void(T::* PointerToMethodTakingDouble )(double)
typedef void(T::* PointerToMethodTakingString )(const std::string &)

Public Member Functions

 CommandLineParser ()
void RegisterOption (const std::string &name, const std::string &altname, PointerToMethodTakingVoid option_handler, PointerToMethodTakingString error_handler=0)
void RegisterOption (const std::string &name, const std::string &altname, PointerToMethodTakingInt option_handler, PointerToMethodTakingString error_handler=0)
void RegisterOption (const std::string &name, const std::string &altname, PointerToMethodTakingDouble option_handler, PointerToMethodTakingString error_handler=0)
void RegisterOption (const std::string &name, const std::string &altname, PointerToMethodTakingString option_handler, PointerToMethodTakingString error_handler=0)
void EnableFilenameExtraction (int max_filenames, PointerToMethodTakingString filename_handler)
void Parse (int argc, char **argv) throw (ParseException)
std::string GetCurrentOptionName () const
int AcceptInteger () throw (InvalidArgumentException, MissingArgumentException)
double AcceptDouble () throw (InvalidArgumentException, MissingArgumentException)
std::string AcceptString () throw (InvalidArgumentException, MissingArgumentException)

Private Types

typedef std::vector< optspecoptspec_vector
typedef optspec_vector::const_iterator optspec_vector_const_it

Private Attributes

optspec_vector m_optspecs
bool m_filename_extraction_enabled
 Filename extraction settings.

int m_max_filenames
PointerToMethodTakingString m_filename_handler
int m_argc
char ** m_argv
int m_curopt
std::string m_curoptname

template<typename T>
class sheep::CommandLineParser< T >


Member Typedef Documentation

template<typename T>
typedef std::vector<optspec> sheep::CommandLineParser< T >::optspec_vector [private]
 

Definition at line 138 of file commandlineparser.h.

template<typename T>
typedef optspec_vector::const_iterator sheep::CommandLineParser< T >::optspec_vector_const_it [private]
 

Definition at line 139 of file commandlineparser.h.

template<typename T>
typedef void(T::* sheep::CommandLineParser< T >::PointerToMethodTakingDouble)(double)
 

Definition at line 65 of file commandlineparser.h.

template<typename T>
typedef void(T::* sheep::CommandLineParser< T >::PointerToMethodTakingInt)(int)
 

Definition at line 64 of file commandlineparser.h.

template<typename T>
typedef void(T::* sheep::CommandLineParser< T >::PointerToMethodTakingString)(const std::string &)
 

Definition at line 66 of file commandlineparser.h.

template<typename T>
typedef void(T::* sheep::CommandLineParser< T >::PointerToMethodTakingVoid)()
 

Definition at line 63 of file commandlineparser.h.


Constructor & Destructor Documentation

template<typename T>
sheep::CommandLineParser< T >::CommandLineParser  )  [inline]
 

Definition at line 178 of file commandlineparser.h.


Member Function Documentation

template<typename T>
double sheep::CommandLineParser< T >::AcceptDouble  )  throw (InvalidArgumentException, MissingArgumentException) [inline]
 

Definition at line 348 of file commandlineparser.h.

template<typename T>
int sheep::CommandLineParser< T >::AcceptInteger  )  throw (InvalidArgumentException, MissingArgumentException) [inline]
 

Definition at line 334 of file commandlineparser.h.

template<typename T>
std::string sheep::CommandLineParser< T >::AcceptString  )  throw (InvalidArgumentException, MissingArgumentException) [inline]
 

Definition at line 362 of file commandlineparser.h.

template<typename T>
void sheep::CommandLineParser< T >::EnableFilenameExtraction int  max_filenames,
PointerToMethodTakingString  filename_handler
[inline]
 

Enables extraction of leading filenames in the command line. The number of filenames retrieved is controlled by the 'max_filenames' parameter. Usually, you'll want to set it to 1 (only the first argument on the command line can be considered as a filename) or -1 (any argument that looks like a filename can be seen as a filename, without restriction on the number of filenames extracted).

Definition at line 252 of file commandlineparser.h.

template<typename T>
std::string sheep::CommandLineParser< T >::GetCurrentOptionName  )  const [inline]
 

Definition at line 329 of file commandlineparser.h.

template<typename T>
void sheep::CommandLineParser< T >::Parse int  argc,
char **  argv
throw (ParseException) [inline]
 

Reimplemented in toxic::CLParser, and CLParser.

Definition at line 261 of file commandlineparser.h.

template<typename T>
void sheep::CommandLineParser< T >::RegisterOption const std::string &  name,
const std::string &  altname,
PointerToMethodTakingString  option_handler,
PointerToMethodTakingString  error_handler = 0
[inline]
 

Definition at line 235 of file commandlineparser.h.

template<typename T>
void sheep::CommandLineParser< T >::RegisterOption const std::string &  name,
const std::string &  altname,
PointerToMethodTakingDouble  option_handler,
PointerToMethodTakingString  error_handler = 0
[inline]
 

Definition at line 218 of file commandlineparser.h.

template<typename T>
void sheep::CommandLineParser< T >::RegisterOption const std::string &  name,
const std::string &  altname,
PointerToMethodTakingInt  option_handler,
PointerToMethodTakingString  error_handler = 0
[inline]
 

Definition at line 201 of file commandlineparser.h.

template<typename T>
void sheep::CommandLineParser< T >::RegisterOption const std::string &  name,
const std::string &  altname,
PointerToMethodTakingVoid  option_handler,
PointerToMethodTakingString  error_handler = 0
[inline]
 

Definition at line 184 of file commandlineparser.h.


Member Data Documentation

template<typename T>
int sheep::CommandLineParser< T >::m_argc [private]
 

Definition at line 148 of file commandlineparser.h.

template<typename T>
char** sheep::CommandLineParser< T >::m_argv [private]
 

Definition at line 149 of file commandlineparser.h.

template<typename T>
int sheep::CommandLineParser< T >::m_curopt [private]
 

Definition at line 151 of file commandlineparser.h.

template<typename T>
std::string sheep::CommandLineParser< T >::m_curoptname [private]
 

Definition at line 152 of file commandlineparser.h.

template<typename T>
bool sheep::CommandLineParser< T >::m_filename_extraction_enabled [private]
 

Filename extraction settings.

Definition at line 144 of file commandlineparser.h.

template<typename T>
PointerToMethodTakingString sheep::CommandLineParser< T >::m_filename_handler [private]
 

Definition at line 146 of file commandlineparser.h.

template<typename T>
int sheep::CommandLineParser< T >::m_max_filenames [private]
 

Definition at line 145 of file commandlineparser.h.

template<typename T>
optspec_vector sheep::CommandLineParser< T >::m_optspecs [private]
 

Definition at line 141 of file commandlineparser.h.


The documentation for this class was generated from the following file:
Generated on Tue May 11 01:31:55 2004 for toxic by doxygen 1.3.6