#include <filepath.h>
Inheritance diagram for PFilePath:
Public Member Functions | |
Construction | |
PFilePath () | |
PFilePath (const char *cstr) | |
PFilePath (const PString &str) | |
PFilePath (const PFilePath &path) | |
PFilePath (const char *prefix, const char *dir) | |
PFilePath & | operator= (const PFilePath &path) |
PFilePath & | operator= (const PString &str) |
PFilePath & | operator= (const char *cstr) |
Path addition functions | |
PFilePath & | operator+= (const PString &str) |
PFilePath & | operator+= (const char *cstr) |
PFilePath & | operator+= (char ch) |
Path decoding access functions | |
PFilePathString | GetVolume () const |
PFilePathString | GetPath () const |
PFilePathString | GetTitle () const |
PFilePathString | GetType () const |
PFilePathString | GetFileName () const |
PDirectory | GetDirectory () const |
void | SetType (const PFilePathString &type) |
Static Public Member Functions | |
Miscellaneous functions | |
static BOOL | IsValid (char c) |
static BOOL | IsValid (const PString &str) |
Protected Member Functions | |
virtual void | AssignContents (const PContainer &cont) |
An empty string for a PFilePath indicates an illegal path.
The ancestor class is dependent on the platform. For file systems that are case sensitive, eg Unix, the ancestor is PString#. For other platforms, the ancestor class is PCaselessString#.
|
Create a file specification object. |
|
Create a file specification object with the specified file name. The string passed in may be a full or partial specification for a file as determined by the platform. It is unusual for this to be a literal string, unless only the file title is specified, as that would be platform specific. The partial file specification is translated into a canonical form which always absolutely references the file.
|
|
Create a file specification object with the specified file name. The string passed in may be a full or partial specification for a file as determined by the platform. It is unusual for this to be a literal string, unless only the file title is specified, as that would be platform specific. The partial file specification is translated into a canonical form which always absolutely references the file.
|
|
Create a file specification object with the specified file name.
|
|
Create a file spec object with a generated temporary name. The first parameter is a prefix for the filename to which a unique number is appended. The second parameter is the directory in which the file is to be placed. If this is NULL a system standard directory is used.
|
|
|
|
Get the the directory that the file is contained in. This may be identical to GetVolume() + GetPath()# depending on the platform. eg for DOS file "C:\SRC\PWLIB\FRED.TXT" this would be "C:\SRC\PWLIB\". Note that for Unix platforms, this returns the { physical} path of the directory. That is all symlinks are resolved. Thus the directory returned may not be the same as the value of GetPath()#.
|
|
Get the actual directory entry name component of the full file specification. This may be identical to GetTitle() + GetType()# or simply GetTitle()# depending on the platform. eg for DOS file "C:\SRC\PWLIB\FRED.TXT" this would be "FRED.TXT".
|
|
Get the directory path component of the full file specification. This will include leading and trailing directory separators. For example on DOS this could be "\SRC\PWLIB\", for Macintosh ":Source:PwLib:" and for Unix "/users/equivalence/src/pwlib/".
|
|
Get the title component of the full file specification, eg for the DOS file "C:\SRC\PWLIB\FRED.DAT" this would be "FRED".
|
|
Get the file type of the file. Note that on some platforms this may actually be part of the full name string. eg for DOS file "C:\SRC\PWLIB\FRED.TXT" this would be ".TXT" but on the Macintosh this might be "TEXT". Note there are standard translations from file extensions, eg ".TXT" and some Macintosh file types, eg "TEXT".
|
|
Get the drive/volume name component of the full file specification. This is very platform specific. For example in DOS & NT it is the drive letter followed by a colon ("C:"), for Macintosh it is the volume name ("Untitled") and for Unix it is empty ("").
|
|
Test if all the characters are valid in a filename.
|
|
Test if the character is valid in a filename.
|
|
Concatenate a single character to a path. The #ch# parameter is typically a literal, eg: {verbatim} myStr += '!'; {verbatim}
Reimplemented from PString. |
|
Concatenate a C string to a path, modifiying that path. The #cstr# parameter is typically a literal string, eg: {verbatim} myStr += "fred"; {verbatim}
Reimplemented from PString. |
|
Concatenate a string to the file path, modifiying that path.
Reimplemented from PString. |
|
Change the file specification object to the specified file name. The string passed in may be a full or partial specifiaction for a file as determined by the platform. It is unusual for this to be a literal string, unless only the file title is specified, as that would be platform specific. The partial file specification is translated into a canonical form which always absolutely references the file.
Reimplemented from PString. |
|
Change the file specification object to the specified file name. The string passed in may be a full or partial specifiaction for a file as determined by the platform. It is unusual for this to be a literal string, unless only the file title is specified, as that would be platform specific. The partial file specification is translated into a canonical form which always absolutely references the file.
Reimplemented from PString. |
|
Change the file specification object to the specified file name.
|
|
Set the type component of the full file specification, eg for the DOS file "C:\SRC\PWLIB\FRED.DAT" would become "C:\SRC\PWLIB\FRED.TXT".
|