CMS 3D CMS Logo

lat::SearchPath Class Reference

Directory search path for looking up files. More...

#include <Iguana/Utilities/classlib/utils/SearchPath.h>

List of all members.

Public Types

typedef DirList::const_iterator const_iterator
typedef DirList::const_reference const_reference
typedef
DirList::const_reverse_iterator 
const_reverse_iterator
typedef DirList::iterator iterator
typedef DirList::reference reference
typedef DirList::reverse_iterator reverse_iterator
typedef DirList::size_type size_type

Public Member Functions

const_reference back (void) const
 Return the last directory in the path.
reference back (void)
 Return the last directory in the path.
const_iterator begin (void) const
 Return an iterator to beginning of the search path's list of directories.
iterator begin (void)
 Return an iterator to beginning of the search path's list of directories.
void clear (void)
 Remove all the directories from the path.
bool empty (void) const
 Return true if the search path is empty.
const_iterator end (void) const
 Return an iterator to end of the search path's list of directories.
iterator end (void)
 Return an iterator to end of the search path's list of directories.
iterator erase (iterator first, iterator last)
 Remove a range of directories from first to last from the search path.
iterator erase (iterator pos)
 Remove a directory at position pos from the search path.
Filename expand (const Filename &name) const
const_reference front (void) const
 Return the first directory in the path.
reference front (void)
 Return the first directory in the path.
void insert (iterator pos, const_iterator first, const_iterator last)
 Insert a range of directories from first to last at position pos.
iterator insert (iterator pos, const Filename &dir)
 Insert a directory dir to the search path at position pos.
bool operator== (const SearchPath &x)
 Compare two search paths.
void pop_back (void)
 Remove the last directory in the search path.
void pop_front (void)
 Remove the first directory in the search path.
void push_back (const Filename &dir)
 Add a directory dir to the back of the search path.
void push_front (const Filename &dir)
 Add a directory dir to the front of the search path.
const_reverse_iterator rbegin (void) const
 Return a reverse iterator to the tail end of the search path's list of directories.
reverse_iterator rbegin (void)
 Return a reverse iterator to the tail end of the search path's list of directories.
void remove (const Filename &dir)
 Remove from this search path all directories equal to dir.
const_reverse_iterator rend (void) const
 Return a reverse iterator to the front end of the search path's list of directories.
reverse_iterator rend (void)
 Return a reverse iterator to the front end of the search path's list of directories.
void reverse (void)
 Reverse the search path, making it go from front to back.
const_iterator search (const_iterator from, const Filename &name) const
const_iterator search (const Filename &name) const
 Search for a file name in the search path.
 SearchPath (const_iterator first, const_iterator last)
 Construct a path from an iterator range.
 SearchPath (const std::string &path)
 SearchPath (void)
 Construct an empty search path.
size_type size (void) const
 Return the number of directories in this search path.
void splice (iterator pos, SearchPath &x, iterator first, iterator last)
 Transfer the contents of the search path x into this, inserting the directories into this path in front of the position pos.
void splice (iterator pos, SearchPath &x, iterator i)
 Transfer the contents of the search path x into this, inserting the directories into this path in front of the position pos.
void splice (iterator pos, SearchPath &x)
 Transfer the contents of the search path x into this, inserting the directories into this path in front of the position pos.
void swap (SearchPath &x)
 Swap this directory lists of this search path and x.

Static Public Member Functions

static const char * separator (void)

Private Types

typedef std::list< FilenameDirList

Private Attributes

DirList m_list


Detailed Description

Directory search path for looking up files.

Definition at line 27 of file SearchPath.h.


Member Typedef Documentation

typedef DirList::const_iterator lat::SearchPath::const_iterator

Definition at line 32 of file SearchPath.h.

typedef DirList::const_reference lat::SearchPath::const_reference

Definition at line 38 of file SearchPath.h.

typedef DirList::const_reverse_iterator lat::SearchPath::const_reverse_iterator

Definition at line 34 of file SearchPath.h.

typedef std::list<Filename> lat::SearchPath::DirList [private]

Definition at line 29 of file SearchPath.h.

typedef DirList::iterator lat::SearchPath::iterator

Definition at line 31 of file SearchPath.h.

typedef DirList::reference lat::SearchPath::reference

Definition at line 37 of file SearchPath.h.

typedef DirList::reverse_iterator lat::SearchPath::reverse_iterator

Definition at line 33 of file SearchPath.h.

typedef DirList::size_type lat::SearchPath::size_type

Definition at line 36 of file SearchPath.h.


Constructor & Destructor Documentation

lat::SearchPath::SearchPath ( void   )  [inline]

Construct an empty search path.

