LibreOffice
LibreOffice 6.0 SDK C/C++ API Reference
Public Member Functions | Static Public Member Functions | Friends | List of all members
osl::DirectoryItem Class Reference

The directory item class object provides access to file status information. More...

#include <file.hxx>

Inheritance diagram for osl::DirectoryItem:
osl::FileBase

Public Member Functions

 DirectoryItem ()
 Constructor. More...
 
 DirectoryItem (const DirectoryItem &rItem)
 Copy constructor. More...
 
 ~DirectoryItem ()
 Destructor. More...
 
DirectoryItemoperator= (const DirectoryItem &rItem)
 Assignment operator. More...
 
bool is ()
 Check for validity of this instance. More...
 
RC getFileStatus (FileStatus &rStatus)
 Retrieve information about a single file or directory. More...
 
bool isIdenticalTo (const DirectoryItem &pOther)
 Determine if a directory item point the same underlying file. More...
 

Static Public Member Functions

static RC get (const ::rtl::OUString &ustrFileURL, DirectoryItem &rItem)
 Retrieve a single directory item. More...
 
- Static Public Member Functions inherited from osl::FileBase
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...
 

Friends

class Directory
 

Additional Inherited Members

- Public Types inherited from osl::FileBase
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_ROFS,
  E_ROFS = osl_File_E_SPIPE, 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
}
 

Detailed Description

The directory item class object provides access to file status information.

See also
FileStatus

Constructor & Destructor Documentation

osl::DirectoryItem::DirectoryItem ( )
inline

Constructor.

osl::DirectoryItem::DirectoryItem ( const DirectoryItem rItem)
inline

Copy constructor.

osl::DirectoryItem::~DirectoryItem ( )
inline

Destructor.

Member Function Documentation

static RC osl::DirectoryItem::get ( const ::rtl::OUString ustrFileURL,
DirectoryItem rItem 
)
inlinestatic

Retrieve a single directory item.

Retrieves a single directory item. The returned handle has an initial refcount of 1. Due to performance issues it is not recommended to use this function while enumerating the contents of a directory. In this case use osl_getNextDirectoryItem() instead.

Parameters
[in]ustrFileURLAn absolute file URL.
[out]rItemOn success it receives a handle which can be used for subsequent calls to osl_getFileStatus(). The handle has to be released by a call to osl_releaseDirectoryItem().
Return values
E_Noneon success
E_INVALthe format of the parameters was not valid
E_NOMEMnot enough memory for allocating structures
E_ACCESpermission denied
E_MFILEtoo many open files used by the process
E_NFILEtoo many open files in the system
E_NOENTno such file or directory
E_LOOPtoo many symbolic links encountered
E_NAMETOOLONGthe file name is too long
E_NOTDIRa component of the path prefix of path is not a directory
E_IOon I/O errors
E_MULTIHOPmultihop attempted
E_NOLINKlink has been severed
E_FAULTbad address
E_INTRthe function call was interrupted
See also
FileStatus
Directory::getNextItem()
RC osl::DirectoryItem::getFileStatus ( FileStatus rStatus)
inline

Retrieve information about a single file or directory.

Parameters
[in,out]rStatusReference to a class which receives the information of the file or directory represented by this directory item.
Return values
E_Noneon success
E_NOMEMnot enough memory for allocating structures
E_INVALthe format of the parameters was not valid
E_LOOPtoo many symbolic links encountered
E_ACCESpermission denied
E_NOENTno such file or directory
E_NAMETOOLONGfile name too long
E_BADFinvalid oslDirectoryItem parameter
E_FAULTbad address
E_OVERFLOWvalue too large for defined data type
E_INTRfunction call was interrupted
E_NOLINKlink has been severed
E_MULTIHOPcomponents of path require hopping to multiple remote machines and the file system does not allow it
E_MFILEtoo many open files used by the process
E_NFILEtoo many open files in the system
E_NOSPCno space left on device
E_NXIOno such device or address
E_IOon I/O errors
E_NOSYSfunction not implemented
See also
get()
Directory::getNextItem()
FileStatus
bool osl::DirectoryItem::is ( )
inline

Check for validity of this instance.

Returns
true if object is valid directory item else false.
bool osl::DirectoryItem::isIdenticalTo ( const DirectoryItem pOther)
inline

Determine if a directory item point the same underlying file.

The comparison is done first by URL, and then by resolving links to find the target, and finally by comparing inodes on unix.

Parameters
[in]pOtherA directory handle to compare with the underlying object's item
Return values
trueif the items point to an identical resource
falseif the items point to a different resource, or a fatal error occurred
See also
osl_getDirectoryItem()
Since
LibreOffice 3.6
DirectoryItem& osl::DirectoryItem::operator= ( const DirectoryItem rItem)
inline

Assignment operator.

Friends And Related Function Documentation

friend class Directory
friend

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