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...
 
FilePath & operator[] (size_t index)
 Return the path at the given index. More...
 
const FilePath & operator[] (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 220 of file File.h.

Member Typedef Documentation

using FileSearchPath::ConstIterator = FilePathVec::const_iterator

Definition at line 224 of file File.h.

using FileSearchPath::Iterator = FilePathVec::iterator

Definition at line 223 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 234 of file File.h.

Member Function Documentation

void FileSearchPath::append ( const FilePath &  path)
inline

Append the given path to the sequence.

Definition at line 261 of file File.h.

void FileSearchPath::append ( const FileSearchPath &  searchPath)
inline

Append the given search path to the sequence.

Definition at line 267 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 246 of file File.h.

Iterator FileSearchPath::begin ( void  )
inline

Definition at line 338 of file File.h.

ConstIterator FileSearchPath::begin ( void  ) const
inline

Definition at line 339 of file File.h.

void FileSearchPath::clear ( )
inline

Clear all paths from the sequence.

Definition at line 282 of file File.h.

Iterator FileSearchPath::end ( void  )
inline

Definition at line 341 of file File.h.

ConstIterator FileSearchPath::end ( void  ) const
inline

Definition at line 342 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 315 of file File.h.

bool FileSearchPath::isEmpty ( ) const
inline

Return true if the search path is empty.

Definition at line 294 of file File.h.

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

Return the path at the given index.

Definition at line 300 of file File.h.

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

Return the const path at the given index.

Definition at line 306 of file File.h.

void FileSearchPath::prepend ( const FilePath &  path)
inline

Prepend the given path to the sequence.

Definition at line 276 of file File.h.

size_t FileSearchPath::size ( void  ) const
inline

Return the number of paths in the sequence.

Definition at line 288 of file File.h.


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