Pyro higlevel API
|
Filesystem directory class. More...
Classes | |
class | Private |
Public Member Functions | |
Directory () | |
Default contructor. More... | |
Directory (const String &cPath, int nOpenMode=O_RDONLY) | |
Construct a directory from a path. More... | |
Directory (const Directory &cDir, const String &cName, int nOpenMode=O_RDONLY) | |
Construct a directory from a path. More... | |
Directory (const FileReference &cRef, int nOpenMode=O_RDONLY) | |
Construct a directory from a path. More... | |
Directory (const FSNode &cNode) | |
Construct a directory from a path. More... | |
Directory (int nFD) | |
Construct a directory object from a open filedescriptor. More... | |
Directory (const Directory &cDir) | |
Copy constructor. More... | |
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. More... | |
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) |
Window * | CreateDirectoryDialog (const Messenger &cMsgTarget, Message *pcCreateMsg, String cDefaultName) |
Create a dialog which can be used to create a new directory. More... | |
status_t | GetPath (String *pcPath) const |
Get the absolute path of the directory. More... | |
status_t | SetPath (const String &cPath, int nOpenMode=O_RDONLY) |
Open a directory using a path. More... | |
status_t | SetPath (const Path &cPath, int nOpenMode=O_RDONLY) |
Open a directory using a path. More... | |
Public Member Functions inherited from os::FSNode | |
FSNode () | |
Default contructor. More... | |
FSNode (const String &cPath, int nOpenMode=O_RDONLY) | |
Construct a FSNode from a file path. More... | |
FSNode (const Directory &cDir, const String &cName, int nOpenMode=O_RDONLY) | |
Construct a FSNode from directory and a name inside that directory. More... | |
FSNode (const FileReference &cRef, int nOpenMode=O_RDONLY) | |
Construct a FSNode from a file reference. More... | |
FSNode (int nFD) | |
Construct a FSNode from a file descriptor. More... | |
FSNode (const FSNode &cNode) | |
Copy contructor. More... | |
virtual | ~FSNode () |
Destructor. More... | |
virtual status_t | SetTo (const String &cPath, int nOpenMode=O_RDONLY) |
Open a node using a path. More... | |
virtual status_t | SetTo (const Directory &cDir, const String &cPath, int nOpenMode=O_RDONLY) |
Open a node using a dir/path pair. More... | |
virtual status_t | SetTo (const FileReference &cRef, int nOpenMode=O_RDONLY) |
Open the node referred to by the given os::FileReference. More... | |
virtual status_t | SetTo (int nFD) |
Make the FSNode represent an already open file. More... | |
virtual status_t | SetTo (const FSNode &cNode) |
Copy another FSNode. More... | |
virtual void | Unset () |
Reset the FSNode. More... | |
virtual bool | IsValid () const |
Check if the node has been properly initialized. More... | |
virtual status_t | GetStat (struct stat *psStat, bool bUpdateCache=true) const |
virtual ino_t | GetInode () const |
virtual dev_t | GetDev () const |
virtual int | GetMode (bool bUpdateCache=false) const |
virtual off_t | GetSize (bool bUpdateCache=true) const |
virtual time_t | GetCTime (bool bUpdateCache=true) const |
virtual time_t | GetMTime (bool bUpdateCache=true) const |
virtual time_t | GetATime (bool bUpdateCache=true) const |
bool | IsDir () const |
bool | IsLink () const |
bool | IsFile () const |
bool | IsCharDev () const |
bool | IsBlockDev () const |
bool | IsFIFO () const |
virtual status_t | GetNextAttrName (String *pcName) |
Read the node's attribute directory. More... | |
virtual status_t | RewindAttrdir () |
Reset the attribute directory iterator. More... | |
virtual ssize_t | WriteAttr (const String &cAttrName, int nFlags, int nType, const void *pBuffer, off_t nPos, size_t nLen) |
Add/update an attribute. More... | |
virtual ssize_t | ReadAttr (const String &cAttrName, int nType, void *pBuffer, off_t nPos, size_t nLen) |
Read the data held by an attribute. More... | |
virtual status_t | RemoveAttr (const String &cName) |
Remove an attribute from an FS node. More... | |
virtual status_t | StatAttr (const String &cName, struct::attr_info *psBuffer) |
Get extended info about an attribute. More... | |
virtual int | GetFileDescriptor () const |
Public Member Functions inherited from os::DirIterator | |
virtual | ~DirIterator () |
Unlik other FSNode derivated classes it is possible to ask a os::Directory to retrieve it's own path.
Directory::Directory | ( | ) |
Directory::Directory | ( | const String & | cPath, |
int | nOpenMode = O_RDONLY |
||
) |
References os::FSNode::GetFileDescriptor(), os::FSNode::GetMode(), and os::Directory::Private::m_hDirIterator.
Directory::Directory | ( | const FileReference & | cRef, |
int | nOpenMode = O_RDONLY |
||
) |
References os::FSNode::GetFileDescriptor(), os::FSNode::GetMode(), and os::Directory::Private::m_hDirIterator.
Directory::Directory | ( | const FSNode & | cNode | ) |
References os::FSNode::GetFileDescriptor(), os::FSNode::GetMode(), and os::Directory::Private::m_hDirIterator.
Directory::Directory | ( | int | nFD | ) |
nFD | An open filedescriptor referencing a directory. |
References os::FSNode::GetFileDescriptor(), os::FSNode::GetMode(), and os::Directory::Private::m_hDirIterator.
Directory::Directory | ( | const Directory & | cDir | ) |
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.
cDir | The directory to copy |
References os::FSNode::GetFileDescriptor(), and os::Directory::Private::m_hDirIterator.
|
virtual |
References os::Directory::Private::m_hDirIterator.
status_t Directory::CreateDirectory | ( | const String & | cName, |
os::Directory * | pcDir, | ||
int | nAccessMode = S_IRWXU |
||
) |
References os::String::c_str(), os::FSNode::GetFileDescriptor(), and os::FSNode::SetTo().
Referenced by MountDialogWin::Mount().
Window * Directory::CreateDirectoryDialog | ( | const Messenger & | cMsgTarget, |
Message * | pcCreateMsg, | ||
String | cDefaultName | ||
) |
cMsgTarget | - The target that will receive the message. |
pcCreateMsg | - The message that will be sent. |
cDefaultName | - The default name of the new directory. |
References GetPath().
Referenced by os::IconDirectoryView::HandleMessage().
status_t Directory::CreateFile | ( | const String & | cName, |
os::File * | pcFile, | ||
int | nAccessMode = S_IRWXU |
||
) |
References os::String::c_str(), os::FSNode::GetFileDescriptor(), and os::FSNode::SetTo().
status_t Directory::CreateSymlink | ( | const String & | cName, |
const String & | cDestination, | ||
os::SymLink * | pcLink | ||
) |
References os::String::c_str(), os::FSNode::GetFileDescriptor(), and os::SymLink::SetTo().
|
virtual |
References os::String::c_str(), and GetPath().
|
virtual |
Reimplemented from os::FSNode.
References os::Directory::Private::m_hDirIterator.
|
virtual |
Implements os::DirIterator.
References os::Directory::Private::m_hDirIterator.
Referenced by os::Keymap::GetKeymapNames(), GetNextEntry(), os::IconDirectoryView::HandleMessage(), os_priv::DirKeeper::Idle(), and os::TranslatorFactory::LoadAll().
|
virtual |
Implements os::DirIterator.
References GetNextEntry(), and os::FileReference::SetTo().
status_t Directory::GetPath | ( | String * | pcPath | ) | const |
\return |
References os::FSNode::GetFileDescriptor().
Referenced by os::SymLink::ConstructPath(), CreateDirectoryDialog(), Delete(), os::FileReference::GetPath(), and os::FileReference::Rename().
|
virtual |
Implements os::DirIterator.
References os::Directory::Private::m_hDirIterator.
Referenced by os_priv::DirKeeper::DirKeeper(), os_priv::DirKeeper::HandleMessage(), and os::IconDirectoryView::HandleMessage().
status_t Directory::SetPath | ( | const String & | cPath, |
int | nOpenMode = O_RDONLY |
||
) |
status_t Directory::SetPath( const String& cPath, int nOpenMode = O_RDONLY )
cPath
. The path must be valid and it must point to a directory.cPath | The directory to open. |
nOpenMode | Flags describing how to open the directory. Only O_RDONLY, O_WRONLY, and O_RDWR are relevant to directories. Take a look at the os::FSNode documentation for a more detailed description of open modes. |
References os::FSNode::GetFileDescriptor(), os::FSNode::GetMode(), os::Directory::Private::m_hDirIterator, and os::FSNode::SetTo().
status_t Directory::SetPath | ( | const Path & | cPath, |
int | nOpenMode = O_RDONLY |
||
) |
status_t Directory::SetPath( const Path& cPath, int nOpenMode = O_RDONLY )
cPath
. The path must be valid and it must point to a directory.cPath | The directory to open. |
nOpenMode | Flags describing how to open the directory. Only O_RDONLY, O_WRONLY, and O_RDWR are relevant to directories. Take a look at the os::FSNode documentation for a more detailed description of open modes. |
References os::FSNode::GetFileDescriptor(), os::FSNode::GetMode(), os::Path::GetPath(), os::Directory::Private::m_hDirIterator, and os::FSNode::SetTo().