CryEngine.FileSystem.Path

The Path class wraps the System.IO.Path class to avoid conflicts by having to use the CryEngine.FileSystem and System.IO at the same time. More...

Static Public Member Functions

static string ChangeExtension (string path, string extension)
Changes the extension of a path string. More...
static string Combine (string path1, string path2)
Combines two strings into a path. More...
static string Combine (string path1, string path2, string path3)
Combines three strings into a path. More...
static string Combine (string path1, string path2, string path3, string path4)
Combines three strings into a path. More...
static string Combine (params string[] paths)
Combines an array of strings into a path. More...
static string GetDirectoryName (string path)
Returns the directory information for the specified path string. More...
static string GetExtension (string path)
Returns the extension of the specified path string. More...
static string GetFileName (string path)
Returns the file name and extension of the specified path string. More...
static string GetFileNameWithoutExtension (string path)
Returns the file name of the specified path string without the extension. More...
static string GetFullPath (string path)
Returns the absolute path for the specified path string. More...
static char [] GetInvalidFileNameChars ()
Gets an array containing the characters that are not allowed in file names. More...
static char [] GetInvalidPathChars ()
Gets an array containing the characters that are not allowed in path names. More...
static string GetPathRoot (string path)
Gets the root directory information of the specified path. More...
static string GetRandomFileName ()
Returns a random folder name or file name. More...
static string GetTempFileName ()
Creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file. More...
static string GetTempPath ()
Returns the path of the current user's temporary folder. More...
static bool HasExtension (string path)
Determines whether a path includes a file name extension. More...
static bool IsPathRooted (string path)
Gets a value indicating whether the specified path string contains a root. More...

Static Public Attributes

static char AltDirectorySeparatorChar => SystemPath.AltDirectorySeparatorChar
Provides a platform-specific alternate character used to separate directory levels in a path string that reflects a hierarchical file system organization. More...
static char DirectorySeparatorChar => SystemPath.DirectorySeparatorChar
Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization. More...
static char PathSeparator => SystemPath.PathSeparator
A platform-specific separator character used to separate path strings in environment variables. More...
static char VolumeSeparatorChar => SystemPath.VolumeSeparatorChar
Provides a platform-specific volume separator character. More...

Detailed Description

The Path class wraps the System.IO.Path class to avoid conflicts by having to use the CryEngine.FileSystem and System.IO at the same time.

Member Function Documentation

◆ ChangeExtension()

static string CryEngine.FileSystem.Path.ChangeExtension ( string path,
string extension
)
inline
static

Changes the extension of a path string.

Returns
The modified path information.
Parameters
pathThe path information to modify. The path cannot contain any of the characters defined in GetInvalidPathChars.
extensionThe new extension (with or without a leading period). Specify null to remove an existing extension from path .

◆ Combine() [1/4]

static string CryEngine.FileSystem.Path.Combine ( string path1,
string path2
)
inline
static

Combines two strings into a path.

Returns
The combined paths. If one of the specified paths is a zero-length string, this method returns the other path. If path2 contains an absolute path, this method returns path2 .
Parameters
path1The first path to combine.
path2The second path to combine.

◆ Combine() [2/4]

static string CryEngine.FileSystem.Path.Combine ( string path1,
string path2,
string path3
)
inline
static

Combines three strings into a path.

Returns
The combined paths.
Parameters
path1The first path to combine.
path2The second path to combine.
path3The third path to combine.

◆ Combine() [3/4]

static string CryEngine.FileSystem.Path.Combine ( string path1,
string path2,
string path3,
string path4
)
inline
static

Combines three strings into a path.

Returns
The combined paths.
Parameters
path1The first path to combine.
path2The second path to combine.
path3The third path to combine.
path4The fourth path to combine.

◆ Combine() [4/4]

static string CryEngine.FileSystem.Path.Combine ( params string [] paths)
inline
static

Combines an array of strings into a path.

Returns
The combined paths.
Parameters
pathsAn array of parts of the path.

◆ GetDirectoryName()

static string CryEngine.FileSystem.Path.GetDirectoryName ( string path)
inline
static

Returns the directory information for the specified path string.

Returns
The path of a file or directory.
Parameters
pathDirectory information for path , or null if path denotes a root directory or is null. Returns String.Empty if path does not contain directory information.

