Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::system::Path Class Reference

UNIX-LIKE Path Conversion Class. More...

#include <Path.h>

Public Member Functions

 Path (const char *unix_path) noexcept
 Path constructor.
 
 Path (const std::string_view &unix_path) noexcept
 Path constructor.
 
 Path ()=default
 
const std::string & getNativePath () const
 
const std::string & getUnixPath () const
 
bool isValid () const
 

Static Public Member Functions

static Path fromNativePath (const std::string &native_path) noexcept
 

Protected Attributes

std::string unix_path {}
 
bool valid = false
 

Detailed Description

UNIX-LIKE Path Conversion Class.

Constructor & Destructor Documentation

◆ Path() [1/3]

Path::Path ( const char * unix_path)
noexcept

Path constructor.

for Windows:
    /c/Windows -> c:/Windows
    /C/Users   -> C:/Users
    ./Dir      -> ./Dir
    Dir        -> Dir
     *  
Parameters
unix_pathUNIX-LIKE format path

◆ Path() [2/3]

Path::Path ( const std::string_view & unix_path)
noexcept

Path constructor.

for Windows:
    /c/Windows -> c:/Windows
    /C/Users   -> C:/Users
    ./Dir      -> ./Dir
    Dir        -> Dir
     *  
Parameters
unix_pathUNIX-LIKE format path

References unix_path, and valid.

◆ Path() [3/3]

sese::system::Path::Path ( )
default

Member Function Documentation

◆ fromNativePath()

Path Path::fromNativePath ( const std::string & native_path)
staticnoexcept

Convert native path to UNIX-LIKE path

Warning
No extra checks
Parameters
native_pathNative path
Returns
UNIX-LIKE path

References unix_path, and valid.

Referenced by sese::system::PathsInitiateTask::init().

◆ getNativePath()

const std::string & sese::system::Path::getNativePath ( ) const
inlinenodiscard

References unix_path.

◆ getUnixPath()

const std::string & sese::system::Path::getUnixPath ( ) const
inlinenodiscard

References unix_path.

◆ isValid()

bool sese::system::Path::isValid ( ) const
inlinenodiscard
Returns
Whether the current path is valid

References valid.

Referenced by sese::system::PathsInitiateTask::init().

Member Data Documentation

◆ unix_path

std::string sese::system::Path::unix_path {}
protected

◆ valid

bool sese::system::Path::valid = false
protected

Referenced by fromNativePath(), isValid(), and Path().


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