ERC CISST - cisst software

cmnPath Class Reference
[Common Tools]

#include <cmnPath.h>

Inheritance diagram for cmnPath:

Inheritance graph
[legend]
Collaboration diagram for cmnPath:

Collaboration graph
[legend]
List of all members.

Detailed Description

Search path to find a file. This class contains a list of directories used to locate a file.

The directories can be added either at the head or the tail of the list. This class doesn't check weither the directories in the path actually exist, mostly to allow a portable program (e.g. one program can add both "/usr/local/bin" and "C:\Program Files").

As a convention, the separator between subdirectories should be a "/" (slash) and the separation between two directories in the path is ";" (semi-colon). For example, "/bin;/usr/bin" will add both "/bin" and "/usr/bin".

Definition at line 69 of file cmnPath.h.

Public Types

Public Member Functions

Static Public Member Functions


Member Typedef Documentation

typedef std::list<std::string> cmnPath::ContainerType

Container used to store the directories.

Definition at line 74 of file cmnPath.h.

typedef ContainerType::iterator cmnPath::iterator

STL like iterators.

Definition at line 78 of file cmnPath.h.

typedef ContainerType::const_iterator cmnPath::const_iterator

STL like iterators.

Definition at line 79 of file cmnPath.h.


Member Enumeration Documentation

anonymous enum

Defines how to add a path to the search list.

Definition at line 95 of file cmnPath.h.

anonymous enum

Defines the mode to be used for a given file.

Definition at line 101 of file cmnPath.h.


Constructor & Destructor Documentation

cmnPath::cmnPath ( const std::string &  path  ) 

Create a search path from a string.

virtual cmnPath::~cmnPath ( void   )  [inline, virtual]

Destructor

Definition at line 120 of file cmnPath.h.


Member Function Documentation

void cmnPath::Set ( const std::string &  path  ) 

Set the path from a string.

void cmnPath::Add ( const std::string &  path,
bool  head = HEAD 
)

Add one or more directories to the path.

Referenced by mtsProxyBaseCommon< mtsManagerLocal >::mtsProxyBaseCommon().

void cmnPath::AddFromEnvironment ( const std::string &  variableName,
bool  head = HEAD 
)

Add one or more directories to the path using an environment variable.

Referenced by mtsProxyBaseCommon< mtsManagerLocal >::mtsProxyBaseCommon().

std::string cmnPath::Find ( const std::string &  filename,
short  mode = READ 
) const

Find the full name for a given file.

Returns:
The full path including the filename or an empty string.

Referenced by mtsProxyBaseCommon< mtsManagerLocal >::mtsProxyBaseCommon().

bool cmnPath::Remove ( const std::string &  directory  ) 

Remove the first occurence of a directory from the search list.

bool cmnPath::Has ( const std::string &  directory  )  const

Indicates if a given directory is in the search list.

void cmnPath::ToStream ( std::ostream &  outputStream  )  const [virtual]

Write the path to a stream.

Reimplemented from cmnGenericObject.

static const std::string& cmnPath::DirectorySeparator ( void   )  [static]

A platform-independent string for separating subdirectory or file name from the parent directory name. It's equal to "/" on Linux, "\\" on Windows, etc.

static std::string cmnPath::GetWorkingDirectory ( void   )  [static]

Get working directory


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu