ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::system::Path Class Reference

Description:

Represents a directory or file in a file system.

Inherits a local string buffer fixed to size 256. The flexible nature of ALib local strings allows dynamic allocation if this should be exceeded (which usually is not expected with paths).

The character type of this AString derivate is bound to type definition system::PathCharType, which in turn aliases std::filesystem::path::value_type.

Definition at line 156 of file path.inl.

Inheritance diagram for alib::system::Path:
[legend]
Collaboration diagram for alib::system::Path:
[legend]

Public Static Field Index:

static PathString tempDirEvaluatedOnce
 
static PathString varTempDirEvaluatedOnce
 

Public Static Method Index:

static int IsAbsolute (const PathString &path)
 

Public Method Index:

 Path ()
 
 Path (const PathString &path)
 
 Path (SystemFolders special)
 
 Path (SystemFolders special, const PathString &fileName)
 
PathAdd (const PathString &dirOrFilename)
 
ALIB_DLL void AddModuleName (const PathString &extension)
 
ALIB_DLL bool Change (const PathString &path)
 
ALIB_DLL bool Change (SystemFolders special)
 
void Change (SystemFolders special, const PathString &fileName)
 
ALIB_DLL SystemErrors Create ()
 
ALIB_DLL SystemErrors Create (const PathString &path)
 
int IsAbsolute () const
 
ALIB_DLL bool IsDirectory ()
 
ALIB_DLL SystemErrors MakeReal ()
 
PathString Name () const
 
- Public Method Index: inherited from alib::strings::TLocalString< PathCharType, 256 >
constexpr TLocalString ()
 
 TLocalString (const TAppendable &src)
 
 TLocalString (const TLocalString &copy)
 
constexpr TLocalString (lang::HeapAllocator &pAllocator)
 
 TLocalString (TLocalString &&move) noexcept
 
TLocalStringoperator= (const TAppendable &src)
 
TLocalStringoperator= (const TLocalString &copy)
 
TLocalStringoperator= (TLocalString &&move)
 
- Public Method Index: inherited from alib::strings::TAString< PathCharType, lang::HeapAllocator >
constexpr TAString ()
 Constructs an empty, nulled AString (does not allocate a buffer).
 
 TAString (const TAppendable &src)
 
 TAString (const TAString &copy)
 
constexpr TAString (lang::HeapAllocator &pAllocator)
 
 TAString (TAString &&move) noexcept
 
 ~TAString () noexcept
 Destructs an AString object. An internally allocated buffer will be deleted.
 
const_iterator begin () const
 
const_iterator end () const
 
constexpr operator T () const
 
constexpr operator T () const
 
constexpr operator T () const
 
constexpr operator T () const
 
TAStringoperator= (const TAString &copy)
 
PathCharType operator[] (integer idx) const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
void dbgCheck () const
 
void DbgDisableBufferReplacementWarning ()
 
ALIB_DLL void SetBuffer (integer newCapacity)
 
ALIB_DLL void SetBuffer (PathCharType *extBuffer, integer extBufferSize, integer extLength=0, lang::Responsibility responsibility=lang::Responsibility::KeepWithSender)
 
void EnsureRemainingCapacity (integer spaceNeeded)
 
ALIB_DLL void GrowBufferAtLeastBy (integer minimumGrowth)
 
integer Capacity () const
 
bool HasInternalBuffer () const
 
void SetNull ()
 Invokes SetBuffer(0).
 
constexpr const PathCharType * Terminate () const
 
PathCharType * VBuffer () const
 
void SetCharAt (integer idx, PathCharType c)
 
PathCharType & operator[] (integer idx)
 
PathCharType operator[] (integer idx) const
 
void SetLength (integer newLength)
 
void DetectLength ()
 
TAStringShortenTo (integer newLength)
 
TAStringAppend (const TCharSrc *src, integer srcLength)
 
TAStringAppend (const PathCharType *src, integer srcLength)
 
TAStringAppend (const TString< PathCharType > &src, integer regionStart, integer regionLength=MAX_LEN)
 
TAStringAppend (const TAppendable &src)
 
TAStringAppend (const TStringSource &src)
 
TAStringAppend (PathCharType src)
 
TAStringAppend (characters::IsCharacter auto src)
 
TAStringNewLine ()
 
TAString_ (const TAppendable &src)
 
TAString_ (const TString< PathCharType > &src, integer regionStart, integer regionLength=MAX_LEN)
 
TAStringoperator<< (const TAppendable &src)
 
TAStringoperator+= (const TAppendable &src)
 
TAString_ ()
 
TAStringReset ()
 
TAStringReset (const TAppendable &src)
 
TAStringInsertAt (const TString< PathCharType > &src, integer pos)
 
TAStringInsertChars (PathCharType c, integer qty)
 
TAStringInsertChars (PathCharType c, integer qty, integer pos)
 
TAStringDelete (integer regionStart, integer regionLength=MAX_LEN)
 
TAStringDeleteStart (integer regionLength)
 
TAStringDeleteStart (const TString< PathCharType > &deleteIfMatch)
 
TAStringDeleteEnd (integer regionLength)
 
TAStringDeleteEnd (const TString< PathCharType > &deleteIfMatch)
 
ALIB_DLL TAStringTrim (const TCString< PathCharType > &trimChars=CStringConstantsTraits< PathCharType >::DefaultWhitespaces())
 
ALIB_DLL integer TrimAt (integer idx, const TCString< PathCharType > &trimChars=CStringConstantsTraits< PathCharType >::DefaultWhitespaces())
 
TAStringTrimStart (const TCString< PathCharType > &trimChars=CStringConstantsTraits< PathCharType >::DefaultWhitespaces())
 
TAStringTrimEnd (const TCString< PathCharType > &trimChars=CStringConstantsTraits< PathCharType >::DefaultWhitespaces())
 
iterator begin ()
 
iterator end ()
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
constexpr void push_back (PathCharType ch)
 
constexpr PathCharType pop_back ()
 
TAStringReplaceSubstring (const TString< PathCharType > &src, integer regionStart, integer regionLength)
 
TAStringReplaceRegion (PathCharType c, integer regionStart, integer regionLength)
 
ALIB_DLL integer SearchAndReplace (PathCharType needle, PathCharType replacement, integer startIdx=0, integer endIdx=strings::MAX_LEN)
 
ALIB_DLL integer SearchAndReplace (const TString< PathCharType > &needle, const TString< PathCharType > &replacement, integer startIdx=0, integer maxReplacements=strings::MAX_LEN, lang::Case sensitivity=lang::Case::Sensitive, integer endIdx=strings::MAX_LEN)
 
TAStringToUpper (integer regionStart=0, integer regionLength=MAX_LEN)
 
TAStringToLower (integer regionStart=0, integer regionLength=MAX_LEN)
 
TAStringReverse (integer regionStart=0, integer regionLength=MAX_LEN)
 
const_iterator begin () const
 
const_iterator end () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
- Public Method Index: inherited from alib::strings::TString< PathCharType >
constexpr TString () noexcept=default
 
constexpr TString () noexcept=default
 
constexpr TString (const PathCharType *pBuffer, integer pLength) noexcept
 
constexpr TString (const PathCharType *pBuffer, integer pLength) noexcept
 
constexpr TString (const T &src) noexcept
 
constexpr TString (const T &src) noexcept
 
constexpr TString (const T &src) noexcept
 
constexpr TString (const T &src) noexcept
 
constexpr TString (const TString &) noexcept=default
 Defaulted copy constructor.
 
constexpr TString (const TString &) noexcept=default
 Defaulted copy constructor.
 
 TString (const_iterator &start, const_iterator &end)
 
 TString (const_iterator &start, const_iterator &end)
 
constexpr TString (lang::IsNullptr auto const &) noexcept
 Constructor accepting nullptr. Constructs a nulled string.
 
constexpr TString (lang::IsNullptr auto const &) noexcept
 Constructor accepting nullptr. Constructs a nulled string.
 
constexpr TString (T &src) noexcept
 
constexpr TString (T &src) noexcept
 
 TString (TAllocator &allocator, const TString< PathCharType > &copy)
 
 TString (TAllocator &allocator, const TString< PathCharType > &copy)
 
constexpr TString (TString &&) noexcept=default
 Defaulted move constructor.
 
constexpr TString (TString &&) noexcept=default
 Defaulted move constructor.
 
constexpr operator T () const
 
constexpr operator T () const
 
constexpr operator T () const
 
constexpr operator T () const
 
constexpr TStringoperator= (const TString &) noexcept=default
 
constexpr TStringoperator= (const TString &) noexcept=default
 
constexpr TStringoperator= (TString &&) noexcept=default
 
constexpr TStringoperator= (TString &&) noexcept=default
 
constexpr const PathCharType * Buffer () const
 
constexpr integer Length () const
 
integer WStringLength () const
 
constexpr bool IsNull () const
 
constexpr bool IsNotNull () const
 
constexpr bool IsEmpty () const
 
constexpr bool IsNotEmpty () const
 
TString< PathCharType > Substring (integer regionStart, integer regionLength=MAX_LEN) const
 
constexpr const PathCharType * Buffer () const
 
constexpr integer Length () const
 
integer WStringLength () const
 
constexpr bool IsNull () const
 
constexpr bool IsNotNull () const
 
constexpr bool IsEmpty () const
 
constexpr bool IsNotEmpty () const
 
TString< PathCharType > Substring (integer regionStart, integer regionLength=MAX_LEN) const
 
PathCharType CharAt (integer idx) const
 
PathCharType CharAtStart () const
 
PathCharType CharAtEnd () const
 
PathCharType operator[] (integer idx) const
 
PathCharType CharAt (integer idx) const
 
PathCharType CharAtStart () const
 
PathCharType CharAtEnd () const
 
PathCharType operator[] (integer idx) const
 
std::size_t Hashcode () const
 
std::size_t HashcodeIgnoreCase () const
 
std::size_t Hashcode () const
 
std::size_t HashcodeIgnoreCase () const
 
bool Equals (const TString< PathCharType > &rhs) const
 
int CompareTo (const TString< PathCharType > &rhs) const
 
int CompareTo (const TString &rhs, integer rhsRegionStart, integer rhsRegionLength=MAX_LEN) const
 
int CompareTo (const TString &rhs, integer rhsRegionStart, integer rhsRegionLength, integer regionStart, integer regionLength=MAX_LEN) const
 
bool ContainsAt (const TString &needle, integer pos) const
 
bool StartsWith (const TString &needle) const
 
bool EndsWith (const TString &needle) const
 
bool Equals (const TString< PathCharType > &rhs) const
 
int CompareTo (const TString< PathCharType > &rhs) const
 
int CompareTo (const TString &rhs, integer rhsRegionStart, integer rhsRegionLength=MAX_LEN) const
 
int CompareTo (const TString &rhs, integer rhsRegionStart, integer rhsRegionLength, integer regionStart, integer regionLength=MAX_LEN) const
 
bool ContainsAt (const TString &needle, integer pos) const
 
bool StartsWith (const TString &needle) const
 
bool EndsWith (const TString &needle) const
 
integer IndexOf (PathCharType needle, integer startIdx=0) const
 
integer IndexOf (PathCharType needle, integer regionStart, integer regionLength) const
 
integer IndexOfOrLength (PathCharType needle) const
 
integer IndexOfOrLength (PathCharType needle, integer startIdx) const
 
integer LastIndexOf (PathCharType needle, integer startIndex=MAX_LEN) const
 
integer IndexOfAny (const TString &needles, integer startIdx=0) const
 
integer LastIndexOfAny (const TString &needles, integer startIdx=MAX_LEN) const
 
integer IndexOf (const TString &needle, integer startIdx=0, integer endIdx=strings::MAX_LEN) const
 
integer IndexOfFirstDifference (const TString &needle, lang::Case sensitivity=lang::Case::Sensitive, integer startIdx=0) const
 
integer IndexOfSegmentEnd (PathCharType opener, PathCharType closer, integer idx) const
 
integer CountChar (PathCharType needle, integer startPos=0) const
 
integer CountChar (PathCharType needle, PathCharType omit, integer startPos) const
 
integer Count (const TString &needle, integer startPos=0) const
 
integer Count (const TString &needle, const TString &omit, integer startPos=0) const
 
integer IndexOf (PathCharType needle, integer startIdx=0) const
 
integer IndexOf (PathCharType needle, integer regionStart, integer regionLength) const
 
integer IndexOf (const TString &needle, integer startIdx=0, integer endIdx=strings::MAX_LEN) const
 
integer IndexOfOrLength (PathCharType needle) const
 
integer IndexOfOrLength (PathCharType needle, integer startIdx) const
 
integer LastIndexOf (PathCharType needle, integer startIndex=MAX_LEN) const
 
integer IndexOfAny (const TString &needles, integer startIdx=0) const
 
integer LastIndexOfAny (const TString &needles, integer startIdx=MAX_LEN) const
 
integer IndexOfFirstDifference (const TString &needle, lang::Case sensitivity=lang::Case::Sensitive, integer startIdx=0) const
 
integer IndexOfSegmentEnd (PathCharType opener, PathCharType closer, integer idx) const
 
integer CountChar (PathCharType needle, integer startPos=0) const
 
integer CountChar (PathCharType needle, PathCharType omit, integer startPos) const
 
integer Count (const TString &needle, integer startPos=0) const
 
integer Count (const TString &needle, const TString &omit, integer startPos=0) const
 
ALIB_DLL uint64_t ParseDecDigits (integer startIdx=0, integer *newIdx=nullptr) const
 
ALIB_DLL int64_t ParseInt (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
int64_t ParseInt (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
int64_t ParseInt (integer *newIdx) const
 
int64_t ParseInt (integer startIdx, integer *newIdx) const
 
ALIB_DLL uint64_t ParseDec (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
uint64_t ParseDec (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
uint64_t ParseDec (integer *newIdx) const
 
uint64_t ParseDec (integer startIdx, integer *newIdx) const
 
ALIB_DLL uint64_t ParseBin (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
uint64_t ParseBin (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
uint64_t ParseBin (integer *newIdx) const
 
uint64_t ParseBin (integer startIdx, integer *newIdx) const
 
ALIB_DLL uint64_t ParseHex (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
uint64_t ParseHex (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
uint64_t ParseHex (integer *newIdx) const
 
uint64_t ParseHex (integer startIdx, integer *newIdx) const
 
ALIB_DLL uint64_t ParseOct (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
uint64_t ParseOct (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
uint64_t ParseOct (integer *newIdx) const
 
uint64_t ParseOct (integer startIdx, integer *newIdx) const
 
ALIB_DLL double ParseFloat (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
double ParseFloat (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
double ParseFloat (integer *newIdx) const
 
double ParseFloat (integer startIdx, integer *newIdx) const
 
ALIB_DLL uint64_t ParseDecDigits (integer startIdx=0, integer *newIdx=nullptr) const
 
ALIB_DLL int64_t ParseInt (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
int64_t ParseInt (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
int64_t ParseInt (integer *newIdx) const
 
int64_t ParseInt (integer startIdx, integer *newIdx) const
 
ALIB_DLL uint64_t ParseDec (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
uint64_t ParseDec (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
uint64_t ParseDec (integer *newIdx) const
 
uint64_t ParseDec (integer startIdx, integer *newIdx) const
 
ALIB_DLL uint64_t ParseBin (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
uint64_t ParseBin (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
uint64_t ParseBin (integer *newIdx) const
 
uint64_t ParseBin (integer startIdx, integer *newIdx) const
 
ALIB_DLL uint64_t ParseHex (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
uint64_t ParseHex (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
uint64_t ParseHex (integer *newIdx) const
 
uint64_t ParseHex (integer startIdx, integer *newIdx) const
 
ALIB_DLL uint64_t ParseOct (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
uint64_t ParseOct (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
uint64_t ParseOct (integer *newIdx) const
 
uint64_t ParseOct (integer startIdx, integer *newIdx) const
 
ALIB_DLL double ParseFloat (integer startIdx=0, TNumberFormat< PathCharType > *numberFormat=nullptr, integer *newIdx=nullptr) const
 
double ParseFloat (TNumberFormat< PathCharType > *numberFormat, integer *newIdx=nullptr) const
 
double ParseFloat (integer *newIdx) const
 
double ParseFloat (integer startIdx, integer *newIdx) const
 
integer CopyTo (PathCharType *dest) const
 
void Allocate (TAllocator &allocator, const TString< PathCharType > &copy)
 
void Free (TAllocator &allocator)
 
integer CopyTo (PathCharType *dest) const
 
void Allocate (TAllocator &allocator, const TString< PathCharType > &copy)
 
void Free (TAllocator &allocator)
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator end () const
 
const_iterator cend () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
size_type size () const
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator end () const
 
const_iterator cend () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
size_type size () const
 
bool AdjustRegion (integer &regionStart, integer &regionLength) const
 
bool AdjustRegion (integer &regionStart, integer &regionLength) const
 
- Public Method Index: inherited from alib::lang::AllocatorMember< lang::HeapAllocator >
 AllocatorMember ()=delete
 Deleted default constructor. (The allocator has to be given with construction)
 
 AllocatorMember (lang::HeapAllocator &pAllocator) noexcept
 
AllocatorInterface< lang::HeapAllocatorAI () const noexcept
 
lang::HeapAllocatorGetAllocator () const noexcept
 

Additional Inherited Members

- Public Type Index: inherited from alib::strings::TAString< PathCharType, lang::HeapAllocator >
using AllocatorType
 Exposes the allocator type specified by template parameter TAllocator.
 
using iterator
 
using reverse_iterator
 Same as iterator, but working from the end to the start of the string.
 
- Public Type Index: inherited from alib::strings::TString< PathCharType >
using size_type
 The type defining sizes of strings.
 
using value_type
 Exposes template parameter TChar to the outer world in a std compatible way.
 
using const_iterator
 
using const_reverse_iterator
 
- Public Type Index: inherited from alib::lang::AllocatorMember< lang::HeapAllocator >
using AllocatorType
 Exposes the allocator type.
 
- Protected Type Index: inherited from alib::strings::TLocalString< PathCharType, 256 >
using base
 The base AString-type.
 
using sBase
 The base String-type.
 
- Protected Type Index: inherited from alib::strings::TAString< PathCharType, lang::HeapAllocator >
using allocBase
 The allocator type that TAllocator specifies.
 
using base
 The base string-type.
 
- Protected Field Index: inherited from alib::strings::TLocalString< PathCharType, 256 >
PathCharType localBuffer [TCapacity]
 
- Protected Field Index: inherited from alib::strings::TAString< PathCharType, lang::HeapAllocator >
integer capacity
 
bool dbgWarnWhenExternalBufferIsReplaced
 
integer debugLastAllocRequest
 
- Protected Field Index: inherited from alib::strings::TString< PathCharType >
const PathCharType * buffer
 
const PathCharType * buffer
 
integer length
 
integer length
 
- Protected Field Index: inherited from alib::lang::AllocatorMember< lang::HeapAllocator >
lang::HeapAllocatorallocator
 A reference to the allocator.
 
- Protected Method Index: inherited from alib::strings::TAString< PathCharType, lang::HeapAllocator >
constexpr TAString (lang::HeapAllocator &pAllocator, PathCharType *extBuffer, integer extBufferSize)
 
constexpr TAString (PathCharType *extBuffer, integer extBufferSize)
 
- Protected Method Index: inherited from alib::strings::TString< PathCharType >
ALIB_DLL integer indexOfString (const TString &needle, integer startIdx, integer endIdx) const
 
ALIB_DLL integer indexOfString (const TString &needle, integer startIdx, integer endIdx) const
 

Field Details:

◆ tempDirEvaluatedOnce

PathString alib::system::Path::tempDirEvaluatedOnce
static

Singleton containing the path for the use of enum value SystemFolders::Temp. This is evaluated once with the first use of SystemFolders::Temp. To change the default behavior of evaluation, this variable may be filled with a proper path before using enum SystemFolders::Temp with this class.

The one-time evaluated value is stored in the GLOBAL_ALLOCATOR and access to this variable is consequently protected with GLOBAL_ALLOCATOR_LOCK.

Definition at line 170 of file path.inl.

◆ varTempDirEvaluatedOnce

PathString alib::system::Path::varTempDirEvaluatedOnce
static

Singleton containing the path for the use of enum value SystemFolders::VarTemp". This is evaluated once with the first use of \b %SystemFolders::VarTemp. To change the default behavior of evaluation, this variable may be filled with a proper path before using enum \b %SystemFolders::VarTemp with this class. The one-time evaluated value is stored in the \ref alib::monomem::GLOBAL_ALLOCATOR "GLOBAL_ALLOCATOR" and access to this variable is consequently protected with \ref alib::monomem::GLOBAL_ALLOCATOR_LOCK "GLOBAL_ALLOCATOR_LOCK".

Definition at line 180 of file path.inl.

Constructor(s) / Destructor Details:

◆ Path() [1/4]

alib::system::Path::Path ( )
inline

Constructs an object representing no directory. Field Path remains empty.

Definition at line 192 of file path.inl.

◆ Path() [2/4]

alib::system::Path::Path ( SystemFolders special)
inline

Constructs an object representing one of the known special directories.

Parameters
specialThe special directory to initialize this instance to.

Definition at line 199 of file path.inl.

Here is the call graph for this function:

◆ Path() [3/4]

alib::system::Path::Path ( SystemFolders special,
const PathString & fileName )
inline

Constructs an object representing one of the known special directories.

Parameters
specialThe special directory to initialize this instance to.
fileNameThe filename in folder special.

Definition at line 209 of file path.inl.

Here is the call graph for this function:

◆ Path() [4/4]

alib::system::Path::Path ( const PathString & path)
inline

Constructs an object representing the given path.

Parameters
pathThe initial path.

Definition at line 219 of file path.inl.

Here is the call graph for this function:

Method Details:

◆ Add()

Path & alib::system::Path::Add ( const PathString & dirOrFilename)
inline

Adds a directory or filename to the internal string. If the current string does not end with a DIRECTORY_SEPARATOR, one will be inserted first.

Parameters
dirOrFilenameThe path component to add.
Returns
*this to allow concatenated operations.

Definition at line 282 of file path.inl.

Here is the call graph for this function:

◆ AddModuleName()

void alib::system::Path::AddModuleName ( const PathString & extension)

Adds this processes' module name to the currently stored folder path.

Parameters
extensionAn additional extension string that is added to the evaluated file name, for example ".jpg".

Definition at line 429 of file path.cpp.

Here is the call graph for this function:

◆ Change() [1/3]

bool alib::system::Path::Change ( const PathString & path)

Changes the directory. If the given path is relative (e.g., a name of a subdirectory or ".."), such path is added to the current Path. Otherwise, this objects' path string is replaced. If the resulting destination directory is not valid, false is returned and this object is not changed.

Parameters
pathThe relative or absolute path to change to.
Returns
true if the change was successful, false otherwise.

Definition at line 444 of file path.cpp.

Here is the call graph for this function:

◆ Change() [2/3]

bool alib::system::Path::Change ( SystemFolders special)

Changes the directory to one of the known special directories.

Parameters
specialThe special directory to change this instance to.
Returns
true if the change was successful, false otherwise.

Definition at line 129 of file path.cpp.

Here is the call graph for this function:

◆ Change() [3/3]

void alib::system::Path::Change ( SystemFolders special,
const PathString & fileName )
inline

Changes the directory to one of the known special directories and adds the given fileName to this path.

Parameters
specialThe special directory to change this instance to.
fileNameThe filename within special.

Definition at line 268 of file path.inl.

Here is the call graph for this function:

◆ Create() [1/2]

ALIB_DLL SystemErrors alib::system::Path::Create ( )
inline

Creates the directory represented by this object by invoking Create(const PathString&) passing an empty String.

Returns
A value of the enum type SystemErrors.

Definition at line 242 of file path.inl.

Here is the call graph for this function:

◆ Create() [2/2]

SystemErrors alib::system::Path::Create ( const PathString & path)

Creates the directory of the given path. If a relative path is given, then it is appended to the currently stored path, otherwise the current path is replaced.

Parameters
pathZero-terminated string defining the path to test.
Returns
A value of enum type SystemErrors.

Definition at line 533 of file path.cpp.

Here is the call graph for this function:

◆ IsAbsolute() [1/2]

int alib::system::Path::IsAbsolute ( ) const
inline

Calls invokes static overload of this method, passing this object.

Returns
The result of a call to IsAbsolute(const PathString&).

Definition at line 310 of file path.inl.

Here is the call graph for this function:

◆ IsAbsolute() [2/2]

int alib::system::Path::IsAbsolute ( const PathString & path)
inlinestatic

Determines if the given string contains a path/filename with absolute addressing or not.

Attention
This method must be invoked on "real path strings" only. Assembled paths which contain redundant slashes return a false result.
Parameters
pathThe relative or absolute path to check.
Returns
0 if path is relative. If absolute, the position of the first character that does not belong to the root symbol. For example, with windows OS, if "C:\XYZ" was given, 3 is returned. With other OSes "//" is searched.

Definition at line 343 of file path.inl.

Here is the call graph for this function:

◆ IsDirectory()

bool alib::system::Path::IsDirectory ( )

Tests if this path represents an existing directory in the file system.

Returns
true if a directory was found, false if not found or the path represents a file.

Definition at line 470 of file path.cpp.

Here is the call graph for this function:

◆ MakeReal()

SystemErrors alib::system::Path::MakeReal ( )

Resolves the path by removing all symbolic links and relative addressing.

Returns
SystemErrors::OK on success, otherwise an error code.

Definition at line 500 of file path.cpp.

Here is the call graph for this function:

◆ Name()

PathString alib::system::Path::Name ( ) const
inline

Gets the name portion of the path.

Returns
A string containing the characters after the last directory separator.

Definition at line 316 of file path.inl.

Here is the call graph for this function:

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