Skip to content

SearchPath

#include <tpau-cpp-kernal/SearchPath.h>

INCLUDE FILE
#include <tpau-cpp-kernal/SearchPath.h>

class SearchPath

Class representing a search path for files, consisting of a list of directories to search in.

DEFINITION
class SearchPath;

method append_directory

Append a directory to the search path.

DEFINITION
void  append_directory ( std::filesystem::path  directory );
PARAMETERDESCRIPTION
directory

The directory to append to the search path.

method append_path

Append another path to the search path.

DEFINITION
void  append_path ( const SearchPath & path,
std::string_view  subdirectory = "" );
PARAMETERDESCRIPTION
path

The path to append.

subdirectory

An optional subdirectory to add to each directory in the appended path.

method emptyconst

Check if the search path is empty.

DEFINITION
bool  empty ( ) const;
RETURNSDESCRIPTION
bool

true if the search path is empty, false otherwise.

method findconst

Find a file in the search path.

DEFINITION
Symbol  find ( Symbol  name,
Symbol  base = {} ) const;
PARAMETERDESCRIPTION
name

The name of the file to find.

base

An optional base directory to resolve relative paths against.

RETURNSDESCRIPTION
Symbol

The name to the found file, or the empty symbol if the file was not found.

method prepend_directory

Prepend a directory to the search path.

DEFINITION
void  prepend_directory ( std::filesystem::path  directory );
PARAMETERDESCRIPTION
directory

The directory to prepend to the search path.

method prepend_path

Prepend another path to the search path.

DEFINITION
void  prepend_path ( const SearchPath & path,
std::string_view  subdirectory = "" );
PARAMETERDESCRIPTION
path

The path to prepend.

subdirectory

An optional subdirectory to add to each directory in the prepended path.

member empty_pathstatic

An empty path.

DEFINITION
static const SearchPath  empty_path;