# Coriolis Core (CRL) Documentation

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Static Public Member Functions | List of all members
CRL::SearchPath Class Reference

An ordered list of search pathes. More...

## Classes
class | Element
| An element of the search path (mapping a directory). More...

## Public Member Functions
void | reset ()
size_t | append (const std::string &path, const std::string &name="")
size_t | prepend (const std::string &path, const std::string &name="")
size_t | replace (const std::string &path, const std::string &, size_t index)
size_t | locate (const std::string &file, std::ios::openmode mode=std::ios::in, int first=0, int last=64)
size_t | getSize () const
const std::string & | getSelected () const
size_t | getIndex () const
bool | hasSelected () const
size_t | hasPath (const std::string &path) const
const Element & | operator[] (size_t index) const

## Static Public Member Functions
static std::string | extractLibName (const std::string &)

## Detailed Description

An ordered list of search pathes.

The SearchPath is an AllianceFramework owned object, and as such it's constructors & destructors are made inaccessible by the outside world.

## Member Function Documentation

std::string CRL::SearchPath::extractLibName | ( | const std::string & |  | ) |
| static

Returns
  the library name guessed from a directory path. This is the last component of the, stripped of any extention.

Referenced by append().

void CRL::SearchPath::reset | ( |  | ) |
| inline

Clear all the search path. Only the first, corresponding to the working library is kept.

void CRL::SearchPath::append | ( | const std::string & | path,
|  | const std::string & | name = `""`
| ) |  |
| inline

Append a search path. The `name` gives the library name.

References extractLibName().

void CRL::SearchPath::prepend | ( | const std::string & | path,
|  | const std::string & | name = `""`
| ) |  |

Prepend a search path. The `name` gives the library name.

void CRL::SearchPath::replace | ( | const std::string & | path,
|  | const std::string & | name,
|  | size_t | index
| ) |  |

Replace the search path element at index `index`.

size_t CRL::SearchPath::locate | ( | const std::string & | file,
|  | std::ios::openmode | mode = `std::ios::in`,
|  | int | first = `0`,
|  | int | last = `64`
| ) |  |

Parameters

  file | the requested file.
  mode | the wanted opening mode.
  first | the lower bound in the search path elements.
  last | the upper bound in the search path elements. Returns: the index of the search path element in which the file has been found.

Try to locate a file named `file` (without leading path, but with extention) and check if it can be opened in the desired `mode`. The file is not left opened, but the memory of the search is kept for further operations.

size_t CRL::SearchPath::getSize | ( |  | ) | const
| inline

Returns
  the number of search path elements (directories).

const std::string & CRL::SearchPath::getSelected | ( |  | ) | const
| inline

Returns
  the search path element selected through the last locate request.

size_t CRL::SearchPath::getIndex | ( |  | ) | const
| inline

Returns
  the index of search path element selected through the last locate request.

bool CRL::SearchPath::hasSelected | ( |  | ) | const
| inline

Returns
  true if an element is currently selected (a locate has been performed).

bool CRL::SearchPath::hasPath | ( | const std::string & | path | ) | const

Returns
  true if the path is present in the search path (at any position).

const Element & CRL::SearchPath::operator[] | ( | size_t | index | ) | const

Returns
  The search path element at position `index`. If `index` is out of bounds, an empty Element is returned.

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

- SearchPath.h
- SearchPath.dox

Generated by doxygen 1.8.5 on Thu Mar 19 2020 | Return to top of page

Coriolis Core (CRL) | Copyright © 2008-2016 UPMC All rights reserved