UDK 3.2.7 C/C++ API Reference
Public Member Functions | Static Public Member Functions
osl::Directory Class Reference

The directory class object provides a enumeration of DirectoryItems. More...

#include <file.hxx>

Inheritance diagram for osl::Directory:
osl::FileBase

List of all members.

Public Member Functions

 Directory (const ::rtl::OUString &strPath)
 Constructor.
 ~Directory ()
 Destructor.
RC open ()
 Open a directory for enumerating its contents.
sal_Bool isOpen ()
 Query if directory is open.
RC close ()
 Close a directory.
RC reset ()
 Resets the directory item enumeration to the beginning.
RC getNextItem (DirectoryItem &rItem, sal_uInt32 nHint=0)
 Retrieve the next item of a previously opened directory.

Static Public Member Functions

static RC getVolumeInfo (const ::rtl::OUString &ustrDirectoryURL, VolumeInfo &rInfo)
 Retrieve information about a volume.
static RC create (const ::rtl::OUString &ustrDirectoryURL)
 Create a directory.
static RC remove (const ::rtl::OUString &ustrDirectoryURL)
 Remove an empty directory.
static RC createPath (const ::rtl::OUString &aDirectoryUrl, DirectoryCreationObserver *aDirectoryCreationObserver=NULL)
 Create a directory path.

Detailed Description

The directory class object provides a enumeration of DirectoryItems.

See also:
DirectoryItem
File

Constructor & Destructor Documentation

osl::Directory::Directory ( const ::rtl::OUString strPath) [inline]

Constructor.

Parameters:
strPath[in] The full qualified URL of the directory. Relative URLs are not allowed.
osl::Directory::~Directory ( ) [inline]

Destructor.


Member Function Documentation

RC osl::Directory::close ( ) [inline]

Close a directory.

Returns:
E_None on success E_INVAL the format of the parameters was not valid E_NOMEM not enough memory for allocating structures E_BADF invalid oslDirectory parameter E_INTR the function call was interrupted
See also:
open()
static RC osl::Directory::create ( const ::rtl::OUString ustrDirectoryURL) [inline, static]

Create a directory.

Parameters:
ustrDirectoryURL[in] Full qualified URL of the directory to create.
Returns:
E_None on success E_INVAL the format of the parameters was not valid E_NOMEM not enough memory for allocating structures E_EXIST file exists E_ACCES permission denied E_NAMETOOLONG file name too long 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 E_LOOP too many symbolic links encountered E_FAULT bad address E_IO on I/O errors E_MLINK too many links E_MULTIHOP multihop attempted E_NOLINK link has been severed
See also:
remove()
static RC osl::Directory::createPath ( const ::rtl::OUString aDirectoryUrl,
DirectoryCreationObserver aDirectoryCreationObserver = NULL 
) [inline, static]

Create a directory path.

The osl_createDirectoryPath function creates a specified directory path. All nonexisting sub directories will be created.

PLEASE NOTE: You cannot rely on getting the error code E_EXIST for existing directories. Programming against this error code is in general a strong indication of a wrong usage of osl_createDirectoryPath.

Parameters:
aDirectoryUrl[in] The absolute file URL of the directory path to create. A relative file URL will not be accepted.
aDirectoryCreationObserver[in] Pointer to an instance of type DirectoryCreationObserver that will be informed about the creation of a directory. The value of this parameter may be NULL, in this case notifications will not be sent.
Returns:
E_None
On success
E_INVAL
The format of the parameters was not valid
E_ACCES
Permission denied
E_EXIST
The final node of the specified directory path already exist
E_NAMETOOLONG
The name of the specified directory path exceeds the maximum allowed length
E_NOTDIR
A component of the specified directory path already exist as file in any part of the directory path
E_ROFS
Read-only file system
E_NOSPC
No space left on device
E_DQUOT
Quota exceeded
E_FAULT
Bad address
E_IO
I/O error
E_LOOP
Too many symbolic links encountered
E_NOLINK
Link has been severed
E_invalidError
An unknown error occurred
See also:
DirectoryCreationObserver
create
RC osl::Directory::getNextItem ( DirectoryItem rItem,
sal_uInt32  nHint = 0 
) [inline]

Retrieve the next item of a previously opened directory.

Retrieves the next item of a previously opened directory.

Parameters:
rItem[out] On success a valid DirectoryItem.
nHint[in] With this parameter the caller can tell the implementation that (s)he is going to call this function uHint times afterwards. This enables the implementation to get the information for more than one file and cache it until the next calls.
Returns:
E_None on success E_INVAL the format of the parameters was not valid E_NOMEM not enough memory for allocating structures E_NOENT no more entries in this directory E_BADF invalid oslDirectory parameter E_OVERFLOW the value too large for defined data type
See also:
DirectoryItem
static RC osl::Directory::getVolumeInfo ( const ::rtl::OUString ustrDirectoryURL,
VolumeInfo rInfo 
) [inline, static]

Retrieve information about a volume.

Retrieves information about a volume. A volume can either be a mount point, a network resource or a drive depending on Operating System and File System.

Parameters:
ustrDirectoryURL[in] Full qualified URL of the volume
rInfo[out] On success it receives information about the volume.
Returns:
E_None on success E_NOMEM not enough memory for allocating structures E_INVAL the format of the parameters was not valid E_NOTDIR not a directory E_NAMETOOLONG file name too long E_NOENT no such file or directory E_ACCES permission denied E_LOOP too many symbolic links encountered E_FAULT Bad address E_IO on I/O errors E_NOSYS function not implemented E_MULTIHOP multihop attempted E_NOLINK link has been severed E_INTR function call was interrupted
See also:
FileStatus
VolumeInfo
sal_Bool osl::Directory::isOpen ( ) [inline]

Query if directory is open.

Query if directory is open and so item enumeration is valid.

Returns:
sal_True if the directory is open else sal_False.
See also:
open()
close()
RC osl::Directory::open ( ) [inline]

Open a directory for enumerating its contents.

Returns:
E_None on success E_INVAL the format of the parameters was not valid E_NOENT the specified path doesn't exist E_NOTDIR the specified path is not an directory E_NOMEM not enough memory for allocating structures E_ACCES permission denied E_MFILE too many open files used by the process E_NFILE too many open files in the system E_NAMETOOLONG File name too long E_LOOP Too many symbolic links encountered
See also:
getNextItem()
close()
static RC osl::Directory::remove ( const ::rtl::OUString ustrDirectoryURL) [inline, static]

Remove an empty directory.

Parameters:
ustrDirectoryURL[in] Full qualified URL of the directory.
Returns:
E_None on success E_INVAL the format of the parameters was not valid E_NOMEM not enough memory for allocating structures E_PERM operation not permitted E_ACCES permission denied E_NOENT no such file or directory E_NOTDIR not a directory E_NOTEMPTY directory not empty E_FAULT bad address E_NAMETOOLONG file name too long E_BUSY device or resource busy E_ROFS read-only file system E_LOOP too many symbolic links encountered E_BUSY device or resource busy E_EXIST file exists E_IO on I/O errors E_MULTIHOP multihop attempted E_NOLINK link has been severed
See also:
create()
RC osl::Directory::reset ( ) [inline]

Resets the directory item enumeration to the beginning.

Returns:
E_None on success E_INVAL the format of the parameters was not valid E_NOENT the specified path doesn't exist E_NOTDIR the specified path is not an directory E_NOMEM not enough memory for allocating structures E_ACCES permission denied E_MFILE too many open files used by the process E_NFILE too many open files in the system E_NAMETOOLONG File name too long E_LOOP Too many symbolic links encountered
See also:
open()

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines