Must call pmemInit() before using this module. If threads are to be used, ptrdInit() must be called before using this module as well.
Data Structures | |
struct | PFileSystem |
Defines | |
#define | PSTDIN stdin |
#define | PSTDOUT stdout |
#define | PSTDERR stderr |
Functions | |
PORTABLE_API ESR_ReturnCode | PFileSystemCreate (void) |
PORTABLE_API ESR_ReturnCode | PFileSystemIsCreated (ESR_BOOL *isCreated) |
PORTABLE_API ESR_ReturnCode | PFileSystemDestroy (void) |
PORTABLE_API ESR_ReturnCode | PFileSystemCreatePFile (const LCHAR *path, ESR_BOOL littleEndian, PFile **file) |
PORTABLE_API ESR_ReturnCode | PFileSystemIsAbsolutePath (const LCHAR *path, ESR_BOOL *isAbsolute) |
PORTABLE_API ESR_ReturnCode | PFileSystemGetAbsolutePath (LCHAR *path, size_t *len) |
PORTABLE_API ESR_ReturnCode | PFileSystemCanonicalSlashes (LCHAR *path) |
PORTABLE_API ESR_ReturnCode | PFileSystemGetParentDirectory (LCHAR *path, size_t *len) |
PORTABLE_API ESR_ReturnCode | PFileSystemMkdir (const LCHAR *path) |
PORTABLE_API ESR_ReturnCode | PFileSystemGetcwd (LCHAR *path, size_t *len) |
PORTABLE_API ESR_ReturnCode | PFileSystemChdir (const LCHAR *path) |
PORTABLE_API ESR_ReturnCode | PFileSystemLinearToPathTokens (const LCHAR *path, LCHAR ***tokenArray, size_t *count) |
#define PSTDIN stdin |
Portable standard input. Portable standard output. Portable standard error.
PORTABLE_API ESR_ReturnCode PFileSystemCanonicalSlashes | ( | LCHAR * | path | ) |
Converts all slashes in path to '/'.
path | [in/out] Path to process |
PORTABLE_API ESR_ReturnCode PFileSystemChdir | ( | const LCHAR * | path | ) |
Sets the current working directory.
path | Fully qualified file path |
PORTABLE_API ESR_ReturnCode PFileSystemCreate | ( | void | ) |
Initializes the portable file-system module.
PORTABLE_API ESR_ReturnCode PFileSystemCreatePFile | ( | const LCHAR * | path, | |
ESR_BOOL | littleEndian, | |||
PFile ** | file | |||
) |
Creates a new PFile using this file-system.
path | Fully qualified file path | |
littleEndian | True if file is in little-endian format | |
file | [out] Resulting PFile |
PORTABLE_API ESR_ReturnCode PFileSystemDestroy | ( | void | ) |
Shuts down the portable file-system module.
PORTABLE_API ESR_ReturnCode PFileSystemGetAbsolutePath | ( | LCHAR * | path, | |
size_t * | len | |||
) |
Returns the canonical pathname string of this abstract pathname.
A canonical pathname is both absolute and unique. The precise definition of canonical form is system-dependent. This method first converts this pathname to absolute form. This typically involves removing redundant names such as "." and ".." from the pathname, resolving symbolic links (on UNIX platforms), and converting drive letters to a standard case (on Microsoft Windows platforms).
POST-CONDITION: Path will contain only canonical slashes
path | Path to process | |
len | [in/out] Length of path argument. If the return code is ESR_BUFFER_OVERFLOW, the required length is returned in this variable. |
PORTABLE_API ESR_ReturnCode PFileSystemGetcwd | ( | LCHAR * | path, | |
size_t * | len | |||
) |
Returns the current working directory (always ends with '/').
path | [out] The current working directory | |
len | [in/out] Length of path argument. If the return code is ESR_BUFFER_OVERFLOW, the required length is returned in this variable. |
PORTABLE_API ESR_ReturnCode PFileSystemGetParentDirectory | ( | LCHAR * | path, | |
size_t * | len | |||
) |
Returns parent directory of specified path. If the path ends with a filename, its directory is returned. If the path ends with a directory, its parent directory is returned.
PRECONDITION: Directory names must end with '/'
path | [in/out] Path to process | |
len | [in/out] Length of path argument. If the return code is ESR_BUFFER_OVERFLOW, the required length is returned in this variable. |
PORTABLE_API ESR_ReturnCode PFileSystemIsAbsolutePath | ( | const LCHAR * | path, | |
ESR_BOOL * | isAbsolute | |||
) |
Indicates if path is absolute.
path | Path to be processed | |
isAbsolute | True if path is absolute |
PORTABLE_API ESR_ReturnCode PFileSystemIsCreated | ( | ESR_BOOL * | isCreated | ) |
Indicates if the portable file-system module is initialized.
isCreated | [in/out] True if the module is initialized. |
PORTABLE_API ESR_ReturnCode PFileSystemLinearToPathTokens | ( | const LCHAR * | path, | |
LCHAR *** | tokenArray, | |||
size_t * | count | |||
) |
Converts a linear path string to an array of path tokens. Tokens ending with a '/' denote a directory, otherwise they are a file.
POST-CONDITION: The array is allocated internally, but must be freed by the caller.
path | Command-line string to parse | |
tokenArray | [out] The array used to hold the tokens | |
count | [out] The number of tokens found |
PORTABLE_API ESR_ReturnCode PFileSystemMkdir | ( | const LCHAR * | path | ) |
Creates a new directory.
path | Directory path |