HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FileSearchPath Class Reference

#include <File.h>

Public Types

using Iterator = FilePathVec::iterator
 
using ConstIterator = FilePathVec::const_iterator
 

Public Member Functions

 FileSearchPath ()=default
 
 FileSearchPath (const string &searchPath, const string &sep=PATH_LIST_SEPARATOR)
 
string asString (const string &sep=PATH_LIST_SEPARATOR) const
 Convert this sequence to a string using the given separator. More...
 
void append (const FilePath &path)
 Append the given path to the sequence. More...
 
void append (const FileSearchPath &searchPath)
 Append the given search path to the sequence. More...
 
void prepend (const FilePath &path)
 Prepend the given path to the sequence. More...
 
void clear ()
 Clear all paths from the sequence. More...
 
size_t size () const
 Return the number of paths in the sequence. More...
 
bool isEmpty () const
 Return true if the search path is empty. More...
 
FilePathoperator[] (size_t index)
 Return the path at the given index. More...
 
const FilePathoperator[] (size_t index) const
 Return the const path at the given index. More...
 
FilePath find (const FilePath &filename) const
 
Iterators
Iterator begin ()
 
ConstIterator begin () const
 
Iterator end ()
 
ConstIterator end () const
 

Detailed Description

A sequence of file paths, which may be queried to find the first instance of a given filename on the file system.

Definition at line 218 of file File.h.

Member Typedef Documentation

using FileSearchPath::ConstIterator = FilePathVec::const_iterator

Definition at line 222 of file File.h.

using FileSearchPath::Iterator = FilePathVec::iterator

Definition at line 221 of file File.h.

Constructor & Destructor Documentation

FileSearchPath::FileSearchPath ( )
default
FileSearchPath::FileSearchPath ( const string searchPath,
const string sep = PATH_LIST_SEPARATOR 
)
inline

Construct a search path from a string.

Parameters
searchPathA string containing a sequence of file paths joined by separator characters.
sepThe set of separator characters used in the search path. Defaults to the PATH_LIST_SEPARATOR character.

Definition at line 232 of file File.h.

Member Function Documentation

void FileSearchPath::append ( const FilePath path)
inline

Append the given path to the sequence.

Definition at line 259 of file File.h.

void FileSearchPath::append ( const FileSearchPath searchPath)
inline

Append the given search path to the sequence.

Definition at line 265 of file File.h.

string FileSearchPath::asString ( const string sep = PATH_LIST_SEPARATOR) const
inline

Convert this sequence to a string using the given separator.

Definition at line 244 of file File.h.

Iterator FileSearchPath::begin ( void  )
inline

Definition at line 336 of file File.h.

ConstIterator FileSearchPath::begin ( void  ) const
inline

Definition at line 337 of file File.h.

void FileSearchPath::clear ( )
inline

Clear all paths from the sequence.

Definition at line 280 of file File.h.

Iterator FileSearchPath::end ( void  )
inline

Definition at line 339 of file File.h.

ConstIterator FileSearchPath::end ( void  ) const
inline

Definition at line 340 of file File.h.

FilePath FileSearchPath::find ( const FilePath filename) const
inline

Given an input filename, iterate through each path in this sequence, returning the first combined path found on the file system. On success, the combined path is returned; otherwise the original filename is returned unmodified.

Definition at line 313 of file File.h.

bool FileSearchPath::isEmpty ( ) const
inline

Return true if the search path is empty.

Definition at line 292 of file File.h.

FilePath& FileSearchPath::operator[] ( size_t  index)
inline

Return the path at the given index.

Definition at line 298 of file File.h.

const FilePath& FileSearchPath::operator[] ( size_t  index) const
inline

Return the const path at the given index.

Definition at line 304 of file File.h.

void FileSearchPath::prepend ( const FilePath path)
inline

Prepend the given path to the sequence.

Definition at line 274 of file File.h.

size_t FileSearchPath::size ( void  ) const
inline

Return the number of paths in the sequence.

Definition at line 286 of file File.h.


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