os::Directory Class Reference
[The Syllable high level filesystem API]

Filesystem directory class. More...

Inheritance diagram for os::Directory:

os::FSNode os::DirIterator List of all members.

Public Member Functions

 Directory ()
 Default contructor.
 Directory (const String &cPath, int nOpenMode=O_RDONLY)
 Construct a directory from a path.
 Directory (const Directory &cDir, const String &cName, int nOpenMode=O_RDONLY)
 Construct a directory from a path.
 Directory (const FileReference &cRef, int nOpenMode=O_RDONLY)
 Construct a directory from a path.
 Directory (const FSNode &cNode)
 Construct a directory from a path.
 Directory (int nFD)
 Construct a directory object from a open filedescriptor.
 Directory (const Directory &cDir)
 Copy constructor.
virtual ~Directory ()
virtual status_t FDChanged (int nNewFD, const struct stat &sStat)
virtual status_t GetNextEntry (String *pcName)
virtual status_t GetNextEntry (FileReference *pcRef)
virtual status_t Rewind ()
virtual status_t Delete ()
 Delete the directory.
status_t CreateFile (const String &cName, os::File *pcFile, int nAccessMode=S_IRWXU)
status_t CreateDirectory (const String &cName, os::Directory *pcDir, int nAccessMode=S_IRWXU)
status_t CreateSymlink (const String &cName, const String &cDestination, os::SymLink *pcLink)
WindowCreateDirectoryDialog (const Messenger &cMsgTarget, Message *pcCreateMsg, String cDefaultName)
 Create a dialog which can be used to create a new directory.
status_t GetPath (String *pcPath) const
 Get the absolute path of the directory.

Classes

class  Private

Detailed Description

Description:
This class let you iterate over the content of a directory.
Unlik other FSNode derivated classes it is possible to ask a os::Directory to retrieve it's own path.

See also:
FSNode
Author:
Kurt Skauen ([email protected])


Constructor & Destructor Documentation

Directory::Directory (  ) 

Description:
Initiate the instance to a know but invalid state. The instance must be successfully initialized with one of the SetTo() members before it can be used.
Author:
Kurt Skauen ([email protected])

Directory::Directory ( const String cPath,
int  nOpenMode = O_RDONLY 
)

Description:
See: SetTo( const String& cPath, int nOpenMode )
Author:
Kurt Skauen ([email protected])

Directory::Directory ( const Directory cDir,
const String cPath,
int  nOpenMode = O_RDONLY 
)

Description:
See: ( const Directory& cDir, const String& cPath, int nOpenMode )
Author:
Kurt Skauen ([email protected])

Directory::Directory ( const FileReference cRef,
int  nOpenMode = O_RDONLY 
)

Description:
See: SetTo( const FileReference& cRef, int nOpenMode )
Author:
Kurt Skauen ([email protected])

Directory::Directory ( const FSNode cNode  ) 

Description:
See: SetTo( const FSNode& cNode )
Author:
Kurt Skauen ([email protected])

Directory::Directory ( int  nFD  ) 

Description:
Construct a directory object from a open filedescriptor. The file descriptor must be referencing a directory or an errno_exception with the ENOTDIR error code will be thrown.
Parameters:
nFD An open filedescriptor referencing a directory.
Since:
0.3.7
Author:
Kurt Skauen ([email protected])

Directory::Directory ( const Directory cDir  ) 

Description:
Make a independent copy of another directory.
The new directory will consume a new file descriptor so the copy might fail (throwing an errno_exception exception) if the process run out of file descriptors.

Parameters:
cDir The directory to copy
Author:
Kurt Skauen ([email protected])

Directory::~Directory (  )  [virtual]


Member Function Documentation

status_t Directory::FDChanged ( int  nNewFD,
const struct stat &  sStat 
) [virtual]

Reimplemented from os::FSNode.

status_t Directory::GetNextEntry ( String pcName  )  [virtual]

Implements os::DirIterator.

status_t Directory::GetNextEntry ( FileReference pcRef  )  [virtual]

Implements os::DirIterator.

status_t Directory::Rewind (  )  [virtual]

Implements os::DirIterator.

status_t Directory::Delete (  )  [virtual]

Warning: The Directory will be invalid if the call to Delete suceeds.
You should destroy the Directory instance after calling Delete() to remove any references and ensure the directory is removed from the filesystem.
Author:
Kristian Van Der Vliet ([email protected])

status_t Directory::CreateFile ( const String cName,
os::File pcFile,
int  nAccessMode = S_IRWXU 
)

status_t Directory::CreateDirectory ( const String cName,
os::Directory pcDir,
int  nAccessMode = S_IRWXU 
)

status_t Directory::CreateSymlink ( const String cName,
const String cDestination,
os::SymLink pcLink 
)

Window * Directory::CreateDirectoryDialog ( const Messenger cMsgTarget,
Message pcCreateMsg,
String  cDefaultName 
)

Description:
The created window contains an input field where the user can type the name of the new directory. If a new directory has been created, a message will be sent to the supplied message target.
Note:
Don’t forget to place the window at the right position and show it.
Parameters:
cMsgTarget - The target that will receive the message.
pcCreateMsg - The message that will be sent.
cDefaultName - The default name of the new directory.
Author:
Arno Klenke ([email protected])

status_t Directory::GetPath ( String pcPath  )  const

Description:
Note:
Warning:
Parameters:
\return 
Error codes:
See also:
Author:
Kurt Skauen ([email protected])


Generated on Sat May 9 22:51:55 2009 for Syllable higlevel API by  doxygen 1.5.1