decPath Class Reference

Describes a file path. More...

#include <decPath.h>

List of all members.

Public Member Functions

Constructors and Destructors
 decPath ()
 Creates an empty path.
 decPath (const decPath &path)
 Creates a new path from the given path.
 ~decPath ()
 Cleans up the path object.
Management
const char * GetPrefix () const
 Retrieves the prefix of the path.
void SetPrefix (const char *prefix)
 Sets the prefix of the path.
void SetFromUnix (const char *path)
 Sets the path from the given string path in unix form.
void SetFromNative (const char *path)
 Sets the path from the given string path in native form.
void SetEmpty ()
 Sets the path to the empty path.
const char * GetPathUnix ()
 Retrieves the path as string in unix form.
const char * GetPathNative ()
 Retrieves the path as string in native form.
bool IsEmpty () const
 Determines if the path is empty.
bool IsAbsolute () const
 Determines if this path is an aboslute path.
bool IsRelative () const
 Determines if this path is an relative path.
void SetFrom (const decPath &path)
 Sets the path from another path.
void AddPath (const decPath &path)
 Adds a path to this path.
void AddUnixPath (const char *path)
 Adds a unix string path to this path.
void AddNativePath (const char *path)
 Adds a native string path to this path.
bool MatchesPattern (const decPath &filePattern) const
 Determines if this path matches file pattern.
Component Management
int GetComponentCount () const
 Retrieves the number of path components.
const char * GetComponent (int index) const
 Retrieves the component at the given index.
const char * GetLastComponent () const
 Retrieves the last component ( aka the filename ).
void AddComponent (const char *component)
 Adds a component to the path.
void RemoveComponent (int index)
 Removes the component at the given index from the path.
void RemoveLastComponent ()
 Removes the last component.
void RemoveAllComponents ()
 Removes all components from the path.
bool HasComponents () const
 Determines if there are components in this path.

String Path Testing

bool operator== (const decPath &path) const
 Determines if this path is equal to another path.
bool operator!= (const decPath &path) const
 Determines if this path is not equal to another path.
static bool IsUnixPathAbsolute (const char *path)
 Determines if the given unix style string path is absolute.
static bool IsNativePathAbsolute (const char *path)
 Determines if the given native style string path is absolute.

Detailed Description

Describes a 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:
2008

Constructor & Destructor Documentation

decPath::decPath (  )

Creates an empty path.

decPath::decPath ( const decPath path )

Creates a new path from the given path.

decPath::~decPath (  )

Cleans up the path object.


Member Function Documentation

void decPath::AddComponent ( const char *  component )

Adds a component to the path.

void decPath::AddNativePath ( const char *  path )

Adds a native string path to this path.

void decPath::AddPath ( const decPath path )

Adds a path to this path.

void decPath::AddUnixPath ( const char *  path )

Adds a unix string path to this path.

const char* decPath::GetComponent ( int  index ) const

Retrieves the component at the given index.

int decPath::GetComponentCount (  ) const [inline]

Retrieves the number of path components.

const char* decPath::GetLastComponent (  ) const

Retrieves the last component ( aka the filename ).

const char* decPath::GetPathNative (  )

Retrieves the path as string in native form.

The string is allocated using new.

const char* decPath::GetPathUnix (  )

Retrieves the path as string in unix form.

The string is allocated using new.

const char* decPath::GetPrefix (  ) const [inline]

Retrieves the prefix of the path.

bool decPath::HasComponents (  ) const [inline]

Determines if there are components in this path.

bool decPath::IsAbsolute (  ) const

Determines if this path is an aboslute path.

A path is absolute if it does have a prefix.

bool decPath::IsEmpty (  ) const

Determines if the path is empty.

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

Determines if the given native style string path is absolute.

bool decPath::IsRelative (  ) const

Determines if this path is an relative path.

A path is absolute if it does have a prefix.

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

Determines if the given unix style string path is absolute.

bool decPath::MatchesPattern ( const decPath filePattern ) const

Determines if this path matches file pattern.

The file pattern is stored in another path.

Returns:
true if the path matches the file pattern.
bool decPath::operator!= ( const decPath path ) const

Determines if this path is not equal to another path.

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

Determines if this path is equal to another path.

void decPath::RemoveAllComponents (  )

Removes all components from the path.

void decPath::RemoveComponent ( int  index )

Removes the component at the given index from the path.

void decPath::RemoveLastComponent (  )

Removes the last component.

void decPath::SetEmpty (  )

Sets the path to the empty path.

void decPath::SetFrom ( const decPath path )

Sets the path from another path.

void decPath::SetFromNative ( const char *  path )

Sets the path from the given string path in native form.

void decPath::SetFromUnix ( const char *  path )

Sets the path from the given string path in unix form.

void decPath::SetPrefix ( const char *  prefix )

Sets the prefix of the path.


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