Skip to content

Path

class Path

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

method void append_directory(std::filesystem::path directory)

Append a directory to the search path.

ParameterDescription
directory

The directory to append to the search path.

TYPE: std::filesystem::path

method void append_path(const Path &path, const std::string &subdirectory = "")

Append another path to the search path.

ParameterDescription
path

The path to append.

TYPE: const Path &

subdirectory

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

TYPE: const std::string &DEFAULT: ""

method bool empty()

Check if the search path is empty.

ReturnsDescription
bool

true if the search path is empty, false otherwise.

method Symbol find(Symbol name, Symbol base = {})

Find a file in the search path.

ParameterDescription
name

The name of the file to find.

TYPE: Symbol

base

An optional base directory to resolve relative paths against.

TYPE: SymbolDEFAULT: {}

ReturnsDescription
Symbol

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

method void prepend_directory(std::filesystem::path directory)

Prepend a directory to the search path.

ParameterDescription
directory

The directory to prepend to the search path.

TYPE: std::filesystem::path

method void prepend_path(const Path &path, const std::string &subdirectory = "")

Prepend another path to the search path.

ParameterDescription
path

The path to prepend.

TYPE: const Path &

subdirectory

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

TYPE: const std::string &DEFAULT: ""

member const  empty_path

An empty path.