Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IlPathList Class Reference

The purpose of this class is to provide a way to order the search path of files. More...

#include <ilog/pathlist.h>

Public Member Functions

 IlPathList ()
 Initializes a new empty IlPathList object. More...
 
 IlPathList (const IlString &pathList)
 Initializes a new IlPathList object from a list of paths. More...
 
void addInList (const IlPathList &pathList)
 Adds a path list to the end of the list list. More...
 
void addInList (const IlPathName &path)
 Adds a path to the end of the list list. More...
 
void addInList (const IlString &pathList)
 Adds a path list to the end of the list list. More...
 
void addInPostList (const IlPathList &pathList)
 Adds a path list to the end of the list postList. More...
 
void addInPostList (const IlPathName &path)
 Adds a path to the end of the list postList. More...
 
void addInPostList (const IlString &pathList)
 Adds a path list to the end of the list postList. More...
 
void addInPrevList (const IlPathList &pathList)
 Adds a path list to the end of the list prevList. More...
 
void addInPrevList (const IlPathName &path)
 Adds a path to the end of the list prevList. More...
 
void addInPrevList (const IlString &pathList)
 Adds a path list to the end of the list prevList. More...
 
IlBoolean findInPath (const IlPathName &relative, IlPathName &result, IlBoolean verbose=IlFalse) const
 Searches for an existing file in the search path. More...
 
IlString getListString () const
 Returns a representation of the list list. More...
 
IlString getPostListString () const
 Returns a representation of the list postList. More...
 
IlString getPrevListString () const
 Returns a representation of the list prevList. More...
 
IlString getString () const
 Returns a representation of the entire search path. More...
 
void insertInList (const IlPathList &pathList)
 Inserts a path list at the beginning of the list list. More...
 
void insertInList (const IlPathName &path)
 Inserts a path at the beginning of the list list. More...
 
void insertInList (const IlString &pathList)
 Inserts a path list at the beginning of the list list. More...
 
void insertInPostList (const IlPathList &pathList)
 Inserts a path list at the beginning of the list postList. More...
 
void insertInPostList (const IlPathName &path)
 Inserts a path at the beginning of the list postList. More...
 
void insertInPostList (const IlString &pathList)
 Inserts a path list at the beginning of the list postList. More...
 
void insertInPrevList (const IlPathList &pathList)
 Inserts a path list at the beginning of the list prevList. More...
 
void insertInPrevList (const IlPathName &path)
 Inserts a path at the beginning of the list prevList. More...
 
void insertInPrevList (const IlString &pathList)
 Inserts a path list at the beginning of the list prevList. More...
 
void removeFromList (const IlPathName &path)
 Removes a path from the list list. More...
 
void removeFromList (const IlString &pathList)
 Removes a list of paths from the list list. More...
 
void removeFromPostList (const IlPathName &path)
 Removes a path from the list postList. More...
 
void removeFromPostList (const IlString &pathList)
 Removes a list of paths from the list postList. More...
 
void removeFromPrevList (const IlPathName &path)
 Removes a path from the list prevList. More...
 
void removeFromPrevList (const IlString &pathList)
 Removes a list of paths from the list prevList. More...
 
void setList (const IlPathList &pathList)
 Replaces the list list with a path list. More...
 
void setList (const IlPathName &path)
 Replaces the list list with a single path. More...
 
void setList (const IlString &pathList)
 Replaces the list list with a path list. More...
 
void setPostList (const IlPathList &pathList)
 Replaces the list postList with a path list. More...
 
void setPostList (const IlPathName &path)
 Replaces the list postList with a single path. More...
 
void setPostList (const IlString &pathList)
 Replaces the list postList with a path list. More...
 
void setPrevList (const IlPathList &pathList)
 Replaces the list prevList with a path list. More...
 
void setPrevList (const IlPathName &path)
 Replaces the list prevList with a single path. More...
 
void setPrevList (const IlString &pathList)
 Replaces the list prevList with a path list. More...
 
void unique ()
 Removes the duplicated paths.
 

Detailed Description

The purpose of this class is to provide a way to order the search path of files.

Library: ilog

This class has three sub-lists of path names that we will call: prevList, list, and postList.
The search for a relative path name is done according to the order given above: the actual search path is the concatenation of prevList, list, and postList, in this order.
The search is stopped as soon as a file that matches is found.

See also
IlPathName.

Constructor & Destructor Documentation

◆ IlPathList() [1/2]

IlPathList::IlPathList ( )

Initializes a new empty IlPathList object.

See also
IlPathList(const IlString&).

◆ IlPathList() [2/2]

IlPathList::IlPathList ( const IlString pathList)

Initializes a new IlPathList object from a list of paths.

The string defines a list of path name separated by a : on Unix and a ; on Windows. These path names are stored in list. The lists prevList and postList are empty.

