ADTF  v2.14.3
cFilename Class Reference

File name class. More...

Inheritance diagram for cFilename:

Public Member Functions

 cFilename ()
 Constructor that initializes an empty cFilename object.
 
 cFilename (const cFilename &oFilename)
 Constructor that initializes the object with an existing cFilename object. More...
 
 cFilename (const cString &strString)
 Constructor that initializes the filename with an existing cString object. More...
 
 cFilename (const tChar *pString)
 Constructor that initializes the filename with a null-terminated string. More...
 
 cFilename (char cChar)
 Constructor that initializes the filename with a single character. More...
 
virtual ~cFilename ()
 Destructor.
 
cFilenameoperator= (tChar cChar)
 assigns a given string More...
 
cFilenameoperator= (const tChar *pString)
 assigns a given string More...
 
cFilenameoperator= (const cString &sString)
 assigns a given string More...
 
cFilename GetRoot () const
 This function extract the root component of a filename (without double point). More...
 
cFilename GetPath () const
 This function extract the path of the parent folder and/or the root component of a file/folder. More...
 
cString GetName () const
 This function extracts the name component of a filename. More...
 
cString GetNameWithoutExtension () const
 This function extract the name component of a filename. More...
 
cString GetExtension () const
 This function extract the extension of a filename. More...
 
cString GetDrive () const
 This function extracts the drive name of a filename (e.g. More...
 
tChar GetDriveLetter () const
 
void SetExtension (const cString &strExtension)
 This function changes the extension of a filename. More...
 
void AppendTrailingSlash ()
 This function appends a trailing slash to the filename if there isn't one, yet.
 
void RemoveTrailingSlash ()
 This function removes a trailing slash from the filename if there is one.
 
void MakeNativeSlashes ()
 This function changes all slashes to OS specific slashes.
 
void MakeBackwardSlashes ()
 This function changes all forward slashes to backslashes.
 
void MakeForwardSlashes ()
 This function changes all backslashes to forward slashes.
 
cFilename CreateRelativePath (const cFilename &strParent) const
 This function creates a relative path for this file regarding the given parent (Only works with native slashes!). More...
 
cFilename CreateAbsolutePath (const cFilename &strParent) const
 This function creates an absolute path for this file regarding the given parent (Only works with native slashes!). More...
 
tBool IsRelative () const
 This function checks the filename if it is relative. More...
 
tBool IsAbsolute () const
 This function checks the filename if it is absolute. More...
 
const cFilenameAppendPath (const cFilename &strPath)
 Append a path string to current string. More...
 
tVoid CleanPath ()
 This function resolves relative components ("." or "..") within an absolute path. More...
 
tVoid SplitPath (cStringList &List) const
 Split path into a string list. More...
 
 cFilename (const std::string &strString))
 Constructor that initializes the filename with an existing string object. More...
 
cFilenameoperator= (const std::string &sString))
 assigns a given string More...
 
- Public Member Functions inherited from cString
 cString ()
 Constructor that initializes an empty cString object.
 
 cString (const tChar *pString)
 Constructor that initializes the string with a null-terminated string. More...
 
 cString (const tChar *pString, tSize nCount)
 Constructor that initializes the object with characters from a string. More...
 
 cString (tChar cChar)
 Constructor that initializes the string with a single character. More...
 
 cString (const cString &strString)
 Constructor that initializes the string with an existing string object. More...
 
virtual ~cString ()
 Destructor.
 
OPT_INLINE void Clear ()
 Makes this cString object an empty string and frees memory as appropriate.
 
OPT_INLINE cStringSet (const cString &strString, tInt nLength=-1)
 Assigns a new value to a cString object. More...
 
OPT_INLINE cStringSet (const tChar *pString, tInt nLength=-1)
 Assigns a new value to a cString object. More...
 
OPT_INLINE cStringSet (tChar c, tInt nLength=1)
 Assigns a new value to a cString object. More...
 
OPT_INLINE tInt GetLength () const
 This function returns the number of characters in a cString object. More...
 
tBool SetBuffer (tInt nLength)
 Sets or resizes the internal string buffer. More...
 
tInt GetBufferSize ()
 Get the size of the internal allocated string buffer. More...
 
tChar GetAt (tInt nIdx) const
 You can think of a cString object as an array of characters. More...
 
void SetAt (tInt nIdx, tChar c)
 The SetAt member function sets a single character at a specified position. More...
 
const tCharoperator[] (tUInt nIdx) const
 array access operator More...
 
tCharoperator[] (tUInt nIdx)
 array access operator More...
 
OPT_INLINE tBool IsEmpty () const
 This function checks if the string object is empty. More...
 
OPT_INLINE tBool IsNotEmpty () const
 This function checks if the string object is not empty. More...
 
const tCharGetPtr () const
 This function returns the current string as a array of characters (c-style) More...
 
const cStringAppend (const cString &strString)
 This function appends a string to the end of the cString object. More...
 
const cStringAppend (tChar c)
 This function appends one character to the end of the cString object. More...
 
const cStringDelete (tInt nPos, tInt nLength=-1)
 This function deletes a substring of length nLength characters from the cString object, starting at position nPos (zero-based). More...
 
const cStringInsert (const cString &strString, tInt nPos, tInt nLength=-1)
 This function inserts a string into the cString object. More...
 
const cStringInsert (const tChar *pString, tInt nPos, tInt nLength=-1)
 This function inserts a string into the cString object. More...
 
OPT_INLINE tInt Compare (const cString &strString) const
 This function compares a cString object with another string using the generic-text function _tcscmp. More...
 
OPT_INLINE tInt Compare (const cString &strString, tInt nPos, tInt nLength=-1) const
 This function compares a cString object with another string using the generic-text function _tcscmp. More...
 
OPT_INLINE tInt CompareNoCase (const cString &strString) const
 This function compares a cString object with another string using the generic-text function _tcsicmp. More...
 
OPT_INLINE tInt CompareNoCase (const cString &strString, tInt nPos, tInt nLength=-1) const
 This function compares a cString object with another string using the generic-text function _tcsicmp. More...
 
OPT_INLINE tBool IsEqual (const cString &strCmp) const
 This function checks if the two strings are equal (case sensitive) More...
 
OPT_INLINE tBool IsEqual (const cString &strCmp, tInt nPos, tInt nLength=-1) const
 This function checks if the two strings are equal (case sensitive) More...
 
OPT_INLINE tBool IsEqualNoCase (const cString &strCmp) const
 This function checks if the two strings are equal (case insensitive) More...
 
OPT_INLINE tBool IsEqualNoCase (const cString &strCmp, tInt nPos, tInt nLength=-1) const
 This function checks if the two strings are equal (case insensitive) More...
 
OPT_INLINE tBool IsNotEqual (const cString &strCmp) const
 This function checks if the two strings are not equal (case sensitive) More...
 
OPT_INLINE tBool IsNotEqual (const cString &strCmp, tInt nPos, tInt nLength=-1) const
 This function checks if the two strings are not equal (case sensitive) More...
 
OPT_INLINE tBool IsNotEqualNoCase (const cString &strCmp) const
 This function checks if the two strings are not equal (case insensitive) More...
 
OPT_INLINE tBool IsNotEqualNoCase (const cString &strCmp, tInt nPos, tInt nLength=-1) const
 This function checks if the two strings are not equal (case insensitive) *. More...
 
tInt Find (const cString &strString, tInt nStart=0, tBool bNoCase=tFalse) const
 This function searches the cString object for the first match of a substring. More...
 
tInt Find (const tChar cChar, tInt nStart=0) const
 This function searches the cString object for the first match of the specified character. More...
 
tInt RFind (const tChar cChar, tInt nStart=-1) const
 This function searches the cString object for the last match of the specified character. More...
 
tInt FindToken (const cString &strTokenList, tInt nStart=0) const
 This function searches a string for the first character that matches any character contained in a token list. More...
 
tInt FindNotToken (const cString &strTokenList, tInt nStart=0) const
 This function searches a string for the first character that matches none of the characters contained in a token list. More...
 
