51 Arg(
int argc ,
char *argv[] ) ;
59 void parse( HINSTANCE hinstance ,
const std::string & command_line ) ;
65 void reparse(
const std::string & command_line ) ;
77 std::string
v( size_type i )
const ;
81 std::string
prefix()
const ;
85 static const char *
prefix(
char * argv[] ) ;
90 bool contains(
const std::string & sw , size_type sw_args = 0U ,
bool case_sensitive =
true )
const ;
96 size_type
index(
const std::string & sw , size_type sw_args = 0U )
const ;
100 bool remove(
const std::string & sw , size_type sw_args = 0U ) ;
104 void removeAt( size_type sw_index , size_type sw_args = 0U ) ;
115 static std::string moduleName( HINSTANCE h ) ;
116 bool find(
bool ,
const std::string & , size_type , size_type * )
const ;
119 static bool match(
bool ,
const std::string & ,
const std::string & ) ;
120 void parseCore(
const std::string & ) ;
121 static void protect( std::string & ) ;
127 std::string m_prefix ;
std::string prefix() const
Returns the basename of v(0) without any extension.
bool contains(const std::string &sw, size_type sw_args=0U, bool case_sensitive=true) const
< An exception-free version of prefix() which can be used in main() outside of the outermost try bloc...
std::vector< std::string > StringArray
A std::vector of std::strings.
Arg()
Default constructor for Windows.
void parse(HINSTANCE hinstance, const std::string &command_line)
Windows only.
size_type index(const std::string &sw, size_type sw_args=0U) const
Returns the index of the given switch.
Arg & operator=(const Arg &)
Assignment operator.
std::string v(size_type i) const
Returns the i'th argument.
void reparse(const std::string &command_line)
Reinitialises the object with the given command-line.
size_type c() const
Returns the number of tokens in the command line, including the program name.
void removeAt(size_type sw_index, size_type sw_args=0U)
Removes the given argument and the following 'sw_args' ones.
A class which holds a represention of the argc/argv command line array, and supports simple command-l...