Drag[en]gine Game Engine  1.0
decPath Class Reference

File path. More...

#include <decPath.h>

Public Member Functions

Constructors and Destructors
 decPath ()
 Create empty path. More...
 
 decPath (const decPath &path)
 Create copy of path. More...
 
 ~decPath ()
 Clean up path. More...
 
Management
const decStringGetPrefix () const
 Path prefix. More...
 
void SetPrefix (const char *prefix)
 Set path prefix. More...
 
void SetFromUnix (const char *path)
 Set path from the given string path in unix form. More...
 
void SetFromNative (const char *path)
 Set from the given string path in native form. More...
 
void SetEmpty ()
 Set empty path. More...
 
decString GetPathUnix () const
 Path in unix form. More...
 
decString GetPathNative () const
 Path in native form. More...
 
bool IsEmpty () const
 Path is empty. More...
 
bool IsAbsolute () const
 Path is absolute. More...
 
bool IsRelative () const
 Path is relative. More...
 
void SetFrom (const decPath &path)
 Copy another path to this path. More...
 
void AddPath (const decPath &path)
 Add path to this path. More...
 
void AddUnixPath (const char *path)
 Add unix path to this path. More...
 
void AddNativePath (const char *path)
 Add native path to this path. More...
 
bool MatchesPattern (const decPath &filePattern) const
 Path matches file pattern. More...
 
Component Management
int GetComponentCount () const
 Number of path components. More...
 
const decStringGetComponentAt (int index) const
 Component at index. More...
 
const decStringGetLastComponent () const
 Last path component. More...
 
void AddComponent (const char *component)
 Add component. More...
 
void RemoveComponentFrom (int index)
 Remove component from index. More...
 
void RemoveLastComponent ()
 Remove last component. More...
 
void RemoveAllComponents ()
 Remove all components. More...
 
bool HasComponents () const
 Path has components. More...
 
Operators
bool operator== (const decPath &path) const
 Path is equal to another path. More...
 
bool operator!= (const decPath &path) const
 Path is not equal to another path. More...
 
decPathoperator= (const decPath &path)
 Copy another path to this path. More...
 
decPathoperator+= (const decPath &path)
 Add another path to this path. More...
 
decPath operator+ (const decPath &path)
 Concatenation of path with another path. More...
 

Static Public Member Functions

String Path Testing
static bool IsUnixPathAbsolute (const char *path)
 Unix path is absolute. More...
 
static bool IsNativePathAbsolute (const char *path)
 Native path is absolute. More...
 

Detailed Description

File path.

This class provides an abstraction over file systems. A path is represented as an optional prefix followed by 0 or more path components. A string path can be parsed from a unix file system used by the engine or native file system used by the operating system below.

Author
Pl├╝ss Roland
Version
1.0
Date
2015

Constructor & Destructor Documentation

◆ decPath() [1/2]

decPath::decPath ( )

Create empty path.

◆ decPath() [2/2]

decPath::decPath ( const decPath path)

Create copy of path.

◆ ~decPath()

decPath::~decPath ( )

Clean up path.

Member Function Documentation

◆ AddComponent()

void decPath::AddComponent ( const char *  component)

Add component.

Exceptions
deeInvalidParamcomponent is NULL.

Referenced by GetPrefix().

◆ AddNativePath()

void decPath::AddNativePath ( const char *  path)

Add native path to this path.

Exceptions
deeInvalidParampath is NULL.

Referenced by GetPrefix().

◆ AddPath()

void decPath::AddPath ( const decPath path)

Add path to this path.

Referenced by GetPrefix().

◆ AddUnixPath()

void decPath::AddUnixPath ( const char *  path)

Add unix path to this path.

Exceptions
deeInvalidParampath is NULL.

Referenced by GetPrefix().

◆ GetComponentAt()

const decString& decPath::GetComponentAt ( int  index) const

Component at index.

Exceptions
deeInvalidParamindex is less than 0.
deeInvalidParamindex is larger than or equal to GetComponentCount().

Referenced by GetPrefix().

◆ GetComponentCount()

int decPath::GetComponentCount ( ) const

Number of path components.

Referenced by GetPrefix().

◆ GetLastComponent()

const decString& decPath::GetLastComponent ( ) const

Last path component.

Exceptions
deeInvalidParamPath is empty.

Referenced by GetPrefix().

◆ GetPathNative()

decString decPath::GetPathNative ( ) const

Path in native form.

Referenced by GetPrefix().

◆ GetPathUnix()

decString decPath::GetPathUnix ( ) const

Path in unix form.

Referenced by GetPrefix().

◆ GetPrefix()

◆ HasComponents()

bool decPath::HasComponents ( ) const

Path has components.

Referenced by GetPrefix().

◆ IsAbsolute()

bool decPath::IsAbsolute ( ) const

Path is absolute.

A path is absolute if it does have a prefix.

Referenced by GetPrefix().

◆ IsEmpty()

bool decPath::IsEmpty ( ) const

Path is empty.

Referenced by GetPrefix().

◆ IsNativePathAbsolute()

static bool decPath::IsNativePathAbsolute ( const char *  path)
static

Native path is absolute.

Exceptions
deeInvalidParampath is NULL.

Referenced by GetPrefix().

◆ IsRelative()

bool decPath::IsRelative ( ) const

Path is relative.

A path is absolute if it does have a prefix.

Referenced by GetPrefix().

◆ IsUnixPathAbsolute()

static bool decPath::IsUnixPathAbsolute ( const char *  path)
static

Unix path is absolute.

Exceptions
deeInvalidParampath is NULL.

Referenced by GetPrefix().

◆ MatchesPattern()

bool decPath::MatchesPattern ( const decPath filePattern) const

Path matches file pattern.

Referenced by GetPrefix().

◆ operator!=()

bool decPath::operator!= ( const decPath path) const

Path is not equal to another path.

Referenced by GetPrefix().

◆ operator+()

decPath decPath::operator+ ( const decPath path)

Concatenation of path with another path.

Referenced by GetPrefix().

◆ operator+=()

decPath& decPath::operator+= ( const decPath path)

Add another path to this path.

Referenced by GetPrefix().

◆ operator=()

decPath& decPath::operator= ( const decPath path)

Copy another path to this path.

Referenced by GetPrefix().

◆ operator==()

bool decPath::operator== ( const decPath path) const

Path is equal to another path.

Referenced by GetPrefix().

◆ RemoveAllComponents()

void decPath::RemoveAllComponents ( )

Remove all components.

Referenced by GetPrefix().

◆ RemoveComponentFrom()

void decPath::RemoveComponentFrom ( int  index)

Remove component from index.

Exceptions
deeInvalidParamindex is less than 0.
deeInvalidParamindex is larger than or equal to GetComponentCount().

Referenced by GetPrefix().

◆ RemoveLastComponent()

void decPath::RemoveLastComponent ( )

Remove last component.

Exceptions
deeInvalidParamPath is empty.

Referenced by GetPrefix().

◆ SetEmpty()

void decPath::SetEmpty ( )

Set empty path.

Referenced by GetPrefix().

◆ SetFrom()

void decPath::SetFrom ( const decPath path)

Copy another path to this path.

Referenced by GetPrefix().

◆ SetFromNative()

void decPath::SetFromNative ( const char *  path)

Set from the given string path in native form.

Exceptions
deeInvalidParampath is NULL.

Referenced by GetPrefix().

◆ SetFromUnix()

void decPath::SetFromUnix ( const char *  path)

Set path from the given string path in unix form.

Exceptions
deeInvalidParampath is NULL.

Referenced by GetPrefix().

◆ SetPrefix()

void decPath::SetPrefix ( const char *  prefix)

Set path prefix.

Exceptions
deeInvalidParamprefix is NULL.

Referenced by GetPrefix().


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