Parameters
pathListA list of paths to initialize this object.
See also
IlPathList().

Member Function Documentation

◆ addInList() [1/3]

void IlPathList::addInList ( const IlPathList pathList)

◆ addInList() [2/3]

void IlPathList::addInList ( const IlPathName path)

◆ addInList() [3/3]

void IlPathList::addInList ( const IlString pathList)

Adds a path list to the end of the list list.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths that are added.
See also
addInPrevList(const IlString&), addInList(const IlPathName&), addInList(const IlPathList&), addInPostList(const IlString&), insertInList(const IlString&), setList(const IlString&), removeFromList(const IlString&).

◆ addInPostList() [1/3]

void IlPathList::addInPostList ( const IlPathList pathList)

Adds a path list to the end of the list postList.

Parameters
pathListThe list of paths that are added.
See also
addInPostList(const IlPathName&), addInPostList(const IlString&), insertInPostList(const IlPathList&), setPostList(const IlPathList&), removeFromPostList(const IlString&).

◆ addInPostList() [2/3]

void IlPathList::addInPostList ( const IlPathName path)

◆ addInPostList() [3/3]

void IlPathList::addInPostList ( const IlString pathList)

Adds a path list to the end of the list postList.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths that are added.
See also
addInPostList(const IlPathName&), addInPostList(const IlPathList&), insertInPostList(const IlString&), setPostList(const IlString&), removeFromPostList(const IlString&).

◆ addInPrevList() [1/3]

void IlPathList::addInPrevList ( const IlPathList pathList)

◆ addInPrevList() [2/3]

void IlPathList::addInPrevList ( const IlPathName path)

◆ addInPrevList() [3/3]

void IlPathList::addInPrevList ( const IlString pathList)

Adds a path list to the end of the list prevList.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths that are added.
See also
addInPrevList(const IlPathName&), addInPrevList(const IlPathList&), addInList(const IlString&), addInPostList(const IlString&), insertInPrevList(const IlString&), setPrevList(const IlString&), removeFromPrevList(const IlString&).

◆ findInPath()

IlBoolean IlPathList::findInPath ( const IlPathName relative,
IlPathName result,
IlBoolean  verbose = IlFalse 
) const

Searches for an existing file in the search path.

The search is done by concatenating the path name relative to each path names of prevList, list, and postList (in this order). As soon as a file is found, this function return IlTrue and sets result to the corresponding value. If no file is found, this function returns IlFalse, and result is not modified.

Parameters
relativeA const reference to an IlPathName object.
resultA reference to an IlPathName object.
verboseAn IlBoolean. The default value is IlFalse. If set to IlTrue, messages that indicate what files are found where are sent to std::cout.

◆ getListString()

IlString IlPathList::getListString ( ) const

Returns a representation of the list list.

The path names are separated by a : on Unix and a ; on Windows.

Returns
A representation of list.
See also
getPrevListString(), getString(), getPostListString().

◆ getPostListString()

IlString IlPathList::getPostListString ( ) const

Returns a representation of the list postList.

The path names are separated by a : on Unix and a ; on Windows.

Returns
A representation of postList.
See also
getString(), getPrevListString(), getListString().

◆ getPrevListString()

IlString IlPathList::getPrevListString ( ) const

Returns a representation of the list prevList.

The path names are separated by a : on Unix and a ; on Windows.

Returns
A representation of prevList.
See also
getString(), getListString(), getPostListString().

◆ getString()

IlString IlPathList::getString ( ) const

Returns a representation of the entire search path.

The string contains all the path names in the order defined by the lists, separated by a : on Unix and a ; on Windows.

Returns
A representation of the entire search path.
See also
getPrevListString(), getListString(), getPostListString().

◆ insertInList() [1/3]

void IlPathList::insertInList ( const IlPathList pathList)

Inserts a path list at the beginning of the list list.

Parameters
pathListThe list of paths that are inserted.
See also
addInList(const IlPathList&), insertInList(const IlPathName&), insertInList(const IlString&), setList(const IlPathList&), removeFromList(const IlString&).

◆ insertInList() [2/3]

void IlPathList::insertInList ( const IlPathName path)

◆ insertInList() [3/3]

void IlPathList::insertInList ( const IlString pathList)

Inserts a path list at the beginning of the list list.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths that are inserted.
See also
addInList(const IlString&), insertInPrevList(const IlString&), insertInList(const IlPathName&), insertInList(const IlPathList&), insertInPostList(const IlString&), setList(const IlString&), removeFromList(const IlString&).

◆ insertInPostList() [1/3]

void IlPathList::insertInPostList ( const IlPathList pathList)

◆ insertInPostList() [2/3]

void IlPathList::insertInPostList ( const IlPathName path)

◆ insertInPostList() [3/3]

void IlPathList::insertInPostList ( const IlString pathList)

