7 #ifndef _FILENAME_CLASS_HEADER_
8 #define _FILENAME_CLASS_HEADER_
64 static constexpr
const tChar WINDOWS_SLASH =
'\\';
66 static constexpr
const tChar UNIX_SLASH =
'/';
69 static constexpr
const tChar*
const WINDOWS_DOUBLE_SLASH =
"\\\\";
71 static constexpr
const tChar*
const UNIX_DOUBLE_SLASH =
"//";
74 static constexpr
const tChar NATIVE_SLASH = WINDOWS_SLASH;
76 static constexpr
const tChar ALTERNATIVE_SLASH = UNIX_SLASH;
79 static constexpr
const tChar*
const NATIVE_DOUBLE_SLASH = WINDOWS_DOUBLE_SLASH;
81 static constexpr
const tChar*
const ALTERNATIVE_DOUBLE_SLASH = UNIX_DOUBLE_SLASH;
84 static constexpr
const tChar NATIVE_SLASH = UNIX_SLASH;
86 static constexpr
const tChar ALTERNATIVE_SLASH = WINDOWS_SLASH;
89 static constexpr
const tChar*
const NATIVE_DOUBLE_SLASH = UNIX_DOUBLE_SLASH;
91 static constexpr
const tChar*
const ALTERNATIVE_DOUBLE_SLASH = WINDOWS_DOUBLE_SLASH;
443 using DOEXPORT cFilenameList = std::list<cFilename>;
444 using DOEXPORT cFilepathList = std::list<cFilepath>;
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
void tVoid
The tVoid is always the definition for the void (non-type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
cString GetDrive() const
This function extracts the drive name of a filename (e.g.
cFilename()
Constructor that initializes an empty cFilename object.
cFilename CreateRelativePath(const cFilename &strParent) const
This function creates a relative path for this file regarding the given parent (Only works with nativ...
cFilename & operator=(const cFilename &i_oOther)
Copy assignment operator.
tBool IsAbsolute() const
This function checks the filename if it is absolute.
cFilename & operator=(cFilename &&i_oOther)
Implements move assignment.
cFilename & MakeForwardSlashes()
This function changes all backslashes to forward slashes.
cFilename(const cString &strString)
Constructor that initializes the filename with an existing cString object.
cFilename & AppendPath(const cFilename &strPath)
Append a path string to current string.
cFilename & AppendTrailingSlash()
This function appends a trailing slash to the filename if there isn't one, yet.
cFilename(cFilename &&i_oOther)
Implements move construction.
static tBool IsSlash(tChar c)
This function checks if a character is a slash.
cFilename & operator=(tChar cChar)
assigns a given string
cFilename & MakeBackwardSlashes()
This function changes all forward slashes to backslashes.
cFilename & SetExtension(const cString &strExtension)
This function changes the extension of a filename.
tBool IsRelative() const
This function checks the filename if it is relative.
cFilename & RemoveTrailingSlash()
This function removes a trailing slash from the filename if there is one.
cFilename GetRoot() const
This function extract the root component of a filename (without double point).
cFilename(const cFilename &oFilename)
Constructor that initializes the object with an existing cFilename object.
cString GetName() const
This function extracts the name component of a filename.
tVoid SplitPath(cStringList &List) const
Split path into a string list.
cFilename & operator=(const tChar *pString)
assigns a given string
cFilename GetPath() const
This function extract the path of the parent folder and/or the root component of a file/folder.
cFilename(const tChar *pString)
Constructor that initializes the filename with a null-terminated string.
virtual ~cFilename()
Destructor.
tChar GetDriveLetter() const
cFilename & operator=(const cString &sString)
assigns a given string
cFilename CreateAbsolutePath(const cFilename &strParent) const
This function creates an absolute path for this file regarding the given parent (Only works with nati...
cString GetNameWithoutExtension() const
This function extract the name component of a filename.
static cFilename JoinPath(const cFilename &strPath1, const cFilename &strPath2)
This function joins two subpaths (strPath1 and strPath2) to a new one.
cFilename(char cChar)
Constructor that initializes the filename with a single character.
cFilename & MakeNativeSlashes()
This function changes all slashes to OS specific slashes.
cString GetExtension() const
This function extract the extension of a filename.
cFilename & CleanPath()
This function resolves relative components ("." or "..") within an absolute path.
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.