Pyrogenesis  trunk
Functions | Variables
path.cpp File Reference
#include "precompiled.h"
#include "lib/path.h"
#include <cstring>
#include <cerrno>
Include dependency graph for path.cpp:

Functions

 STATUS_ADD_DEFINITIONS (pathStatusDefinitions)
 
static bool path_is_dir_sep (wchar_t c)
 
bool path_is_subpath (const wchar_t *s1, const wchar_t *s2)
 is s2 a subpath of s1, or vice versa? (equal counts as subpath) More...
 
const wchar_t * path_name_only (const wchar_t *path)
 Get the path component of a path. More...
 

Variables

static const StatusDefinition pathStatusDefinitions []
 

Function Documentation

◆ path_is_dir_sep()

static bool path_is_dir_sep ( wchar_t  c)
static

◆ path_is_subpath()

bool path_is_subpath ( const wchar_t *  s1,
const wchar_t *  s2 
)

is s2 a subpath of s1, or vice versa? (equal counts as subpath)

Parameters
s1,s2comparand strings
Returns
bool

◆ path_name_only()

const wchar_t* path_name_only ( const wchar_t *  path)

Get the path component of a path.

Skips over all characters up to the last dir separator, if any.

Parameters
pathInput path.
Returns
pointer to path component within <path>.

◆ STATUS_ADD_DEFINITIONS()

STATUS_ADD_DEFINITIONS ( pathStatusDefinitions  )

Variable Documentation

◆ pathStatusDefinitions

const StatusDefinition pathStatusDefinitions[]
static
Initial value:
= {
{ ERR::PATH_CHARACTER_ILLEGAL, L"illegal path character" },
{ ERR::PATH_CHARACTER_UNSAFE, L"unsafe path character" },
{ ERR::PATH_NOT_FOUND, L"path not found" },
{ ERR::PATH_MIXED_SEPARATORS, L"path contains both slash and backslash separators" }
}
const Status PATH_CHARACTER_ILLEGAL
Definition: path.h:52
const Status PATH_CHARACTER_UNSAFE
Definition: path.h:53
const Status PATH_MIXED_SEPARATORS
Definition: path.h:55
const Status PATH_NOT_FOUND
Definition: path.h:54