Inserts a path list at the beginning of the list postList.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths that are inserted.
See also
addInPostList(const IlString&), insertInPrevList(const IlString&), insertInList(const IlString&), insertInPostList(const IlPathName&), insertInPostList(const IlPathList&), setPostList(const IlString&), removeFromPostList(const IlString&).

◆ insertInPrevList() [1/3]

void IlPathList::insertInPrevList ( const IlPathList pathList)

◆ insertInPrevList() [2/3]

void IlPathList::insertInPrevList ( const IlPathName path)

◆ insertInPrevList() [3/3]

void IlPathList::insertInPrevList ( const IlString pathList)

Inserts a path list at the beginning of the list prevList.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths that are inserted.
See also
addInPrevList(const IlString&), insertInPrevList(const IlPathName&), insertInPrevList(const IlPathList&), insertInList(const IlString&), insertInPostList(const IlString&), setPrevList(const IlString&), removeFromPrevList(const IlString&).

◆ removeFromList() [1/2]

void IlPathList::removeFromList ( const IlPathName path)

◆ removeFromList() [2/2]

void IlPathList::removeFromList ( const IlString pathList)

Removes a list of paths from the list list.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths to be removed.
See also
addInList(const IlString&), insertInList(const IlString&), setPrevList(const IlString&), setList(const IlString&), removeFromPrevList(const IlString&), removeFromList(const IlPathName&), removeFromPostList(const IlString&).

◆ removeFromPostList() [1/2]

void IlPathList::removeFromPostList ( const IlPathName path)

◆ removeFromPostList() [2/2]

void IlPathList::removeFromPostList ( const IlString pathList)

Removes a list of paths from the list postList.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths to be removed.
See also
addInPostList(const IlString&), insertInPostList(const IlString&), setPostList(const IlString&), removeFromPrevList(const IlString&), removeFromList(const IlString&), removeFromPostList(const IlPathName&).

◆ removeFromPrevList() [1/2]

void IlPathList::removeFromPrevList ( const IlPathName path)

◆ removeFromPrevList() [2/2]

void IlPathList::removeFromPrevList ( const IlString pathList)

Removes a list of paths from the list prevList.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths to be removed.
See also
addInPrevList(const IlString&), insertInPrevList(const IlString&), setPrevList(const IlString&), removeFromPrevList(const IlPathName&), removeFromList(const IlString&), removeFromPostList(const IlString&).

◆ setList() [1/3]

void IlPathList::setList ( const IlPathList pathList)

Replaces the list list with a path list.

Parameters
pathListThe list of paths that replaces the list path list.
See also
addInList(const IlPathList&), insertInList(const IlPathList&), setPrevList(const IlPathList&), setList(const IlPathName&), setList(const IlString&), setPostList(const IlPathList&), removeFromList(const IlString&).

◆ setList() [2/3]

void IlPathList::setList ( const IlPathName path)

◆ setList() [3/3]

void IlPathList::setList ( const IlString pathList)

Replaces the list list with a path list.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths that replaces the list path list.
See also
addInList(const IlString&), insertInList(const IlString&), setPrevList(const IlString&), setList(const IlPathName&), setList(const IlPathList&), setPostList(const IlString&), removeFromList(const IlString&).

◆ setPostList() [1/3]

void IlPathList::setPostList ( const IlPathList pathList)

◆ setPostList() [2/3]

void IlPathList::setPostList ( const IlPathName path)

Replaces the list postList with a single path.

Parameters
pathThe path that replaces the postList path list.
See also
addInPostList(const IlPathName&), setPrevList(const IlPathName&), setList(const IlPathName&), setPostList(const IlString&), setPostList(const IlPathList&), removeFromPostList(const IlPathName&).

◆ setPostList() [3/3]

void IlPathList::setPostList ( const IlString pathList)

Replaces the list postList with a path list.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths that replaces the postList path list.
See also
addInPostList(const IlString&), insertInPostList(const IlString&), setPrevList(const IlString&), setList(const IlString&), setPostList(const IlPathName&), setPostList(const IlPathList&), removeFromPostList(const IlString&).

◆ setPrevList() [1/3]

void IlPathList::setPrevList ( const IlPathList pathList)

◆ setPrevList() [2/3]

void IlPathList::setPrevList ( const IlPathName path)

◆ setPrevList() [3/3]

void IlPathList::setPrevList ( const IlString pathList)

Replaces the list prevList with a path list.

This string defines a list of path names separated by a : on Unix and a ; on Windows.

Parameters
pathListThe list of paths that replaces the prevList path list.
See also
addInPrevList(const IlString&), insertInPrevList(const IlString&), setPrevList(const IlPathName&), setPrevList(const IlPathList&), setList(const IlString&), setPostList(const IlString&), removeFromPrevList(const IlString&).