Canola  0.8.D001
Public Member Functions | Private Types | Private Member Functions | Private Attributes
search_path Class Reference

#include <search_path.h>

List of all members.

Public Member Functions

 ~search_path ()
 search_path ()
 search_path (const std::string &subdir, bool dot=false)
void append (const std::string &dir)
std::string find (const std::string &filename)

Private Types

typedef std::list< std::string > path_t

Private Member Functions

 search_path (const search_path &rhs)
search_pathoperator= (const search_path &rhs)

Private Attributes

std::string subdir
bool have_system
path_t path

Detailed Description

The search_path class is used to represent the processing required to walk a list of directories, looking for the specified file.

Definition at line 29 of file search_path.h.


Member Typedef Documentation

typedef std::list<std::string> search_path::path_t [private]

Definition at line 90 of file search_path.h.


Constructor & Destructor Documentation

The destructor. It is not virtual, thou shalt not derive from this class.

Definition at line 28 of file search_path.cc.

The default constructor.

Definition at line 33 of file search_path.cc.

search_path::search_path ( const std::string &  subdir,
bool  dot = false 
)

A constructor.

Parameters:
subdirA sub-directory to look for, and look into.
dotAlways incldude the current directory at the start of the path.

Definition at line 39 of file search_path.cc.

search_path::search_path ( const search_path rhs) [private]

The copy constructor. Do not use.

Parameters:
rhsThe right hand side of the initialization.

Member Function Documentation

void search_path::append ( const std::string &  dir)

The append method is used to appeand a directory to the end of the search path.

Parameters:
dirThe directory of interest.

Definition at line 57 of file search_path.cc.

std::string search_path::find ( const std::string &  filename)

The find method is used to locate the named file in the directory search path.

Parameters:
filenameThe name of the file to be searched for,
Returns:
The resolved path of the file. If the file could not be found, the string returned is the last directory in the search path added to the filename.

Definition at line 71 of file search_path.cc.

search_path& search_path::operator= ( const search_path rhs) [private]

The assignment operator. Do not use.

Parameters:
rhsThe right hand side of the assignment.

Member Data Documentation

bool search_path::have_system [private]

The have_system instance variable is used to remember whether or not the ${prefix}/share/{progrname} directory has been appeneded to the end of the search path.

Definition at line 88 of file search_path.h.

The path instance variable is used to remember the ordered list of directories to be search for files.

Definition at line 96 of file search_path.h.

std::string search_path::subdir [private]

The subdir instance variable is used to remember the name of the subdirectory that may be present in each of the diretcories nominated to be searched.

Definition at line 81 of file search_path.h.


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