xoreos  0.0.5
Functions
cline.cpp File Reference

Command line arguments parser. More...

#include <cstdio>
#include <cstring>
#include "src/cline.h"
#include "src/version/version.h"
#include "src/common/util.h"
#include "src/common/platform.h"
#include "src/common/configman.h"
Include dependency graph for cline.cpp:

Go to the source code of this file.

Functions

static void displayUsage (const Common::UString &name)
 
static void displayVersion ()
 
static Common::UString convertShortToLongOption (uint32 shortOption)
 
static bool setOption (Common::UString &key, const Common::UString &value)
 
static bool parseOption (const Common::UString &arg, Common::UString &key)
 
bool parseCommandline (const std::vector< Common::UString > &argv, Common::UString &target, int &code)
 

Detailed Description

Command line arguments parser.

Definition in file cline.cpp.

Function Documentation

◆ convertShortToLongOption()

static Common::UString convertShortToLongOption ( uint32  shortOption)
static

Definition at line 104 of file cline.cpp.

References ARRAYSIZE.

Referenced by parseOption().

Here is the caller graph for this function:

◆ displayUsage()

static void displayUsage ( const Common::UString name)
static

Definition at line 36 of file cline.cpp.

References Common::UString::c_str(), ConfigMan, Common::Platform::getConfigDirectory(), and Common::Platform::getUserDataDirectory().

Referenced by parseCommandline().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ displayVersion()

static void displayVersion ( )
static

Definition at line 96 of file cline.cpp.

References Version::getProjectAuthors(), Version::getProjectNameVersionFull(), and Version::getProjectURL().

Referenced by parseCommandline().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseCommandline()

bool parseCommandline ( const std::vector< Common::UString > &  argv,
Common::UString target,
int &  code 
)

Definition at line 189 of file cline.cpp.

References Common::UString::c_str(), Common::UString::clear(), ConfigMan, displayUsage(), displayVersion(), Common::UString::empty(), parseOption(), setOption(), and warning().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseOption()

static bool parseOption ( const Common::UString arg,
Common::UString key 
)
static

Definition at line 146 of file cline.cpp.

References Common::UString::begin(), Common::UString::c_str(), convertShortToLongOption(), Common::UString::empty(), Common::UString::end(), Common::UString::findFirst(), setOption(), Common::UString::size(), Common::UString::substr(), and warning().

Referenced by parseCommandline().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOption()

static bool setOption ( Common::UString key,
const Common::UString value 
)
static

Definition at line 128 of file cline.cpp.

References Common::UString::c_str(), Common::UString::clear(), ConfigMan, Common::UString::equalsIgnoreCase(), and warning().

Referenced by parseCommandline(), and parseOption().

Here is the call graph for this function:
Here is the caller graph for this function: