#include <CmdLineArgs.h>
|
| CmdLineArgs () |
|
| CmdLineArgs (const PS::span< const char *const > argv) |
| Parse the command-line options, for future processing. More...
|
|
bool | Has (const CStr &name) const |
| Test whether the given name was specified, as either -name or -name=value More...
|
|
CStr | Get (const CStr &name) const |
| Get the value of the named parameter. More...
|
|
std::vector< CStr > | GetMultiple (const CStr &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...
|
|
std::vector< CStr > | GetArgsWithoutName () const |
| Returns all arguments that don't have a name (string started with '-'). More...
|
|
|
typedef std::vector< std::pair< CStr, CStr > > | ArgsT |
|
◆ ArgsT
◆ CmdLineArgs() [1/2]
CmdLineArgs::CmdLineArgs |
( |
| ) |
|
|
inline |
◆ CmdLineArgs() [2/2]
CmdLineArgs::CmdLineArgs |
( |
const PS::span< const char *const > |
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
-
argv | span of arguments; argv[0] should be the program's name |
◆ Get()
CStr CmdLineArgs::Get |
( |
const CStr & |
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.
◆ GetArg0()
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).
◆ GetArgsWithoutName()
std::vector< CStr > CmdLineArgs::GetArgsWithoutName |
( |
| ) |
const |
Returns all arguments that don't have a name (string started with '-').
◆ GetMultiple()
std::vector< CStr > CmdLineArgs::GetMultiple |
( |
const CStr & |
name | ) |
const |
Get all the values given to the named parameter.
Returns values in the same order as they were given in argv.
◆ Has()
bool CmdLineArgs::Has |
( |
const CStr & |
name | ) |
const |
Test whether the given name was specified, as either -name
or -name=value
◆ m_Arg0
◆ m_Args
ArgsT CmdLineArgs::m_Args |
|
private |
◆ m_ArgsWithoutName
std::vector<CStr> CmdLineArgs::m_ArgsWithoutName |
|
private |
The documentation for this class was generated from the following files:
- /home/docker/jenkins/workspace/technical-docs/source/ps/GameSetup/CmdLineArgs.h
- /home/docker/jenkins/workspace/technical-docs/source/ps/GameSetup/CmdLineArgs.cpp