Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Types | Private Attributes | List of all members
CmdLineArgs Class Reference

#include <CmdLineArgs.h>

Public Member Functions

 CmdLineArgs ()
 
 CmdLineArgs (int argc, const char *argv[])
 Parse the command-line options, for future processing. More...
 
bool Has (const char *name) const
 Test whether the given name was specified, as either -name or -name=value More...
 
CStr Get (const char *name) const
 Get the value of the named parameter. More...
 
std::vector< CStr > GetMultiple (const char *name) const
 Get all the values given to the named parameter. More...
 
OsPath GetArg0 () const
 Get the value of argv[0], which is typically meant to be the name/path of the program (but the actual value is up to whoever executed the program). More...
 

Private Types

typedef std::vector< std::pair
< CStr, CStr > > 
ArgsT
 

Private Attributes

ArgsT m_Args
 
OsPath m_Arg0
 

Detailed Description

Definition at line 24 of file CmdLineArgs.h.

Member Typedef Documentation

typedef std::vector<std::pair<CStr, CStr> > CmdLineArgs::ArgsT
private

Definition at line 65 of file CmdLineArgs.h.

Constructor & Destructor Documentation

CmdLineArgs::CmdLineArgs ( )
inline

Definition at line 27 of file CmdLineArgs.h.

CmdLineArgs::CmdLineArgs ( int  argc,
const char *  argv[] 
)

Parse the command-line options, for future processing.

All arguments are required to be of the form -name or -name=value - anything else is ignored.

Parameters
argcsize of argv array
argvarray of arguments; argv[0] should be the program's name

Definition at line 23 of file CmdLineArgs.cpp.

Member Function Documentation

CStr CmdLineArgs::Get ( const char *  name) const

Get the value of the named parameter.

If it was not specified, returns the empty string. If it was specified multiple times, returns the value from the first occurrence.

Definition at line 71 of file CmdLineArgs.cpp.

OsPath CmdLineArgs::GetArg0 ( ) const

Get the value of argv[0], which is typically meant to be the name/path of the program (but the actual value is up to whoever executed the program).

Definition at line 95 of file CmdLineArgs.cpp.

std::vector< CStr > CmdLineArgs::GetMultiple ( const char *  name) const

Get all the values given to the named parameter.

Returns values in the same order as they were given in argv.

Definition at line 80 of file CmdLineArgs.cpp.

bool CmdLineArgs::Has ( const char *  name) const

Test whether the given name was specified, as either -name or -name=value

Definition at line 66 of file CmdLineArgs.cpp.

Member Data Documentation

OsPath CmdLineArgs::m_Arg0
private

Definition at line 67 of file CmdLineArgs.h.

ArgsT CmdLineArgs::m_Args
private

Definition at line 66 of file CmdLineArgs.h.


The documentation for this class was generated from the following files: