Functions to handle file path creation and modification.
Name | Description |
---|---|
AppendFileSeparator(GeoFileString &) | This will append a \ (or /) to the end of the string if one isn't already there. |
Canonicalize(const char *) | This will standardise a filename to the appropriate platform. |
Canonicalize(const Geo::GeoFileString &) | This will standardise a filename to the appropriate platform. |
CropAfterFileExtension(GeoFileString &) | This will remove the string beyond and including the last . |
CropAfterLastFileSeparator(GeoFileString &) | This will remove the string beyond and including the last file separator if there is one. |
CropBeforeFileExtension(GeoFileString &) | This will remove the string upto and including the last . |
CropBeforeLastFileSeparator(GeoFileString &) | This will remove the string up to and including the last file separator if there is one. |
ExtractArguments(GeoFileString, GeoArray< GeoFileString >) | This function breaks arguments up into tokens and handles filenames with spaces by using quotes. |
ExtractDirectories(const GeoFileString &, GeoFileString) | Splits a given path into an array of directory names. |
GetApplicationPath() | Returns the path to the application being executed. May not be available outside Windows platform. |
GetCurrentPath() | Returns the current working folder. May not be available outside Windows platform. |
GetDirectoryName(const GeoFileString &) | This will remove the string beyond and including the last file separator if there is one. |
GetDriveName(const GeoFileString &) | Extracts the drive letter of a given path. Valid only on platforms with multiple filesystem roots. |
GetEnvString(const char *) | Retrieves the value of an Environment variable. May not be available outside Windows platform. |
GetFileName(const GeoFileString &) | This will remove the string before and including the last file separator if there is one. |
GetFileNameWithoutExtension(const GeoFileString &) | This will remove the string before and including the last file separator if there is one. |
GetSandboxDataPath() | Returns the path to the application's data path, for platforms that provide application sandboxes. |
GetTemporaryPath() | Returns the temporary folder (e.g. C:\Windows\Temp). May not be available outside Windows platform. |
GetWindowsPath() | Returns the path to the Windows folder. Not available outside Windows platform. |
IsAbsoluteFilePath(const char *) | Returns the true if file string is an absolute path to a file, and false if it is relative. |
MakePathRelative(GeoFileString &, const GeoFileString &) | Make path relative wrt. |
NormalizeFileSeparators(GeoFileString &, char) | This will normalize file separators to the system default, or the given slash character if provided. |
RemoveTrailingFileSeparators(GeoFileString &) | This will remove \ (or /) characters from the end of the string if present. |
SetSandboxDataPath(const char *) | Sets the path to the application's data path, for platforms that provide application sandboxes. |
public: bool AppendFileSeparator
(
GeoFileString & path
)
This will append a \ (or /) to the end of the string if one isn't already there.
public: GeoFileString Canonicalize
(
const char * in
)
This will standardise a filename to the appropriate platform.
public: GeoFileString Canonicalize
(
const Geo::GeoFileString & in
)
This will standardise a filename to the appropriate platform.
public: bool CropAfterFileExtension
(
GeoFileString & path
)
This will remove the string beyond and including the last .
if there is one. If there isn't one it won't do anything.
True if the string was cropped.
public: bool CropAfterLastFileSeparator
(
GeoFileString & path
)
This will remove the string beyond and including the last file separator if there is one.
If there isn't one it won't do anything.
True if the string was cropped.
public: bool CropBeforeFileExtension
(
GeoFileString & path
)
This will remove the string upto and including the last .
if there is one. If there isn't one it won't do anything.
True if the string was cropped.
public: bool CropBeforeLastFileSeparator
(
GeoFileString & path
)
This will remove the string up to and including the last file separator if there is one.
If there isn't one it won't do anything.
True if the string was cropped.
public: GeoArray< GeoFileString > ExtractArguments
(
GeoFileString commandlineParams,
GeoArray< GeoFileString > argArray
)
This function breaks arguments up into tokens and handles filenames with spaces by using quotes.
public: Geo::s32 ExtractDirectories
(
const GeoFileString & path,
GeoFileString dirs
)
Splits a given path into an array of directory names.
[in] | path | The path to split. |
[inout] | dirs | The resulting directory names. The final filename section is discarded. |
The number of entries in the dirs array.
This function is extremely dangerous as it makes no attempt to range check before adding to the dirs array. As a consequence, if the dirs array is too short, it will trash memory. The function should be modified to add a maxDirs parameter. |
public: GeoFileString GetApplicationPath()
Returns the path to the application being executed. May not be available outside Windows platform.
public: GeoFileString GetCurrentPath()
Returns the current working folder. May not be available outside Windows platform.
public: GeoFileString GetDirectoryName
(
const GeoFileString & path
)
This will remove the string beyond and including the last file separator if there is one.
If there isn't one it won't do anything.
public: GeoFileString GetDriveName
(
const GeoFileString & path
)
Extracts the drive letter of a given path. Valid only on platforms with multiple filesystem roots.
public: GeoFileString GetEnvString
(
const char * envName
)
Retrieves the value of an Environment variable. May not be available outside Windows platform.
public: GeoFileString GetFileName
(
const GeoFileString & path
)
This will remove the string before and including the last file separator if there is one.
If there isn't one it won't do anything.
public: GeoFileString GetFileNameWithoutExtension
(
const GeoFileString & path
)
This will remove the string before and including the last file separator if there is one.
This will remove the string beyond and including the last . if there is one. If there isn't one it won't do anything.
public: GeoFileString GetSandboxDataPath()
Returns the path to the application's data path, for platforms that provide application sandboxes.
public: GeoFileString GetTemporaryPath()
Returns the temporary folder (e.g. C:\Windows\Temp). May not be available outside Windows platform.
public: GeoFileString GetWindowsPath()
Returns the path to the Windows folder. Not available outside Windows platform.
public: bool IsAbsoluteFilePath
(
const char * path
)
Returns the true if file string is an absolute path to a file, and false if it is relative.
public: bool MakePathRelative
(
GeoFileString & path,
const GeoFileString & relativeTo
)
Make path relative wrt.
relativeTo.
relativeTo must be an absolute path. |
public: void NormalizeFileSeparators
(
GeoFileString & path,
char slash
)
This will normalize file separators to the system default, or the given slash character if provided.
public: bool RemoveTrailingFileSeparators
(
GeoFileString & path
)
This will remove \ (or /) characters from the end of the string if present.
public: void SetSandboxDataPath
(
const char * appDataPath
)
Sets the path to the application's data path, for platforms that provide application sandboxes.
Should be called at application start, before client code queries it.