tInt CountString (const cString &strFind, tInt nStart=0) const
 This counts the occurrences of a given substring in a string. More...
 
tInt Replace (const cString &strOld, const cString &strNew, tBool bReplaceAll=true)
 This function replaces one substring by another. More...
 
tInt Replace (tChar cOld, tChar cNew, tBool bReplaceAll=true)
 This function replaces one character by another. More...
 
tInt Filter (tChar cChar)
 This function removes all occurrences of a given character from a string. More...
 
tInt Filter (const cString &strCharList)
 This function removes all occurrences of each character given in a token list. More...
 
tBool StartsWith (const cString &strString, const tBool bNoCase=tFalse) const
 This function checks if the string starts with a given prefix. More...
 
tBool EndsWith (const cString &strString, const tBool bNoCase=tFalse) const
 This function checks if the string ends with a given postfix. More...
 
OPT_INLINE operator const tChar * () const
 This useful casting operator provides an efficient method to access the null- terminated C string contained in a cString object. More...
 
cStringoperator= (tChar cChar)
 The cString assignment (=) operator reinitializes an existing cString object with new data. More...
 
cStringoperator= (const tChar *pString)
 The cString assignment (=) operator reinitializes an existing cString object with new data. More...
 
cStringoperator= (const cString &strString)
 The cString assignment (=) operator reinitializes an existing cString object with new data. More...
 
const cStringoperator+= (const cString &strString)
 The += concatenation operator joins characters to the end of this string. More...
 
tBool operator== (const tChar *pString) const
 Checks if a strings equals the cString object. More...
 
tBool operator!= (const tChar *pString) const
 Checks if a strings not equals the cString object. More...
 
tBool operator< (const tChar *pString) const
 Checks if a strings is lexicographically greater than the cString object. More...
 
tBool operator> (const tChar *pString) const
 Checks if a strings is lexicographically smaller than the cString object. More...
 
tBool operator<= (const tChar *pString) const
 Checks if a strings is lexicographically greater than or equal to the cString object. More...
 
tBool operator>= (const tChar *pString) const
 Checks if a strings is lexicographically smaller than or equal to the cString object. More...
 
tBool operator== (const cString &strString) const
 Checks if a strings equals the cString object. More...
 
tBool operator!= (const cString &strString) const
 Checks if a strings not equals the cString object. More...
 
tBool operator< (const cString &strString) const
 Checks if a strings is lexicographically greater than the cString object. More...
 
tBool operator> (const cString &strString) const
 Checks if a strings is lexicographically smaller than the cString object. More...
 
tBool operator<= (const cString &strString) const
 Checks if a strings is lexicographically greater than or equal to the cString object. More...
 
tBool operator>= (const cString &strString) const
 Checks if a strings is lexicographically smaller than or equal to the cString object. More...
 
cString Mid (tInt nPos, tInt nLength=-1) const
 This function extracts a substring of length nLength characters from the cString object, starting at position nPos (zero-based). More...
 
cString Left (tInt nLength) const
 Extracts the first (that is, leftmost) nLength characters from the cString object and returns a copy of the extracted substring. More...
 
cString Right (tInt nLength) const
 Extracts the last (that is, rightmost) nLength characters from the cString object and returns a copy of the extracted substring. More...
 
void Split (cStringList &List, tChar cToken) const
 This function splits up a single cString object into several parts using a token character. More...
 
void Split (cStringList &List, const cString &strToken) const
 This function splits up a single cString object into several parts using a token string. More...
 
void SplitToken (cStringList &List, const cString &sTokenList) const
 Split string using a token list. More...
 
void Trim ()
 This function removes leading and trailing whitespace characters from a cString object.
 
void LeftTrim ()
 This function removes leading whitespace characters from a cString object.
 
void RightTrim ()
 This function removes trailing whitespace characters from a cString object.
 
void NumTrim ()
 This function removes whitespace and redundant zero characters from a cString object. More...
 
void DropQuotes ()
 This function removes quotes from a cString object. More...
 
void ToLower ()
 This function converts a cString object to a lowercase string. More...
 
void ToUpper ()
 This function converts a cString object to a uppercase string. More...
 
tBool IsInteger () const
 Check if string content represents an integer value. More...
 
tBool IsFloat () const
 Check if string content represents a floating point value. More...
 
cStringEscape ()
 Escape control characters. More...
 
cStringUnescape ()
 Unescape control characters. More...
 
int AsInt () const
 This function converts the string to an integer value. More...
 
tInt32 AsInt32 () const
 This function converts the string to an integer value. More...
 
tUInt32 AsUInt32 () const
 This function converts the string to an integer value. More...
 
tInt64 AsInt64 () const
 This function converts the string to an integer value. More...
 
tUInt64 AsUInt64 () const
 This function converts the string to an integer value. More...
 
tFloat64 AsFloat64 () const
 This function converts the string to a floating-point value. More...
 
tBool AsBool () const
 This function converts the string to a boolean value. More...
 
tInt HexToInt () const
 This function converts a hexadecimal string representation to an integer value. More...
 
tInt64 HexToInt64 () const
 This function converts a hexadecimal string representation to an integer value. More...
 
const tCharc_str () const )
 Use GetPtr() instead.
 
 cString (const std::string &strString))
 Pass std::string::c_str() instead.
 
std::string & AsStdString ())
 Use GetPtr() instead.
 
const std::string & AsStdString () const )
 Use GetPtr() instead.
 
const tChardata () const )
 Use GetPtr() instead.
 
size_t size () const )
 Use GetLength() instead.
 
size_t length () const )
 Use GetLength() instead.
 
void clear ())
 Use Clear() instead.
 
bool empty () const )
 Use IsEmpty() instead.
 
std::string & append (const std::string &str))
 Use Append() instead.
 
std::string & append (const char *s))
 Use Append() instead.
 
std::string & append (const cString &str))
 Use Append() instead.
 
std::string & assign (const char *s, size_t n))
 Use Set() instead.
 
size_t find (const std::string &str, size_t pos=0) const )
 Use Find() instead.
 
size_t find (const char *s, size_t pos=0) const )
 Use Find() instead.
 
size_t find (char c, size_t pos=0) const )
 Use Find() instead.
 
size_t find (const cString &str, size_t pos=0) const )
 Use Find() instead.
 
size_t rfind (const std::string &str, size_t pos=std::string::npos) const )
 Use RFind() instead.
 
size_t rfind (char c, size_t pos=std::string::npos) const )
 Use RFind() instead.
 
size_t find_first_of (const std::string &str, size_t pos=0) const )
 Use FindToken() instead.
 
size_t find_first_of (char c, size_t pos=0) const )
 Use FindToken() instead.
 
size_t find_last_of (const std::string &str, size_t pos=std::string::npos) const )
 No replacement.
 
size_t find_last_of (char c, size_t pos=std::string::npos) const )
 No replacement.
 
size_t find_first_not_of (const std::string &str, size_t pos=0) const )
 Use FindNotToken() instead.
 
size_t find_first_not_of (char c, size_t pos=0) const )
 Use FindNotToken() instead.
 
size_t find_last_not_of (const std::string &str, size_t pos=std::string::npos) const )
 No replacement.
 
size_t find_last_not_of (char c, size_t pos=std::string::npos) const )
 No replacement.
 
std::string substr (size_t pos=0, size_t len=std::string::npos) const )
 Use Mid() instead.
 
int compare (const std::string &str) const )
 Use Compare() instead.
 
int compare (const cString &str) const )
 Use Compare() instead.
 
int compare (const char *s) const )
 Use Compare() instead.
 

Static Public Member Functions

static cFilename JoinPath (const cFilename &strPath1, const cFilename &strPath2)
 This function joins two subpaths (strPath1 and strPath2) to a new one. More...
 
static tBool IsSlash (tChar c)
 This function checks if a character is a slash. More...
 
