VCF::FilePath Class Reference
A FilePath represents a path to a file in the filesystem. More...
#include <vcf/FoundationKit/FilePath.h>
Public Types | |
| enum | { DriveSeparator = L':', DirectorySeparator = L'/', ExtensionCharacter = L'.' } |
Public Member Functions | |
| FilePath () | |
| FilePath (const String &filename) | |
| FilePath (const FilePath &filePath) | |
| virtual | ~FilePath () |
| FilePath & | operator= (const FilePath &path) |
| Assigns a FilePath to another. | |
| FilePath & | operator= (const String &filename) |
| Assigns a string to a file path instance. | |
| FilePath & | operator+= (const String &filename) |
| operator String () const | |
| Returns the string value of hte FilePath. | |
| bool | empty () const |
| Returns whether or not the value of the FilePath is empty. | |
| String | getDriveName () const |
| returns the drivename for filesystems that support them (i.e. | |
| String | getPathName (const bool &includeDriveName=false) const |
| Returns the directory portion of the file name including the 'DirectorySeparator' character at the end. | |
| String | getBaseName (const bool &includeExtension=false) const |
| Returns the name component of the filename (i.e without path information ). | |
| String | getExtension () const |
| Returns an extension. | |
| bool | isRelativePath () const |
| Tells if the filename is a relative path. | |
| bool | isDirectoryName () const |
| Returns true if the filename is a directory name. | |
| String | getFileName () const |
| returns the filename converted to the native format ('nix) The filename may not be a full path name. | |
| FilePath & | transformToNative () |
| Converts the FilePath filename to the format specifically used internally by the FilePath. | |
| FilePath & | transformToOSSpecific () |
| converts the filename into the format specific for the OS The filename may not be a full path name | |
| FilePath & | transformToRelativePathName (const String &workingPath=L"") |
| transform the pathname into one relative to the working path | |
| FilePath & | expandRelativePathName (const String &workingPath=L"") |
| transform a relative pathname into a full pathname based on the working path | |
| std::vector< String > | getPathComponents () const |
| separates a path into a vector filled by its components i.e. | |
Static Public Member Functions | |
| static String | getDriveSeparator () |
| Returns the string (usually a single character) that is used to separate the drive identifier from the rest of the path string. | |
| static String | getDirectorySeparator () |
| Returns the string used to separate a directory identifiers in the format used internally by the FilePath class. | |
| static String | getDirectorySeparatorOSSpecific () |
| Returns the string used to separate a directory identifiers in the format used natively by the OS. | |
| static String | getExtensionSeparator () |
| static bool | isRelativePath (const String &filename) |
| Tells if a filename is a relative path. | |
| static bool | isDirectoryName (const String &path) |
| Tells if a path is a directory name. | |
| static String | transformToNative (const String &filename) |
| Returns the filename converted to the format specifically used internally by the FilePath. | |
| static String | transformToOSSpecific (const String &filename) |
| Returns the filename converted to the format specific for the OS. | |
| static String | getTransformedToRelativePathName (const String &fullPath, const String &workingPath=L"") |
| returns the pathname relative to the working path | |
| static String | getExpandedRelativePathName (const String &fullPath, const String &workingPath=L"") |
| expand a relative pathname into a full pathname based on the working path | |
| static std::vector< String > | getPathComponents (const String &fullpath) |
| separates a path into a vector filled by its components i.e. | |
| static String | makeDirectoryName (const String &fullname, const bool &remove=false) |
| Ensures a path has a 'DirectorySeparator' as its final character. | |
| static void | splitDrive (const String &fullname, String &drive, String &pathname) |
| Split a full fullname into its drive and path components. | |
| static void | splitPath (const String &fullname, String &path, String &name) |
| Splits a full fullname into its path and filename components. | |
| static void | splitExtension (const String &fullname, String &root, String &ext) |
| Splits a full fullname into its root and extension components. | |
| static String | getDriveName (const String &fullname) |
| returns the drivename for filesystems that support them (i.e. | |
| static String | getPathName (const String &fullname, const bool &includeDriveName=false) |
| returns the directory portion of the file name including the 'DirectorySeparator' character at the end | |
| static String | getBaseName (const String &fullname, const bool &includeExtension=false) |
| returns the name component of the filename (i.e without path information ) | |
| static String | getExtension (const String &fullname) |
| returns an extension. | |
| static bool | wildCharsMatchName (const String &filename, const String &wildChars) |
| helper function to check if a filename matches a wildcards pattern In the current implementation wildcards include only the '*' character. | |
Protected Attributes | |
| String | filename_ |
Detailed Description
A FilePath represents a path to a file in the filesystem.
- FilePath collects some static functions used to split a filename into its components, or to directly get those components. Particular attention has been given to the performance.
- Beside that its an object storing a pathname in a Native ( Unix style ) format so that more complex operations can be performed without repetitions.
Member Enumeration Documentation
|
|
|
Constructor & Destructor Documentation
|
|
|
|
|
|
|
|
|
|
|
|
Member Function Documentation
|
|
Returns whether or not the value of the FilePath is empty. This is equivalent to a String::empty() function call.
|
|
|
transform a relative pathname into a full pathname based on the working path
|
|
||||||||||||
|
returns the name component of the filename (i.e without path information )
|
|
|
Returns the name component of the filename (i.e without path information ).
|
|
|
Returns the string used to separate a directory identifiers in the format used internally by the FilePath class. Note that this may be different than the directory seperator used natively by the OS. For example, on a Win32 system the directory separator is the "\" character. |
|
|
Returns the string used to separate a directory identifiers in the format used natively by the OS. For example, on a Win32 system the directory separator is the "\" character. |
|
|
returns the drivename for filesystems that support them (i.e. VMS and Win32) on 'nix systems this returns an empty string The 'DriveSeparator' character is excluded |
|
|
returns the drivename for filesystems that support them (i.e. VMS and Win32) on 'nix systems this returns an empty string The 'DriveSeparator' character is excluded |
|
|
Returns the string (usually a single character) that is used to separate the drive identifier from the rest of the path string. For example on Win32 systems this usually returns a ":" character. |
|
||||||||||||
|
expand a relative pathname into a full pathname based on the working path
|
|
|
returns an extension.
The extension is the last occurence of the "." to the end of the filename string. For example:
|
|
|
Returns an extension.
The extension is the last occurence of the "." to the end of the filename string. For example:
|
|
|
|
|
|
returns the filename converted to the native format ('nix) The filename may not be a full path name.
|
|
|
separates a path into a vector filled by its components i.e. the subdirectories composing the path. each one of them with the 'DirectorySeparator' character at the end Drive and filetitle are excluded.
|
|
|
separates a path into a vector filled by its components i.e. the subdirectories composing the path. each one of them with the 'DirectorySeparator' character at the end Drive and filetitle are excluded.
|
|
||||||||||||
|
returns the directory portion of the file name including the 'DirectorySeparator' character at the end
|
|
|
Returns the directory portion of the file name including the 'DirectorySeparator' character at the end.
|
|
||||||||||||
|
returns the pathname relative to the working path
|
|
|
Returns true if the filename is a directory name. A file name is considered a directory name if the 'DirectorySeparator' character at the end.
|
|
|
Tells if a path is a directory name. A path is considered a directory name if the 'DirectorySeparator' character at the end. Returns true if the path is a directory name
|
|
|
Tells if the filename is a relative path.
|
|
|
Tells if a filename is a relative path.
|
|
||||||||||||
|
Ensures a path has a 'DirectorySeparator' as its final character. Under Win32 it tests against both the '/' and '\' characters. The VCF uses the convention that directory names must be terminated with a 'DirectorySeparator' character.
|
|
|
Returns the string value of hte FilePath. This is done by simply returning the value of the filename_ member value. |
|
|
|
|
|
Assigns a string to a file path instance. Assumes the string value is actually some valid file path |
|
|
Assigns a FilePath to another.
|
|
||||||||||||||||
|
Split a full fullname into its drive and path components. The expression ( fullname == drive + pathname ) is invariant. Under Win32 it tests against both the '/' and '\' characters.
|
|
||||||||||||||||
|
Splits a full fullname into its root and extension components. The expression ( fullname == root + ext ) is invariant. therefore ( as in Python ): ( root, ext ) = ( 'foo', '.txt' ) when fullname = 'foo.txt' ( root, ext ) = ( 'foo', '' ) when fullname = 'foo', instead than: ( 'foo', '.' )
|
|
||||||||||||||||
|
Splits a full fullname into its path and filename components. The expression ( fullname == path + filename ) is invariant. Under Win32 it tests against both the '/' and '\' characters.
|
|
|
Converts the FilePath filename to the format specifically used internally by the FilePath. The format looks like: [<drive_letter>:]/[dir1/][dir2/][dir_n/]
|
|
|
Returns the filename converted to the format specifically used internally by the FilePath. The format looks like: [<drive_letter>:]/[dir1/][dir2/][dir_n/]
|
|
|
converts the filename into the format specific for the OS The filename may not be a full path name
|
|
|
Returns the filename converted to the format specific for the OS. The filename may not be a full path name
|
|
|
transform the pathname into one relative to the working path
|
|
||||||||||||
|
helper function to check if a filename matches a wildcards pattern In the current implementation wildcards include only the '*' character.
|
Member Data Documentation
|
|
|
The documentation for this class was generated from the following file:
- vcf/FoundationKit/FilePath.h
