cae  0.0.0
Cross-API graphics engine
Loading...
Searching...
No Matches
utl::Path Class Reference

Class for path resolution utilities. More...

#include <Path.hpp>

+ Collaboration diagram for utl::Path:

Public Member Functions

 Path ()=default
 
 ~Path ()=default
 
 Path (const Path &)=delete
 
Pathoperator= (const Path &)=delete
 
 Path (Path &&)=delete
 
Pathoperator= (Path &&)=delete
 

Static Public Member Functions

static fs::path normalize (const fs::path &path)
 Normalize a path (resolve symlinks, relative paths, etc.)
 
static bool existsFile (const fs::path &path)
 Check if a file exists.
 
static bool existsDir (const fs::path &path)
 Check if a directory exists.
 
static fs::path parentDir (const fs::path &path)
 Get the parent directory of a path.
 
template<typename... Paths>
static fs::path join (const Paths &...paths)
 Join multiple paths.
 
static fs::path executableDir ()
 Get the directory of the executable.
 
static fs::path resolveRelativeToExe (const fs::path &relativePath)
 Resolve a relative path to the executable directory.
 
static fs::path resolveRelativeToCwd (const fs::path &relativePath)
 

Detailed Description

Class for path resolution utilities.

Definition at line 29 of file Path.hpp.

Constructor & Destructor Documentation

◆ Path() [1/3]

utl::Path::Path ( )
default

◆ ~Path()

utl::Path::~Path ( )
default

◆ Path() [2/3]

utl::Path::Path ( const Path & )
delete

◆ Path() [3/3]

utl::Path::Path ( Path && )
delete

Member Function Documentation

◆ executableDir()

static fs::path utl::Path::executableDir ( )
inlinestatic

Get the directory of the executable.

Returns
Directory of the executable

Definition at line 92 of file Path.hpp.

Referenced by resolveRelativeToExe().

+ Here is the caller graph for this function:

◆ existsDir()

static bool utl::Path::existsDir ( const fs::path & path)
inlinestatic

Check if a directory exists.

Parameters
pathPath to be checked
Returns
True if the directory exists

Definition at line 68 of file Path.hpp.

Referenced by loadPlugins().

+ Here is the caller graph for this function:

◆ existsFile()

static bool utl::Path::existsFile ( const fs::path & path)
inlinestatic

Check if a file exists.

Parameters
pathPath to be checked
Returns
True if the file exists

Definition at line 61 of file Path.hpp.

Referenced by cae::Application::parseEngineConf().

+ Here is the caller graph for this function:

◆ join()

template<typename... Paths>
static fs::path utl::Path::join ( const Paths &... paths)
inlinestatic

Join multiple paths.

Template Parameters
PathsVariadic template for paths
Parameters
pathsPaths to be joined
Returns
Joined path

Definition at line 83 of file Path.hpp.

References normalize().

+ Here is the call graph for this function:

◆ normalize()

static fs::path utl::Path::normalize ( const fs::path & path)
inlinestatic

Normalize a path (resolve symlinks, relative paths, etc.)

Parameters
pathPath to be normalized
Returns
Normalized path

Definition at line 44 of file Path.hpp.

Referenced by join(), parentDir(), resolveRelativeToCwd(), and resolveRelativeToExe().

+ Here is the caller graph for this function:

◆ operator=() [1/2]

Path & utl::Path::operator= ( const Path & )
delete

◆ operator=() [2/2]

Path & utl::Path::operator= ( Path && )
delete

◆ parentDir()

static fs::path utl::Path::parentDir ( const fs::path & path)
inlinestatic

Get the parent directory of a path.

Parameters
pathPath to get the parent directory of
Returns
Parent directory of the path

Definition at line 75 of file Path.hpp.

References normalize().

+ Here is the call graph for this function:

◆ resolveRelativeToCwd()

static fs::path utl::Path::resolveRelativeToCwd ( const fs::path & relativePath)
inlinestatic
Parameters
relativePathRelative path to be resolved
Returns
Resolved path relative to the user cwd

Definition at line 131 of file Path.hpp.

References normalize().

Referenced by cae::Application::parseEngineConf().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolveRelativeToExe()

static fs::path utl::Path::resolveRelativeToExe ( const fs::path & relativePath)
inlinestatic

Resolve a relative path to the executable directory.

Parameters
relativePathRelative path to be resolved
Returns
Resolved path relative to the executable directory

Definition at line 121 of file Path.hpp.

References executableDir(), and normalize().

Referenced by cae::Application::parseEngineConf(), and cae::Application::start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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