- Static Public Member Functions inherited from cString
static tInt GetLength (const tChar *pcStr)
 This function returns the number of characters in a char string object. More...
 
static tInt Compare (const tChar *str1, const tChar *str2, tInt nLength=-1)
 This function compares two given strings using the generic-text function _tcscmp. More...
 
static tInt Compare (const std::string &str1, const std::string &str2, tInt nLength=-1)
 This function compares two given strings using the generic-text function _tcscmp. More...
 
static tInt CompareNoCase (const tChar *str1, const tChar *str2, tInt nLength=-1)
 This function compares a cString object with another string using the generic-text function _tcsicmp. More...
 
static tInt CompareNoCase (const std::string &str1, const std::string &str2, tInt nLength=-1)
 This function compares a cString object with another string using the generic-text function _tcsicmp. More...
 
static tBool IsEqual (const tChar *str1, const tChar *str2)
 This function checks if the two strings are equal (case sensitive) More...
 
static tBool IsEqual (const std::string &str1, const std::string &str2)
 This function checks if the two strings are equal (case sensitive) More...
 
static tBool IsEqualNoCase (const tChar *str1, const tChar *str2)
 This function checks if the two strings are equal (case insensitive) More...
 
static tBool IsEqualNoCase (const std::string &str1, const std::string &str2)
 This function checks if the two strings are equal (case insensitive) More...
 
static tBool IsNotEqual (const tChar *str1, const tChar *str2)
 This function checks if the two strings are not equal (case sensitive) More...
 
static tBool IsNotEqual (const std::string &str1, const std::string &str2)
 This function checks if the two strings are not equal (case sensitive) More...
 
static tBool IsNotEqualNoCase (const tChar *str1, const tChar *str2)
 This function checks if the two strings are not equal (case insensitive) More...
 
static tBool IsNotEqualNoCase (const std::string &str1, const std::string &str2)
 This function checks if the two strings are not equal (case insensitive) More...
 
static tBool IsWhiteChar (tChar c)
 This function checks if a given tChar value is a whitespace character. More...
 
static tBool IsSymbolChar (tChar c)
 This function checks if a given tChar value is valid to be used in a symbol name. More...
 
static tBool IsNumber (tChar c)
 This function checks if a tChar is a number. More...
 
static cString Repeat (tChar c, tInt nCount)
 This function creates a new cString object by repeating one single character. More...
 
static cString FromInt32 (tInt32 nValue, const cString &strFormat=Empty)
 This function creates a new cString object from a numeric value. More...
 
static cString FromUInt32 (tUInt32 nValue, const cString &strFormat=Empty)
 This function creates a new cString object from a numeric value. More...
 
static cString FromInt64 (tInt64 nValue, const cString &strFormat=Empty)
 This function creates a new cString object from a numeric value. More...
 
static cString FromUInt64 (tUInt64 nValue, const cString &strFormat=Empty)
 This function creates a new cString object from a numeric value. More...
 
static cString FromBool (tBool bValue)
 This function creates a new cString object from a boolean value. More...
 
static cString FromFloat64 (tFloat64 fValue, const cString &strFormat=Empty)
 This function creates a new cString object from a double value. More...
 
static cString FromInt (int nValue, const cString &strFormat=Empty)
 This function creates a new cString object from a numeric value. More...
 
static cString Format (const tChar *strFormat,...)
 Write formatted data to a string. More...
 
static tCharCopy (tChar *pstrDestination, const tChar *pstrSource, tInt nCount=-1, tInt nDestinationBufferSize=-1)
 Copies a null terminated string to another string buffer. More...
 
static cString Copy (cString &strDestination, const cString &strSource, tInt nCount=-1)
 Copies the value of one cString object to another cString object. More...
 
static tInt Scan (const tChar *sSource, const tChar *sFormat,...)
 This function reads data from the input string and writes the data into the location(s) given by arguments. More...
 

Static Public Attributes

static const tChar WINDOWS_SLASH
 the windows slash is '\'
 
static const tChar UNIX_SLASH
 the unis slash is '/'
 