Definition at line 116 of file SearchPath.h.

00117 {}

lat::SearchPath::SearchPath ( const std::string &  path  )  [explicit]

lat::SearchPath::SearchPath ( const_iterator  first,
const_iterator  last 
) [inline]

Construct a path from an iterator range.

Definition at line 127 of file SearchPath.h.

00129     : m_list (first, last)


Member Function Documentation

SearchPath::const_reference lat::SearchPath::back ( void   )  const [inline]

Return the last directory in the path.

You may call this method only if the list is non-empty.

Definition at line 210 of file SearchPath.h.

References m_list.

00212 { return m_list.back (); }

SearchPath::reference lat::SearchPath::back ( void   )  [inline]

Return the last directory in the path.

You may call this method only if the list is non-empty.

Definition at line 204 of file SearchPath.h.

References m_list.

00206 { return m_list.back (); }

SearchPath::const_iterator lat::SearchPath::begin ( void   )  const [inline]

Return an iterator to beginning of the search path's list of directories.

Definition at line 156 of file SearchPath.h.

References m_list.

00158 { return m_list.begin (); }

SearchPath::iterator lat::SearchPath::begin ( void   )  [inline]

Return an iterator to beginning of the search path's list of directories.

Definition at line 151 of file SearchPath.h.

References m_list.

Referenced by IgPluginManager::initialise(), and search().

00153 { return m_list.begin (); }

void lat::SearchPath::clear ( void   )  [inline]

Remove all the directories from the path.

Definition at line 267 of file SearchPath.h.

References m_list.

00269 { m_list.clear (); }

bool lat::SearchPath::empty ( void   )  const [inline]

Return true if the search path is empty.

Definition at line 141 of file SearchPath.h.

References m_list.

00143 { return m_list.empty (); }

SearchPath::const_iterator lat::SearchPath::end ( void   )  const [inline]

Return an iterator to end of the search path's list of directories.

Definition at line 166 of file SearchPath.h.

References m_list.

00168 { return m_list.end (); }

SearchPath::iterator lat::SearchPath::end ( void   )  [inline]

Return an iterator to end of the search path's list of directories.

Definition at line 161 of file SearchPath.h.

References m_list.

Referenced by IgPluginManager::initialise().

00163 { return m_list.end (); }

SearchPath::iterator lat::SearchPath::erase ( iterator  first,
iterator  last 
) [inline]

Remove a range of directories from first to last from the search path.

The range may be empty, and may include end().

Definition at line 262 of file SearchPath.h.

References m_list.

00264 { return m_list.erase (first, last); }

SearchPath::iterator lat::SearchPath::erase ( iterator  pos  )  [inline]

Remove a directory at position pos from the search path.

The position must be greater than begin() and less than end().

Definition at line 256 of file SearchPath.h.

References m_list.

00258 { return m_list.erase (pos); }

Filename lat::SearchPath::expand ( const Filename name  )  const

SearchPath::const_reference lat::SearchPath::front ( void   )  const [inline]

Return the first directory in the path.

You may call this method only if the list is non-empty.

Definition at line 198 of file SearchPath.h.

References m_list.

00200 { return m_list.front (); }

SearchPath::reference lat::SearchPath::front ( void   )  [inline]

Return the first directory in the path.

You may call this method only if the list is non-empty.

Definition at line 192 of file SearchPath.h.

References m_list.

00194 { return m_list.front (); }

void lat::SearchPath::insert ( iterator  pos,
const_iterator  first,
const_iterator  last 
) [inline]

Insert a range of directories from first to last at position pos.

Inserting at pos == end() is identical to calling push_back() for each of the directories in the given range.

Definition at line 238 of file SearchPath.h.

References m_list.

00240 { m_list.insert (pos, first, last); }

SearchPath::iterator lat::SearchPath::insert ( iterator  pos,
const Filename dir 
) [inline]

Insert a directory dir to the search path at position pos.

Inserting at pos == end() is identical to calling push_back().

Definition at line 231 of file SearchPath.h.

References m_list.

00233 { return m_list.insert (pos, dir); }

bool lat::SearchPath::operator== ( const SearchPath x  )  [inline]

Compare two search paths.

Returns true if both paths contain the same list of file names: the same names in the same order, and with equally long lists of names.

Definition at line 136 of file SearchPath.h.

References m_list.

00138 { return m_list == x.m_list; }

void lat::SearchPath::pop_back ( void   )  [inline]

Remove the last directory in the search path.

The path must not be empty.

Definition at line 250 of file SearchPath.h.

References m_list.

00252 { m_list.pop_back (); }

void lat::SearchPath::pop_front ( void   )  [inline]

