LibreOffice: osl::FileBase Class Reference

LibreOffice LibreOffice 4.4 SDK C/C++ API Reference

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Static Public Member Functions | List of all members
osl::FileBase Class Reference

Base class for all File System specific objects. More...

`#include <file.hxx>`

Inheritance diagram for osl::FileBase:

## 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)
| Searche 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...

## Detailed Description

Base class for all File System specific objects.

See also
  Directory
  DirectoryItem
  File

## Member Enumeration Documentation

enum osl::FileBase::RC

Enumerator
E_None |
E_PERM |
E_NOENT |
E_SRCH |
E_INTR |
E_IO |
E_NXIO |
E_2BIG |
E_NOEXEC |
E_BADF |
E_CHILD |
E_AGAIN |
E_NOMEM |
E_ACCES |
E_FAULT |
E_BUSY |
E_EXIST |
E_XDEV |
E_NODEV |
E_NOTDIR |
E_ISDIR |
E_INVAL |
E_NFILE |
E_MFILE |
E_NOTTY |
E_FBIG |
E_NOSPC |
E_SPIPE |
E_ROFS |
E_MLINK |
E_PIPE |
E_DOM |
E_RANGE |
E_DEADLK |
E_NAMETOOLONG |
E_NOLCK |
E_NOSYS |
E_NOTEMPTY |
E_LOOP |
E_ILSEQ |
E_NOLINK |
E_MULTIHOP |
E_USERS |
E_OVERFLOW |
E_NOTREADY |
E_invalidError |
E_TIMEDOUT |
E_NETWORK |

## Member Function Documentation

static RC osl::FileBase::createTempFile | ( | ::rtl::OUString * | pustrDirectoryURL,
|  | oslFileHandle * | pHandle,
|  | ::rtl::OUString * | pustrTempFileURL
| ) |  |
| 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.

Parameters

  pustrDirectoryURL | [in] 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.
  pHandle | [out] 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.
  pustrTempFileURL | [out] 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.

Returns
  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

See also
  getTempDirURL()

static RC osl::FileBase::getAbsoluteFileURL | ( | const ::rtl::OUString & | ustrBaseDirectoryURL,
|  | const ::rtl::OUString & | ustrRelativeFileURL,
|  | ::rtl::OUString & | ustrAbsoluteFileURL
| ) |  |
| 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.

Parameters

  ustrBaseDirectoryURL | [in] Base directory URL to which the relative path is related to.
  ustrRelativeFileURL | [in] An 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.
  ustrAbsoluteFileURL | [out] On success it receives the full qualified absolute file URL.

Returns
  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

See also
  DirectoryItem::getFileStatus()

static RC osl::FileBase::getCanonicalName | ( | const ::rtl::OUString & | ustrRequestedURL,
|  | ::rtl::OUString & | ustrValidURL
| ) |  |
| 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.

Parameters

  ustrRequestedURL | [in] Requested name of a file or directory.
  ustrValidURL | [out] On success receives a name which is unused and valid on the actual Operating System and File System.

Returns
  E_None on success E_INVAL the format of the parameters was not valid

See also
  DirectoryItem::getFileStatus()

static RC osl::FileBase::getFileURLFromSystemPath | ( | const ::rtl::OUString & | ustrSystemPath,
|  | ::rtl::OUString & | ustrFileURL
| ) |  |
| inlinestatic

Convert a system dependent path into a file URL.

Parameters

  ustrSystemPath | [in] A System dependent path of a file or directory.
  ustrFileURL | [out] On success it receives the file URL.

Returns
  E_None on success E_INVAL the format of the parameters was not valid

See also
  getSystemPathFromFileURL()

static RC osl::FileBase::getSystemPathFromFileURL | ( | const ::rtl::OUString & | ustrFileURL,
|  | ::rtl::OUString & | ustrSystemPath
| ) |  |
| inlinestatic

Convert a file URL into a system dependent path.

Parameters

  ustrFileURL | [in] A File URL.
  ustrSystemPath | [out] On success it receives the system path.

Returns
  E_None on success E_INVAL the format of the parameters was not valid

See also
  getFileURLFromSystemPath()

static RC osl::FileBase::getTempDirURL | ( | ::rtl::OUString & | ustrTempDirURL | ) |
| inlinestatic

Retrieves the file URL of the system's temporary directory path.

Parameters

  [out] | ustrTempDirURL | On success receives the URL of system's temporary directory path.

Returns
  E_None on success E_NOENT no such file or directory not found

static RC osl::FileBase::searchFileURL | ( | const ::rtl::OUString & | ustrFileName,
|  | const ::rtl::OUString & | ustrSearchPath,
|  | ::rtl::OUString & | ustrFileURL
| ) |  |
| inlinestatic

Searche a full qualified system path or a file URL.

Parameters

  ustrFileName | [in] A system dependent path, a file URL, a file or relative directory
  ustrSearchPath | [in] 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.
  ustrFileURL | [out] On success it receives the full qualified file URL.

Returns
  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

See also
  getFileURLFromSystemPath()
  getSystemPathFromFileURL()

The documentation for this class was generated from the following file:

- osl/file.hxx