Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

salt::Path Class Reference

This class serves as a helper for path strings within the object hierarchy. More...

#include <path.h>

List of all members.

Public Types

typedef std::list< std::string > TStringList

Public Member Functions

 Path (const std::string &path="")
 constructs a path object from a string, using the Set method
void Set (const std::string &path)
 Sets the managed path expression.
bool IsAbsolute () const
 returns true if the managed path expression denotes an absoulute path, i.e.
const std::string & Front () const
 returns the first path component
void PopFront ()
 returns and removes the first path component
const std::string & Back () const
 returns the last path component
void PopBack ()
 returns and removes the last path component
bool IsEmpty () const
 returns true, if no path components remain, i.e.
std::string GetCleanPath (const std::string &sep="/") const
 returns a cleaned path expression, removing superfluous separators

Protected Attributes

TStringList mPathComponents
 the list of tokenized path components
bool mIsAbsolute
 indicates an absolute path expression

Private Member Functions

 Path (const Path &obj)
Pathoperator= (const Path &obj)
void Tokenize (const std::string &path)
 tokenizes the path components


Detailed Description

This class serves as a helper for path strings within the object hierarchy.

It is capable of cleaning paths and separating a path into path components.

Definition at line 62 of file path.h.


Member Typedef Documentation

typedef std::list<std::string> salt::Path::TStringList
 

Definition at line 68 of file path.h.


Constructor & Destructor Documentation

Path::Path const std::string &  path = ""  ) 
 

constructs a path object from a string, using the Set method

Definition at line 28 of file path.cpp.

References Set().

Here is the call graph for this function:

salt::Path::Path const Path obj  )  [private]
 


Member Function Documentation

const std::string & Path::Back  )  const
 

returns the last path component

Definition at line 91 of file path.cpp.

References mPathComponents.

Referenced by zeitgeist::CoreContext::Install().

const std::string & Path::Front  )  const
 

returns the first path component

Definition at line 80 of file path.cpp.

References mPathComponents.

Referenced by zeitgeist::Core::GetInternal(), and zeitgeist::CoreContext::Install().

std::string Path::GetCleanPath const std::string &  sep = "/"  )  const
 

returns a cleaned path expression, removing superfluous separators

Definition at line 47 of file path.cpp.

References mIsAbsolute, and mPathComponents.

bool Path::IsAbsolute  )  const
 

returns true if the managed path expression denotes an absoulute path, i.e.

has a leading slash

Definition at line 70 of file path.cpp.

References mIsAbsolute.

Referenced by zeitgeist::Core::GetInternal(), and zeitgeist::CoreContext::Install().

bool Path::IsEmpty  )  const
 

returns true, if no path components remain, i.e.

all path components are popped

Definition at line 75 of file path.cpp.

References mPathComponents.

Referenced by zeitgeist::Core::GetInternal(), and zeitgeist::CoreContext::Install().

Path& salt::Path::operator= const Path obj  )  [private]
 

void Path::PopBack  ) 
 

returns and removes the last path component

Definition at line 96 of file path.cpp.

References mPathComponents.

Referenced by zeitgeist::CoreContext::Install().

void Path::PopFront  ) 
 

returns and removes the first path component

Definition at line 85 of file path.cpp.

References mIsAbsolute, and mPathComponents.

Referenced by zeitgeist::Core::GetInternal(), and zeitgeist::CoreContext::Install().

void Path::Set const std::string &  path  ) 
 

Sets the managed path expression.

The path gets tokenized and can be read element by element using Back(), Front(), PopBack() and PopFront()

Definition at line 33 of file path.cpp.

References mIsAbsolute, and Tokenize().

Referenced by Path().

Here is the call graph for this function:

void Path::Tokenize const std::string &  path  )  [private]
 

tokenizes the path components

Definition at line 101 of file path.cpp.

References mPathComponents.

Referenced by Set().


Member Data Documentation

bool salt::Path::mIsAbsolute [protected]
 

indicates an absolute path expression

Definition at line 129 of file path.h.

Referenced by GetCleanPath(), IsAbsolute(), PopFront(), and Set().

TStringList salt::Path::mPathComponents [protected]
 

the list of tokenized path components

Definition at line 126 of file path.h.

Referenced by Back(), Front(), GetCleanPath(), IsEmpty(), PopBack(), PopFront(), and Tokenize().


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:49:13 2006 for rcssserver3d by  doxygen 1.4.4