static const tCharWINDOWS_DOUBLE_SLASH
 the windows slash is "\\\\"
 
static const tCharUNIX_DOUBLE_SLASH
 the unis slash is "//"
 
static const tChar NATIVE_SLASH
 the native slash of the system will be defined
 
static const tChar ALTERNATIVE_SLASH
 the alternative slash will be defined (is the counterpart of NATIVE_DOUBLE_SLASH)
 
static const tCharNATIVE_DOUBLE_SLASH
 the native double slash of the system will be defined
 
static const tCharALTERNATIVE_DOUBLE_SLASH
 the alternative double slash will be defined (is the counterpart of NATIVE_DOUBLE_SLASH)
 
static const cFilename Empty
 
- Static Public Attributes inherited from cString
static const cString Empty
 Internally used empty string.
 
static const std::string::size_type npos
 string position More...
 

Additional Inherited Members

- Public Types inherited from cString
typedef std::string::value_type value_type
 type of string
 
typedef std::string::size_type size_type
 size of string
 
- Protected Member Functions inherited from cString
void TrimFunc (tBool bLeft, tBool bRight, tBool bNumeric)
 This function trims the string. More...
 
- Static Protected Member Functions inherited from cString
static cString IntToStr (int n)
 Convert integer to string. More...
 
static cString Int64ToStr (tInt64 n)
 Convert 64-bit integer to string. More...
 
static cString UInt64ToStr (tUInt64 ui64Value)
 Convert 64-bit unsigned integer to string. More...
 
- Static Protected Attributes inherited from cString
static const tCharm_pcSafeBuffer
 Internally used character buffer.
 

Detailed Description

File name class.

General naming conventions
Name Description
root Using windows this is a drive letter i.e. "C" or \\servername Using linux this is always "/"
drive Using windows this is a drive letter i.e. "C" detected by the ":" Using linux this is alwas "/"
folder / directory A folder is a combination of several names separated by the native slash If the last element of this combination is a filename with extension it is called a path. i.e. C:\temp\myfolder\ \etc\bin\
name The name and the extension of a filename. The last part of a filename which is detected by the last native slash i.e. C:\temp\myfolder -> myfolder C:\temp\myfolder\myfile.txt -> myfile.txt /etc/bin/bla.txt -> bla.txt
extension The last part of a filename detected by a "."
path The combination of root + folder + name

Definition at line 60 of file filename.h.

Constructor & Destructor Documentation

cFilename ( const cFilename oFilename)

Constructor that initializes the object with an existing cFilename object.

Parameters
oFilename[in] An existing cFilename object to be copied into this cFilename object.
cFilename ( const cString strString)

Constructor that initializes the filename with an existing cString object.

Parameters
strString[in] An existing cString object to be copied into this cFilename object.
cFilename ( const tChar pString)

Constructor that initializes the filename with a null-terminated string.

Parameters
pString[in] A null-terminated string to be copied into this cFilename object.
cFilename ( char  cChar)

Constructor that initializes the filename with a single character.

Parameters
cChar[in] A single character.
cFilename ( const std::string &  strString)

Constructor that initializes the filename with an existing string object.

Parameters
strString[in] An existing cString object to be copied into this cFilename object.

Member Function Documentation

const cFilename& AppendPath ( const cFilename strPath)

Append a path string to current string.

This function does not check if a cFilename contains a filename. I.e. C:\foo.txt -> AppendPath (bar) ==> C:\foo.txt\bar. This function uses the native slashes to concatenate the paths

Parameters
strPath[in] Path to be appended
Returns
The function returns a reference to itself containing the new contents.
tVoid CleanPath ( )

This function resolves relative components ("." or "..") within an absolute path.

It also removes slashes that follow slashes. When it is not possible to resolve all ".." elements because the root directory has already been reached then the string is cleared. If it is a relative path no modifications are performed.

Returns
void
cFilename CreateAbsolutePath ( const cFilename strParent) const

This function creates an absolute path for this file regarding the given parent (Only works with native slashes!).

The parent can also be set to "", "./" or ".". The function then uses the current directory as parent.

