class Path
Provides functions dealing with pathes to files and directories on the local filesystem and network shares.
Global Functions
int Exists (const Path) | Returns true if the specified file or directory exists. |
Path GetCurrentDirectory () | Returns the current working directory for the application. |
Path[] GetDirectories (const Path) | Returns an array containing all sub-directories contained in the specified path. |
Path[] GetFiles (const Path) | Returns an array containing all files contained in the specified path. |
int IsFolder (const Path) | Returns true if the specified path is a directory. |
int SetCurrentDirectory (const Path) | Sets the current working directory for the application. |
Constructors
Path () | Constructs a new, empty path. |
Path (const string) | Constructs an instance from the given string. |
Path (const string, const int) | Constructs an instance from a string and a flag indicating whether the string is a path to a file or folder. |
Path (const Path) | Constructs a copy from the given instance. |
Path (const Path, const string) | Constructs new path from an existing path and a file name. |
Convertors
string convertor () | Returns a string representation of this Path object. |
Methods
AddFolder (const string) | Appends a folder name to the list of folders in this Path. |
string[] GetFolderNames () | Returns all folder names of the path as an array of strings. |
RemoveFolder () | Removes the last folder from the list of folders in this Path. |
SetFolderNames (const string[]) | Sets all folder names of the path to the contents of the given array. |
Properties
string CompleteName () | Returns the complete file name of this Path. |
CompleteName (const string) | Sets a new file name and extension for this Path. |
string Drive () | Returns the drive letter or network share name of this Path. |
Drive (const string) | Sets the drive letter or network share name of this Path. |
string DriveAndFolders () | Returns the drive letter or network share name and all folders of this path, but not the file name and type. |
DriveAndFolders (const string) | Sets the drive name and all folders of this path. |
string FileName () | Returns the file name of this Path. |
FileName (const string) | Sets a new file name for this Path. |
string FileType () | Returns the file type of this Path. |
FileType (const string) | Sets the file type for this Path. |
string Folders () | Returns all folders of this Path. |
Folders (const string) | Sets all folders of this Path. |
string FullPath () | Returns the complete path to the file represented by this Path as a string. |
FullPath (const string) | Sets this Path to a new file. |
int IsAbsolute () | Returns true if this Path is absolute, meaning it contains a drive letter and the full path to the file or directory represented by the Path. |
int IsEmpty () | Returns true if this Path does not contain any file or path information at all. |
int IsShare () | Returns true if this Path represents a file or directory on a network share, rather than a local drive. |
Reference
function int Exists (const Path path) |
Returns true if the specified file or directory exists. |
function Path GetCurrentDirectory () |
Returns the current working directory for the application. |
function Path[] GetDirectories (const Path path) |
Returns an array containing all sub-directories contained in the specified path. |
function Path[] GetFiles (const Path path) |
Returns an array containing all files contained in the specified path. |
function int IsFolder (const Path path) |
Returns true if the specified path is a directory. |
function int SetCurrentDirectory (const Path path) |
Sets the current working directory for the application. |
method Path () |
Constructs a new, empty path. |
method Path (const string filePath) |
Constructs an instance from the given string. This assumes the given string is a file; if you want to create a path to a directory, use the third constructor. |
method Path (const string path, const int isFolder) |
Constructs an instance from a string and a flag indicating whether the string is a path to a file or folder. |
method Path (const Path source) |
Constructs a copy from the given instance. |
method Path (const Path source, const string fileName) |
Constructs new path from an existing path and a file name. |
method string convertor () |
Returns a string representation of this Path object. The result will be the same as the FullPath property. |
method AddFolder (const string folder) |
Appends a folder name to the list of folders in this Path. |
method string[] GetFolderNames () |
Returns all folder names of the path as an array of strings. |
method RemoveFolder () |
Removes the last folder from the list of folders in this Path. |
method SetFolderNames (const string[] folders) |
Sets all folder names of the path to the contents of the given array. |
accessor string CompleteName () |
Returns the complete file name of this Path. This includes the file's extension, but not folders and drive letter. |
accessor CompleteName (const string) |
Sets a new file name and extension for this Path. This will update the FileType property. The other attributes are not affected. |
accessor string Drive () |
Returns the drive letter or network share name of this Path. |
accessor Drive (const string) |
Sets the drive letter or network share name of this Path. The other attributes of the Path object are not affected by this. |
accessor string DriveAndFolders () |
Returns the drive letter or network share name and all folders of this path, but not the file name and type. |
accessor DriveAndFolders (const string) |
Sets the drive name and all folders of this path. The file name and type will not be affected. |
accessor string FileName () |
Returns the file name of this Path. This is the name of the file without extension. |
accessor FileName (const string) |
Sets a new file name for this Path. This will also update the CompleteName property. The other attributes are not affected. |
accessor string FileType () |
Returns the file type of this Path. The file type is the extension of the file, NOT including the dot character. |
accessor FileType (const string) |
Sets the file type for this Path. This will also alter the CompleteName property to reflect the new extension. The other attributes are not affected. |
accessor string Folders () |
Returns all folders of this Path. This is the path name stripped by the drive letter and file name. |
accessor Folders (const string) |
Sets all folders of this Path. The other attributes of the Path are not affected. |
accessor string FullPath () |
Returns the complete path to the file represented by this Path as a string. |
accessor FullPath (const string) |
Sets this Path to a new file. This assumes the given string is a file; if you want to assign a path to a directory, use the DriveAndFolders property instead. |
accessor int IsAbsolute () |
Returns true if this Path is absolute, meaning it contains a drive letter and the full path to the file or directory represented by the Path. |
accessor int IsEmpty () |
Returns true if this Path does not contain any file or path information at all. |
accessor int IsShare () |
Returns true if this Path represents a file or directory on a network share, rather than a local drive. |