SearchPath
#include <tpau-cpp-kernal/SearchPath.h>
class SearchPath
Class representing a search path for files, consisting of a list of directories to search in.
method append_directory
Append a directory to the search path.
| void append_directory | ( | std::filesystem::path directory | ); |
| PARAMETER | DESCRIPTION |
|---|---|
directory |
The directory to append to the search path. |
method append_path
Append another path to the search path.
| void append_path | ( | const SearchPath & path, | |
| std::string_view subdirectory = "" | ); |
| PARAMETER | DESCRIPTION |
|---|---|
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.
| bool empty | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
method findconst
Find a file in the search path.
| Symbol find | ( | Symbol name, | |
| Symbol base = {} | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the file to find. |
base |
An optional base directory to resolve relative paths against. |
| RETURNS | DESCRIPTION |
|---|---|
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.
| void prepend_directory | ( | std::filesystem::path directory | ); |
| PARAMETER | DESCRIPTION |
|---|---|
directory |
The directory to prepend to the search path. |
method prepend_path
Prepend another path to the search path.
| void prepend_path | ( | const SearchPath & path, | |
| std::string_view subdirectory = "" | ); |
| PARAMETER | DESCRIPTION |
|---|---|
path |
The path to prepend. |
subdirectory |
An optional subdirectory to add to each directory in the prepended path. |
member empty_pathstatic
An empty path.