Parameters
strParent[in] This is taken as relation for this path to create the absolute one
Returns
Created absolute path or the unchanged one
cFilename CreateRelativePath ( const cFilename strParent) const

This function creates a relative path for this file regarding the given parent (Only works with native slashes!).

Parameters
strParent[in] This is taken as relation for this path to create the relative one
Returns
Created relative path or the unchanged one
cString GetDrive ( ) const

This function extracts the drive name of a filename (e.g.

"c:") Using linux a "/" will be returned if the filename is not empty.

Returns
A new cString object that contains the drive letter or an empty string.
tChar GetDriveLetter ( ) const
Returns
the drive letter or '0' in case there is no drive letter.
The drive letter or '0' in case there is no drive letter. Using linux a '/' will be returned if the given filename is not empty.
cString GetExtension ( ) const

This function extract the extension of a filename.

The extension is detected by a ".". If no "." is found then empty will be returned.

Returns
A new cString object that contains the extracted extension.

Referenced by LogFile::Flush().

cString GetName ( ) const

This function extracts the name component of a filename.

If the given filename is only a folder then the last folder name will be returned.

Returns
A new cString object that contains the extracted name.
cString GetNameWithoutExtension ( ) const

This function extract the name component of a filename.

No extension is appended to the name. If the given filename is a folder name then the last folder name will be returned

Returns
A new cString object that contains the extracted name.

Referenced by LogFile::Flush().

cFilename GetPath ( ) const

This function extract the path of the parent folder and/or the root component of a file/folder.

If the given filename is a folder then its parent folder will be extracted.

Returns
A new cFilename object that contains the parent folder without a trailing slash. On linux "/" is returned if root is the parent of the file/folder.

Referenced by LogFile::Flush().

cFilename GetRoot ( ) const

This function extract the root component of a filename (without double point).

Returns
A new cFilename object that contains the extracted root. Using linux a "/" will be returned if the given filename is not empty.
tBool IsAbsolute ( ) const

This function checks the filename if it is absolute.

Returns
The function returns true, if the filename is absolute and false, if it is relative or an error has occured.
This method is real-time safe.
See The ADTF Real-Time Extension.
tBool IsRelative ( ) const

This function checks the filename if it is relative.

Returns
The function returns true, if the filename is relative and false, if it is relative or an error has occured.
This method is real-time safe.
See The ADTF Real-Time Extension.
static tBool IsSlash ( tChar  c)
static

This function checks if a character is a slash.

Parameters
c[in] Character to be checked.
Returns
The function returns true, if the Character is a Shlash, and false if not.
This method is real-time safe.
See The ADTF Real-Time Extension.
static cFilename JoinPath ( const cFilename strPath1,
const cFilename strPath2 
)
static

This function joins two subpaths (strPath1 and strPath2) to a new one.

Parameters
strPath1[in] First path to be joined
strPath2[in] Second path to be joined
Returns
The function returns the new (created) Path. The concatenation uses the native Slashes of the current OS (i.e Windows "\\" and Unix "/").
cFilename& operator= ( tChar  cChar)

assigns a given string

Parameters
[in]cChargiven string containing a filename / path
Returns
Reference to current object
cFilename& operator= ( const tChar pString)

assigns a given string

Parameters
[in]pStringgiven string containing a filename / path
Returns
Reference to current object
cFilename& operator= ( const cString sString)

assigns a given string

Parameters
[in]sStringgiven string containing a filename /path
Returns
Reference to current object
cFilename& operator= ( const std::string &  sString)

assigns a given string

Parameters
[in]sStringgiven string containing a filename /path
Returns
Reference to current object
void SetExtension ( const cString strExtension)

This function changes the extension of a filename.

Parameters
strExtension[in] cString object that specifies the new extension.
tVoid SplitPath ( cStringList List) const

Split path into a string list.

This function splits up a path into several parts.

Parameters
List[inout] Reference to cStringList object that is filled. The list is cleaned first.
Returns
void

Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Fri Mar 22 2019 by doxygen 1.8.10)