DotNameLib
Loading...
Searching...
No Matches
dotnamecpp::utils::IPathResolver Class Referenceabstract

Interface for path resolution and manipulation. More...

#include <IPathResolver.hpp>

Inheritance diagram for dotnamecpp::utils::IPathResolver:
Collaboration diagram for dotnamecpp::utils::IPathResolver:

Public Member Functions

virtual ~IPathResolver ()=default
virtual Result< std::filesystem::path, FileErrorgetAbsolutePath (const std::filesystem::path &path) const =0
 Get the Absolute Path object.
virtual Result< std::filesystem::path, FileErrorgetCanonicalPath (const std::filesystem::path &path) const =0
 Get the Canonical Path object.
virtual Result< std::filesystem::path, FileErrorgetRelativePath (const std::filesystem::path &target, const std::filesystem::path &base=std::filesystem::current_path()) const =0
 Get the Relative Path object.
virtual bool isAbsolute (const std::filesystem::path &path) const =0
 Check if path is absolute.
virtual bool isRelative (const std::filesystem::path &path) const =0
 Check if path is relative.
virtual std::filesystem::path getParent (const std::filesystem::path &path) const =0
 Get the Parent object.
virtual std::string getFilename (const std::filesystem::path &path) const =0
 Get the Filename object.
virtual std::string getExtension (const std::filesystem::path &path) const =0
 Get the Extension object.
virtual std::string getStem (const std::filesystem::path &path) const =0
 Get the Stem object.
virtual std::filesystem::path join (const std::vector< std::string > &parts) const =0
 Join multiple path components.

Detailed Description

Interface for path resolution and manipulation.

Provides abstraction for filesystem path operations.

Constructor & Destructor Documentation

◆ ~IPathResolver()

virtual dotnamecpp::utils::IPathResolver::~IPathResolver ( )
virtualdefault

Member Function Documentation

◆ getAbsolutePath()

virtual Result< std::filesystem::path, FileError > dotnamecpp::utils::IPathResolver::getAbsolutePath ( const std::filesystem::path & path) const
nodiscardpure virtual

Get the Absolute Path object.

Parameters
path
Returns
Result<std::filesystem::path, FileError>

Implemented in dotnamecpp::utils::PathResolver.

◆ getCanonicalPath()

virtual Result< std::filesystem::path, FileError > dotnamecpp::utils::IPathResolver::getCanonicalPath ( const std::filesystem::path & path) const
nodiscardpure virtual

Get the Canonical Path object.

Parameters
path
Returns
Result<std::filesystem::path, FileError>

Implemented in dotnamecpp::utils::PathResolver.

◆ getExtension()

virtual std::string dotnamecpp::utils::IPathResolver::getExtension ( const std::filesystem::path & path) const
nodiscardpure virtual

Get the Extension object.

Parameters
path
Returns
std::string

Implemented in dotnamecpp::utils::PathResolver.

◆ getFilename()

virtual std::string dotnamecpp::utils::IPathResolver::getFilename ( const std::filesystem::path & path) const
nodiscardpure virtual

Get the Filename object.

Parameters
path
Returns
std::string

Implemented in dotnamecpp::utils::PathResolver.

◆ getParent()

virtual std::filesystem::path dotnamecpp::utils::IPathResolver::getParent ( const std::filesystem::path & path) const
nodiscardpure virtual

Get the Parent object.

Parameters
path
Returns
std::filesystem::path

Implemented in dotnamecpp::utils::PathResolver.

◆ getRelativePath()

virtual Result< std::filesystem::path, FileError > dotnamecpp::utils::IPathResolver::getRelativePath ( const std::filesystem::path & target,
const std::filesystem::path & base = std::filesystem::current_path() ) const
nodiscardpure virtual

Get the Relative Path object.

Parameters
target
base
Returns
Result<std::filesystem::path, FileError>

Implemented in dotnamecpp::utils::PathResolver.

◆ getStem()

virtual std::string dotnamecpp::utils::IPathResolver::getStem ( const std::filesystem::path & path) const
nodiscardpure virtual

Get the Stem object.

Parameters
path
Returns
std::string

Implemented in dotnamecpp::utils::PathResolver.

◆ isAbsolute()

virtual bool dotnamecpp::utils::IPathResolver::isAbsolute ( const std::filesystem::path & path) const
nodiscardpure virtual

Check if path is absolute.

Parameters
path
Returns
true
false

Implemented in dotnamecpp::utils::PathResolver.

◆ isRelative()

virtual bool dotnamecpp::utils::IPathResolver::isRelative ( const std::filesystem::path & path) const
nodiscardpure virtual

Check if path is relative.

Parameters
path
Returns
true
false

Implemented in dotnamecpp::utils::PathResolver.

◆ join()

virtual std::filesystem::path dotnamecpp::utils::IPathResolver::join ( const std::vector< std::string > & parts) const
nodiscardpure virtual

Join multiple path components.

Parameters
parts
Returns
std::filesystem::path

Implemented in dotnamecpp::utils::PathResolver.


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