Inheritance diagram for os::FSNode:
Public Member Functions | |
FSNode () | |
Default contructor. | |
FSNode (const String &cPath, int nOpenMode=O_RDONLY) | |
Construct a FSNode from a file path. | |
FSNode (const Directory &cDir, const String &cName, int nOpenMode=O_RDONLY) | |
Construct a FSNode from directory and a name inside that directory. | |
FSNode (const FileReference &cRef, int nOpenMode=O_RDONLY) | |
Construct a FSNode from a file reference. | |
FSNode (int nFD) | |
Construct a FSNode from a file descriptor. | |
FSNode (const FSNode &cNode) | |
Copy contructor. | |
virtual | ~FSNode () |
Destructor. | |
virtual status_t | FDChanged (int nNewFD, const struct stat &sStat) |
virtual status_t | SetTo (const String &cPath, int nOpenMode=O_RDONLY) |
Open a node using a path. | |
virtual status_t | SetTo (const Directory &cDir, const String &cPath, int nOpenMode=O_RDONLY) |
Open a node using a dir/path pair. | |
virtual status_t | SetTo (const FileReference &cRef, int nOpenMode=O_RDONLY) |
Open the node referred to by the given os::FileReference. | |
virtual status_t | SetTo (int nFD) |
Make the FSNode represent an already open file. | |
virtual status_t | SetTo (const FSNode &cNode) |
Copy another FSNode. | |
virtual void | Unset () |
Reset the FSNode. | |
virtual bool | IsValid () const |
Check if the node has been properly initialized. | |
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. | |
virtual status_t | RewindAttrdir () |
Reset the attribute directory iterator. | |
virtual ssize_t | WriteAttr (const String &cAttrName, int nFlags, int nType, const void *pBuffer, off_t nPos, size_t nLen) |
Add/update an attribute. | |
virtual ssize_t | ReadAttr (const String &cAttrName, int nType, void *pBuffer, off_t nPos, size_t nLen) |
Read the data held by an attribute. | |
virtual status_t | RemoveAttr (const String &cName) |
Remove an attribute from an FS node. | |
virtual status_t | StatAttr (const String &cName, struct::attr_info *psBuffer) |
virtual int | GetFileDescriptor () const |
Friends | |
class | Directory |
Classes | |
class | Private |
The native AtheOS filesystem (AFS) support "attributes" wich is extra data-streams associated with filesystem nodes. An attribute can have a specific type like int, float, string, etc etc, or it can be a untyped stream of data. Attributes can be used to store information associated by the file but that don't belong to file content itself (for example the file's icon-image and mime-type).
FSNode::FSNode | ( | ) |
FSNode::FSNode | ( | const String & | cPath, | |
int | nOpenMode = O_RDONLY | |||
) |
FSNode::FSNode | ( | const FileReference & | cRef, | |
int | nOpenMode = O_RDONLY | |||
) |
FSNode::FSNode | ( | int | nFD | ) |
FSNode::FSNode | ( | const FSNode & | cNode | ) |
cNode | The node to copy. |
FSNode::~FSNode | ( | ) | [virtual] |
status_t FSNode::FDChanged | ( | int | nNewFD, | |
const struct stat & | sStat | |||
) | [virtual] |
Reimplemented in os::Directory, and os::File.
status_t FSNode::SetTo | ( | const String & | cPath, | |
int | nOpenMode = O_RDONLY | |||
) | [virtual] |
The nOpenMode
should be a compination of any of the O_* flags defined in <fcntl.h>. Their meaning is the same as when opening a file with the open() POSIX function except you can not create a file by setting the O_CREAT flag.
The following flags are accepted:
cPath
don't point at a directorycPath
points at a symlink
cPath | Path pointing at the node to open. | |
nOpenMode | Flags controlling how to open the node. |
Reimplemented in os::SymLink.
status_t FSNode::SetTo | ( | const Directory & | cDir, | |
const String & | cPath, | |||
int | nOpenMode = O_RDONLY | |||
) | [virtual] |
cDir
will then be ignored) or it can be relative to cDir
. This have much the same semantics as setting the current working directory to cDir
and then open the node by calling SetTo( const String& cPath, int nOpenMode ) with the path. The main advantage with this function is that it is thread-safe. You don't get any races while temporarily changing the current working directory.For a more detailed description look at: SetTo( const String& cPath, int nOpenMode )
cDir | A valid directory from which the cPath is relative to. | |
cPath | The file path relative to cDir . The path can eighter be absoulute (in which case cDir is ignored) or it can be relative to cDir . | |
nOpenMode | Flags controlling how to open the node. See SetTo( const String& cPath, int nOpenMode ) for a full description of the various flags. |
Reimplemented in os::SymLink.
status_t FSNode::SetTo | ( | const FileReference & | cRef, | |
int | nOpenMode = O_RDONLY | |||
) | [virtual] |
Reimplemented in os::SymLink.
status_t FSNode::SetTo | ( | int | nNewFD | ) | [virtual] |
status_t FSNode::SetTo | ( | const FSNode & | cNode | ) | [virtual] |
cNode
. cNode | The FSNode to copy. |
Reimplemented in os::SymLink.
void FSNode::Unset | ( | ) | [virtual] |
bool FSNode::IsValid | ( | void | ) | const [virtual] |
status_t FSNode::GetStat | ( | struct stat * | psStat, | |
bool | bUpdateCache = true | |||
) | const [virtual] |
ino_t FSNode::GetInode | ( | ) | const [virtual] |
dev_t FSNode::GetDev | ( | ) | const [virtual] |
int FSNode::GetMode | ( | bool | bUpdateCache = false |
) | const [virtual] |
off_t FSNode::GetSize | ( | bool | bUpdateCache = true |
) | const [virtual] |
Reimplemented in os::File.
time_t FSNode::GetCTime | ( | bool | bUpdateCache = true |
) | const [virtual] |
time_t FSNode::GetMTime | ( | bool | bUpdateCache = true |
) | const [virtual] |
time_t FSNode::GetATime | ( | bool | bUpdateCache = true |
) | const [virtual] |
bool os::FSNode::IsDir | ( | ) | const [inline] |
bool os::FSNode::IsLink | ( | ) | const [inline] |
bool os::FSNode::IsFile | ( | ) | const [inline] |
bool os::FSNode::IsCharDev | ( | ) | const [inline] |
bool os::FSNode::IsBlockDev | ( | ) | const [inline] |
bool os::FSNode::IsFIFO | ( | ) | const [inline] |
status_t FSNode::GetNextAttrName | ( | String * | pcName | ) | [virtual] |
pcName | Pointer to an STL string that will receive the name. |
status_t FSNode::RewindAttrdir | ( | ) | [virtual] |
ssize_t FSNode::WriteAttr | ( | const String & | cAttrName, | |
int | nFlags, | |||
int | nType, | |||
const void * | pBuffer, | |||
off_t | nPos, | |||
size_t | nLen | |||
) | [virtual] |
cAttrName | The name of the attribute. The name must be unique inside the scope of the node it belongs to. If an attribute already exists with that name it will be overwritten. | |
nFlags | Currently only O_TRUNC is accepted. If you pass in O_TRUNC and a attribute with the same name already exists it will be truncated to a size of 0 before the new attribute data is written. By passing in 0 you can update parts of or extend an existing attribute. | |
nType | The data-type of the attribute. This should be one of the ATTR_TYPE_* types defined in <atheos/filesystem.h>. |
pBuffer | Pointer to the data to be written. | |
nPos | The offset into the attribute where the data will be written. | |
nLen | Number of bytes to be written. |
ssize_t FSNode::ReadAttr | ( | const String & | cAttrName, | |
int | nType, | |||
void * | pBuffer, | |||
off_t | nPos, | |||
size_t | nLen | |||
) | [virtual] |
cAttrName | The name of the attribute to read. | |
nType | The expected attribute type. The attribute must be of this type for the function to succede. See WriteAttr() for a more detailed descritpion of attribute types. |
status_t FSNode::RemoveAttr | ( | const String & | cName | ) | [virtual] |
cName | Name of the attribute to remove. |
virtual status_t os::FSNode::StatAttr | ( | const String & | cName, | |
struct::attr_info * | psBuffer | |||
) | [virtual] |
int FSNode::GetFileDescriptor | ( | ) | const [virtual] |
friend class Directory [friend] |