LibreOffice
LibreOffice 24.2 SDK C/C++ API Reference
|
Base class for all File System specific objects. More...
#include <file.hxx>
Public Types | |
enum | RC { E_None = osl_File_E_None, E_PERM = osl_File_E_PERM, E_NOENT = osl_File_E_NOENT, E_SRCH = osl_File_E_SRCH, E_INTR = osl_File_E_INTR, E_IO = osl_File_E_IO, E_NXIO = osl_File_E_NXIO, E_2BIG = osl_File_E_2BIG, E_NOEXEC = osl_File_E_NOEXEC, E_BADF = osl_File_E_BADF, E_CHILD = osl_File_E_CHILD, E_AGAIN = osl_File_E_AGAIN, E_NOMEM = osl_File_E_NOMEM, E_ACCES = osl_File_E_ACCES, E_FAULT = osl_File_E_FAULT, E_BUSY = osl_File_E_BUSY, E_EXIST = osl_File_E_EXIST, E_XDEV = osl_File_E_XDEV, E_NODEV = osl_File_E_NODEV, E_NOTDIR = osl_File_E_NOTDIR, E_ISDIR = osl_File_E_ISDIR, E_INVAL = osl_File_E_INVAL, E_NFILE = osl_File_E_NFILE, E_MFILE = osl_File_E_MFILE, E_NOTTY = osl_File_E_NOTTY, E_FBIG = osl_File_E_FBIG, E_NOSPC = osl_File_E_NOSPC, E_SPIPE = osl_File_E_SPIPE, E_ROFS = osl_File_E_ROFS, E_MLINK = osl_File_E_MLINK, E_PIPE = osl_File_E_PIPE, E_DOM = osl_File_E_DOM, E_RANGE = osl_File_E_RANGE, E_DEADLK = osl_File_E_DEADLK, E_NAMETOOLONG = osl_File_E_NAMETOOLONG, E_NOLCK = osl_File_E_NOLCK, E_NOSYS = osl_File_E_NOSYS, E_NOTEMPTY = osl_File_E_NOTEMPTY, E_LOOP = osl_File_E_LOOP, E_ILSEQ = osl_File_E_ILSEQ, E_NOLINK = osl_File_E_NOLINK, E_MULTIHOP = osl_File_E_MULTIHOP, E_USERS = osl_File_E_USERS, E_OVERFLOW = osl_File_E_OVERFLOW, E_NOTREADY = osl_File_E_NOTREADY, E_invalidError = osl_File_E_invalidError, E_TIMEDOUT = osl_File_E_TIMEDOUT, E_NETWORK = osl_File_E_NETWORK } |
Static Public Member Functions | |
static RC | getCanonicalName (const ::rtl::OUString &ustrRequestedURL, ::rtl::OUString &ustrValidURL) |
Determine a valid unused canonical name for a requested name. More... | |
static RC | getAbsoluteFileURL (const ::rtl::OUString &ustrBaseDirectoryURL, const ::rtl::OUString &ustrRelativeFileURL, ::rtl::OUString &ustrAbsoluteFileURL) |
Convert a path relative to a given directory into an full qualified file URL. More... | |
static RC | getSystemPathFromFileURL (const ::rtl::OUString &ustrFileURL, ::rtl::OUString &ustrSystemPath) |
Convert a file URL into a system dependent path. More... | |
static RC | getFileURLFromSystemPath (const ::rtl::OUString &ustrSystemPath, ::rtl::OUString &ustrFileURL) |
Convert a system dependent path into a file URL. More... | |
static RC | searchFileURL (const ::rtl::OUString &ustrFileName, const ::rtl::OUString &ustrSearchPath, ::rtl::OUString &ustrFileURL) |
Search a full qualified system path or a file URL. More... | |
static RC | getTempDirURL (::rtl::OUString &ustrTempDirURL) |
Retrieves the file URL of the system's temporary directory path. More... | |
static RC | createTempFile (::rtl::OUString *pustrDirectoryURL, oslFileHandle *pHandle, ::rtl::OUString *pustrTempFileURL) |
Creates a temporary file in the directory provided by the caller or the directory returned by getTempDirURL. More... | |
Base class for all File System specific objects.
enum osl::FileBase::RC |
|
inlinestatic |
Creates a temporary file in the directory provided by the caller or the directory returned by getTempDirURL.
Under UNIX Operating Systems the file will be created with read and write access for the user exclusively. If the caller requests only a handle to the open file but not the name of it, the file will be automatically removed on close else the caller is responsible for removing the file on success.
[in] | pustrDirectoryURL | Specifies the full qualified URL where the temporary file should be created. If pustrDirectoryURL is 0 the path returned by osl_getTempDirURL will be used. |
[out] | pHandle | On success receives a handle to the open file. If pHandle is 0 the file will be closed on return, in this case pustrTempFileURL must not be 0. |
[out] | pustrTempFileURL | On success receives the full qualified URL of the temporary file. If pustrTempFileURL is 0 the file will be automatically removed on close, in this case pHandle must not be 0. If pustrTempFileURL is not 0 the caller receives the name of the created file and is responsible for removing the file. |
Description of the different pHandle, ppustrTempFileURL parameter combinations. pHandle is 0 and pustrTempDirURL is 0 - this combination is invalid
pHandle is not 0 and pustrTempDirURL is 0 - a handle to the open file will be returned on success and the file will be automatically removed on close
pHandle is 0 and pustrTempDirURL is not 0 - the name of the file will be returned, the caller is responsible for opening, closing and removing the file.
pHandle is not 0 and pustrTempDirURL is not 0 - a handle to the open file as well as the file name will be returned, the caller is responsible for closing and removing the file.
E_None | on success |
E_INVAL | the format of the parameter is invalid |
E_NOMEM | not enough memory for allocating structures |
E_ACCES | Permission denied |
E_NOENT | No such file or directory |
E_NOTDIR | Not a directory |
E_ROFS | Read-only file system |
E_NOSPC | No space left on device |
E_DQUOT | Quota exceeded |
|
inlinestatic |
Convert a path relative to a given directory into an full qualified file URL.
Convert a path relative to a given directory into an full qualified file URL. The function resolves symbolic links if possible and path ellipses, so on success the resulting absolute path is fully resolved.
[in] | ustrBaseDirectoryURL | Base directory URL to which the relative path is related to. |
[in] | ustrRelativeFileURL | A URL of a file or directory relative to the directory path specified by ustrBaseDirectoryURL or an absolute path. If ustrRelativeFileURL denotes an absolute path ustrBaseDirectoryURL will be ignored. |
[out] | ustrAbsoluteFileURL | On success it receives the full qualified absolute file URL. |
E_None | on success |
E_INVAL | the format of the parameters was not valid |
E_NOMEM | not enough memory for allocating structures |
E_NOTDIR | not a directory |
E_ACCES | permission denied |
E_NOENT | no such file or directory |
E_NAMETOOLONG | file name too long |
E_OVERFLOW | value too large for defined data type |
E_FAULT | bad address |
E_INTR | function call was interrupted |
E_LOOP | too many symbolic links encountered |
E_MULTIHOP | multihop attempted |
E_NOLINK | link has been severed |
|
inlinestatic |
Determine a valid unused canonical name for a requested name.
Determines a valid unused canonical name for a requested name. Depending on the Operating System and the File System the illegal characters are replaced by valid ones. If a file or directory with the requested name already exists a new name is generated following the common rules on the actual Operating System and File System.
[in] | ustrRequestedURL | Requested name of a file or directory. |
[out] | ustrValidURL | On success receives a name which is unused and valid on the actual Operating System and File System. |
E_None | on success |
E_INVAL | the format of the parameters was not valid |
|
inlinestatic |
Convert a system dependent path into a file URL.
[in] | ustrSystemPath | A System dependent path of a file or directory. |
[out] | ustrFileURL | On success it receives the file URL. |
E_None | on success |
E_INVAL | the format of the parameters was not valid |
|
inlinestatic |
Convert a file URL into a system dependent path.
[in] | ustrFileURL | A File URL. |
[out] | ustrSystemPath | On success it receives the system path. |
E_None | on success |
E_INVAL | the format of the parameters was not valid |
|
inlinestatic |
Retrieves the file URL of the system's temporary directory path.
[out] | ustrTempDirURL | On success receives the URL of system's temporary directory path. |
E_None | on success |
E_NOENT | no such file or directory not found |
|
inlinestatic |
Search a full qualified system path or a file URL.
[in] | ustrFileName | A system dependent path, a file URL, a file or relative directory |
[in] | ustrSearchPath | A list of system paths, in which a given file has to be searched. The Notation of a path list is system dependent, e.g. on UNIX system "/usr/bin:/bin" and on Windows "C:\BIN;C:\BATCH". These paths are only for the search of a file or a relative path, otherwise it will be ignored. If ustrSearchPath is NULL or while using the search path the search failed, the function searches for a matching file in all system directories and in the directories listed in the PATH environment variable. The value of an environment variable should be used (e.g. LD_LIBRARY_PATH) if the caller is not aware of the Operating System and so doesn't know which path list delimiter to use. |
[out] | ustrFileURL | On success it receives the full qualified file URL. |
E_None | on success |
E_INVAL | the format of the parameters was not valid |
E_NOTDIR | not a directory |
E_NOENT | no such file or directory not found |