◆ GetExtension()

static string CryEngine.FileSystem.Path.GetExtension ( string path)
inline
static

Returns the extension of the specified path string.

Returns
The extension of the specified path (including the period "."), or null, or String.Empty. If path is null, GetExtension returns null. If path does not have extension information, GetExtension returns String.Empty.
Parameters
pathThe path string from which to get the extension.

◆ GetFileName()

static string CryEngine.FileSystem.Path.GetFileName ( string path)
inline
static

Returns the file name and extension of the specified path string.

Returns
The characters after the last directory character in path . If the last character of path is a directory or volume separator character, this method returns String.Empty. If path is null, this method returns null.
Parameters
pathThe path string from which to obtain the file name and extension.

◆ GetFileNameWithoutExtension()

static string CryEngine.FileSystem.Path.GetFileNameWithoutExtension ( string path)
inline
static

Returns the file name of the specified path string without the extension.

Returns
The string returned by GetFileName(string), minus the last period (.) and all characters following it.
Parameters
pathThe path of the file.

◆ GetFullPath()

static string CryEngine.FileSystem.Path.GetFullPath ( string path)
inline
static

Returns the absolute path for the specified path string.

Returns
The fully qualified location of path, such as "C:\MyFile.txt".
Parameters
pathThe file or directory for which to obtain absolute path information.

◆ GetInvalidFileNameChars()

static char [] CryEngine.FileSystem.Path.GetInvalidFileNameChars ( )
inline
static

Gets an array containing the characters that are not allowed in file names.

Returns
An array containing the characters that are not allowed in file names.

◆ GetInvalidPathChars()

static char [] CryEngine.FileSystem.Path.GetInvalidPathChars ( )
inline
static

Gets an array containing the characters that are not allowed in path names.

Returns
An array containing the characters that are not allowed in path names.

◆ GetPathRoot()

static string CryEngine.FileSystem.Path.GetPathRoot ( string path)
inline
static

Gets the root directory information of the specified path.

Returns
The root directory of path, such as "C:\", or null if path is null, or an empty string if path does not contain root directory information.
Parameters
pathThe path from which to obtain root directory information.

◆ GetRandomFileName()

static string CryEngine.FileSystem.Path.GetRandomFileName ( )
inline
static

Returns a random folder name or file name.

Returns
A random folder name or file name.

◆ GetTempFileName()

static string CryEngine.FileSystem.Path.GetTempFileName ( )
inline
static

Creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file.

Returns
The full path of the temporary file.

◆ GetTempPath()

static string CryEngine.FileSystem.Path.GetTempPath ( )
inline
static

Returns the path of the current user's temporary folder.

Returns
The path to the temporary folder, ending with a backslash.

◆ HasExtension()

static bool CryEngine.FileSystem.Path.HasExtension ( string path)
inline
static

Determines whether a path includes a file name extension.

Returns
true if the characters that follow the last directory separator (\ or /) or volume separator (:) in the path include a period (.) followed by one or more characters; otherwise, false.
Parameters
pathThe path to search for an extension.

◆ IsPathRooted()

static bool CryEngine.FileSystem.Path.IsPathRooted ( string path)
inline
static

Gets a value indicating whether the specified path string contains a root.

Returns
true if path contains a root; otherwise, false.
Parameters
pathThe path to test.

Member Data Documentation

◆ AltDirectorySeparatorChar

char CryEngine.FileSystem.Path.AltDirectorySeparatorChar => SystemPath.AltDirectorySeparatorChar
static

Provides a platform-specific alternate character used to separate directory levels in a path string that reflects a hierarchical file system organization.

The alternate directory separator char.

◆ DirectorySeparatorChar

char CryEngine.FileSystem.Path.DirectorySeparatorChar => SystemPath.DirectorySeparatorChar
static

Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization.

The directory separator char.

◆ PathSeparator

char CryEngine.FileSystem.Path.PathSeparator => SystemPath.PathSeparator
static

A platform-specific separator character used to separate path strings in environment variables.

The path separator.

◆ VolumeSeparatorChar

char CryEngine.FileSystem.Path.VolumeSeparatorChar => SystemPath.VolumeSeparatorChar
static

Provides a platform-specific volume separator character.

The volume separator char.