LibreOffice Module shell (master) 1
|
Simple command line abstraction. More...
#include <cmdline.hxx>
Public Member Functions | |
CommandLine (size_t argc, char *argv[]) | |
Simple command line abstraction. More... | |
std::string | get_arg (const std::string &ArgumentName) const |
Returns an argument by name. More... | |
Private Member Functions | |
CommandLine (const CommandLine &)=delete | |
CommandLine & | operator= (const CommandLine &)=delete |
Static Private Member Functions | |
static bool | is_arg_name (const std::string &Argument) |
Returns whether a given argument is an argument name. More... | |
Private Attributes | |
size_t | m_argc |
char ** | m_argv |
Simple command line abstraction.
Definition at line 30 of file cmdline.hxx.
CommandLine::CommandLine | ( | size_t | argc, |
char * | argv[] | ||
) |
Simple command line abstraction.
Definition at line 28 of file cmdline.cxx.
|
privatedelete |
std::string CommandLine::get_arg | ( | const std::string & | ArgumentName | ) | const |
Returns an argument by name.
If there are duplicate argument names in the command line, the first one wins. Argument name and the argument value must be separated by spaces. If the argument value starts with an argument prefix use quotes else the return value is an empty string because the value will be interpreted as the next argument name. If an argument value contains spaces use quotes.
@precond GetArgumentNames() -> has element ArgumentName
std::invalid_argument | exception if the specified argument could not be found |
Definition at line 52 of file cmdline.cxx.
References i, is_arg_name(), m_argc, and m_argv.
Referenced by SAL_IMPLEMENT_MAIN_WITH_ARGS().
|
staticprivate |
Returns whether a given argument is an argument name.
Definition at line 77 of file cmdline.cxx.
Referenced by get_arg().
|
privatedelete |
|
private |
Definition at line 63 of file cmdline.hxx.
Referenced by get_arg().
|
private |
Definition at line 64 of file cmdline.hxx.
Referenced by get_arg().