Remove the first directory in the search path.

The path must not be empty.

Definition at line 244 of file SearchPath.h.

References m_list.

00246 { m_list.pop_front (); }

void lat::SearchPath::push_back ( const Filename dir  )  [inline]

Add a directory dir to the back of the search path.

Definition at line 225 of file SearchPath.h.

References m_list.

00227 { m_list.push_back (dir); }

void lat::SearchPath::push_front ( const Filename dir  )  [inline]

Add a directory dir to the front of the search path.

Definition at line 220 of file SearchPath.h.

References m_list.

00222 { m_list.push_front (dir); }

SearchPath::const_reverse_iterator lat::SearchPath::rbegin ( void   )  const [inline]

Return a reverse iterator to the tail end of the search path's list of directories.

Definition at line 176 of file SearchPath.h.

References m_list.

00178 { return m_list.rbegin (); }

SearchPath::reverse_iterator lat::SearchPath::rbegin ( void   )  [inline]

Return a reverse iterator to the tail end of the search path's list of directories.

Definition at line 171 of file SearchPath.h.

References m_list.

00173 { return m_list.rbegin (); }

void lat::SearchPath::remove ( const Filename dir  )  [inline]

Remove from this search path all directories equal to dir.

Definition at line 295 of file SearchPath.h.

References m_list.

00297 { m_list.remove (dir); }

SearchPath::const_reverse_iterator lat::SearchPath::rend ( void   )  const [inline]

Return a reverse iterator to the front end of the search path's list of directories.

Definition at line 186 of file SearchPath.h.

References m_list.

00188 { return m_list.rend (); }

SearchPath::reverse_iterator lat::SearchPath::rend ( void   )  [inline]

Return a reverse iterator to the front end of the search path's list of directories.

Definition at line 181 of file SearchPath.h.

References m_list.

00183 { return m_list.rend (); }

void lat::SearchPath::reverse ( void   )  [inline]

Reverse the search path, making it go from front to back.

Definition at line 300 of file SearchPath.h.

References m_list.

00302 { m_list.reverse (); }

const_iterator lat::SearchPath::search ( const_iterator  from,
const Filename name 
) const

SearchPath::const_iterator lat::SearchPath::search ( const Filename name  )  const [inline]

Search for a file name in the search path.

The name must be relative, non-empty filename, but may include directory components. The method finds the first directory in which the specified file exists and returns an iterator to the directory. The only check that is made is that the filename exists, no check is made to ensure it is accessible, nor is the type checked -- so the returned name may well be a directory instead of a file.

Definition at line 311 of file SearchPath.h.

References begin().

00313 { return search (begin (), name); }

static const char* lat::SearchPath::separator ( void   )  [static]

Referenced by IgApplication::usage().

SearchPath::size_type lat::SearchPath::size ( void   )  const [inline]

Return the number of directories in this search path.

Definition at line 146 of file SearchPath.h.

References m_list.

00148 { return m_list.size (); }

void lat::SearchPath::splice ( iterator  pos,
SearchPath x,
iterator  first,
iterator  last 
) [inline]

Transfer the contents of the search path x into this, inserting the directories into this path in front of the position pos.

Take directories from x starting from the range first to last (but not including last); directories outside the range are not transferred.

Definition at line 290 of file SearchPath.h.

References m_list.

00292 { m_list.splice (pos, x.m_list, first, last); }

void lat::SearchPath::splice ( iterator  pos,
SearchPath x,
iterator  i 
) [inline]

Transfer the contents of the search path x into this, inserting the directories into this path in front of the position pos.

Take directories from x starting from position i; directories before i are not transferred.

Definition at line 281 of file SearchPath.h.

References m_list.

00283 { m_list.splice (pos, x.m_list, i); }

void lat::SearchPath::splice ( iterator  pos,
SearchPath x 
) [inline]

Transfer the contents of the search path x into this, inserting the directories into this path in front of the position pos.

Definition at line 273 of file SearchPath.h.

References m_list.

00275 { m_list.splice (pos, x.m_list); }

void lat::SearchPath::swap ( SearchPath x  )  [inline]

Swap this directory lists of this search path and x.

Definition at line 215 of file SearchPath.h.

References m_list.

00217 { m_list.swap (x.m_list); }


Member Data Documentation

DirList lat::SearchPath::m_list [private]

Definition at line 108 of file SearchPath.h.

Referenced by back(), begin(), clear(), empty(), end(), erase(), front(), insert(), operator==(), pop_back(), pop_front(), push_back(), push_front(), rbegin(), remove(), rend(), reverse(), size(), splice(), and swap().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:48:35 2009 for CMSSW by  doxygen 1.5.4