xoreos  0.0.5
Public Types | Static Public Member Functions | List of all members
Common::Platform Class Reference

#include <platform.h>

Public Types

enum  FileMode { kFileModeRead = 0, kFileModeWrite, kFileModeMAX }
 

Static Public Member Functions

static void init ()
 Initialize platform-dependant things. More...
 
static void getParameters (int argc, char **argv, std::vector< UString > &args)
 Read the command line parameters into UTF-8 strings. More...
 
static std::FILE * openFile (const UString &fileName, FileMode mode)
 Open a file with an UTF-8 encoded name. More...
 
static UString getHomeDirectory ()
 Return the OS-specific path of the user's home directory. More...
 
static UString getConfigDirectory ()
 Return the OS-specific path of the config directory. More...
 
static UString getUserDataDirectory ()
 Return the OS-specific path of the user data directory. More...
 

Detailed Description

Definition at line 36 of file platform.h.

Member Enumeration Documentation

◆ FileMode

Enumerator
kFileModeRead 
kFileModeWrite 
kFileModeMAX 

Definition at line 38 of file platform.h.

Member Function Documentation

◆ getConfigDirectory()

UString Common::Platform::getConfigDirectory ( )
static

Return the OS-specific path of the config directory.

Definition at line 206 of file platform.cpp.

References Common::FilePath::canonicalize(), Common::UString::empty(), and getHomeDirectory().

Referenced by displayUsage(), Common::FilePath::getConfigDirectory(), and getUserDataDirectory().

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

◆ getHomeDirectory()

UString Common::Platform::getHomeDirectory ( )
static

Return the OS-specific path of the user's home directory.

Definition at line 180 of file platform.cpp.

Referenced by getConfigDirectory(), Common::FilePath::getHomeDirectory(), and getUserDataDirectory().

Here is the caller graph for this function:

◆ getParameters()

void Common::Platform::getParameters ( int  argc,
char **  argv,
std::vector< UString > &  args 
)
static

Read the command line parameters into UTF-8 strings.

Definition at line 87 of file platform.cpp.

Referenced by main().

Here is the caller graph for this function:

◆ getUserDataDirectory()

UString Common::Platform::getUserDataDirectory ( )
static

Return the OS-specific path of the user data directory.

Definition at line 266 of file platform.cpp.

References Common::FilePath::canonicalize(), Common::UString::empty(), getConfigDirectory(), and getHomeDirectory().

Referenced by displayUsage(), and Common::FilePath::getUserDataDirectory().

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

◆ init()

void Common::Platform::init ( )
static

Initialize platform-dependant things.

Definition at line 53 of file platform.cpp.

Referenced by initPlatform().

Here is the caller graph for this function:

◆ openFile()

std::FILE * Common::Platform::openFile ( const UString fileName,
FileMode  mode 
)
static

Open a file with an UTF-8 encoded name.

Definition at line 102 of file platform.cpp.

References Common::UString::c_str(), and kFileModeMAX.

Referenced by Common::ReadFile::open(), and Common::WriteFile::open().

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

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