Public Member Functions | List of all members
BStatable Class Referenceabstract

Pure abstract class that provides a wrapper interface to the POSIX® stat() function. More...

Inherited by BEntry, and BNode.

Public Member Functions

status_t GetAccessTime (time_t *atime) const
 Fills out atime with the access time of the node. More...
 
status_t GetCreationTime (time_t *ctime) const
 Fills out ctime with the creation time of the node. More...
 
status_t GetGroup (gid_t *group) const
 Fills out the node's GID into group. More...
 
status_t GetModificationTime (time_t *mtime) const
 Fills out mtime with the last modification time of the node. More...
 
status_t GetNodeRef (node_ref *ref) const
 Fills out ref with the node_ref of the node. More...
 
status_t GetOwner (uid_t *owner) const
 Fills out the node's UID into owner. More...
 
status_t GetPermissions (mode_t *permissions) const
 Fills out perms with the permissions of the node. More...
 
status_t GetSize (off_t *size) const
 Fills out the size of the node's data (not counting attributes) into size. More...
 
virtual status_t GetStat (struct stat *stat) const =0
 Fills out the stat structure for the node. More...
 
status_t GetVolume (BVolume *volume) const
 Fills out vol with the the volume that the node lives on. More...
 
bool IsDirectory () const
 Returns whether or not the node is a directory. More...
 
bool IsFile () const
 Returns whether or not the node is a file. More...
 
bool IsSymLink () const
 Returns whether or not the node is a symbolic link. More...
 
status_t SetAccessTime (time_t atime)
 Sets the node's access time to atime. More...
 
status_t SetCreationTime (time_t ctime)
 Sets the node's creation time to ctime. More...
 
status_t SetGroup (gid_t group)
 Sets the node's GID to group. More...
 
status_t SetModificationTime (time_t mtime)
 Sets the node's last modification time to mtime. More...
 
status_t SetOwner (uid_t owner)
 Sets the node's UID to owner. More...
 
status_t SetPermissions (mode_t permissions)
 Sets the node's permissions to perms. More...
 

Detailed Description

Pure abstract class that provides a wrapper interface to the POSIX® stat() function.

BStatable provides common functionality for the BEntry and BNode classes. You can use this class to:

Since
BeOS R3

Member Function Documentation

◆ GetAccessTime()

status_t BStatable::GetAccessTime ( time_t *  atime) const

Fills out atime with the access time of the node.

See also
GetModificationTime()
SetAccessTime()
GetStat() for return codes.
Since
BeOS R3

◆ GetCreationTime()

status_t BStatable::GetCreationTime ( time_t *  ctime) const

Fills out ctime with the creation time of the node.

Parameters
ctimeA pointer to a time_t variable to be set.
See also
SetCreationTime()
GetStat() for return codes.
Since
BeOS R3

◆ GetGroup()

status_t BStatable::GetGroup ( gid_t *  group) const

Fills out the node's GID into group.

Parameters
groupa pointer to a gid_t variable to be set.
See also
SetGroup()
GetStat() for return codes.
Since
BeOS R3

◆ GetModificationTime()

status_t BStatable::GetModificationTime ( time_t *  mtime) const

Fills out mtime with the last modification time of the node.

Parameters
mtimeA pointer to a time_t variable to be set.
See also
SetModificationTime()
GetStat() for return codes.
Since
BeOS R3

◆ GetNodeRef()

status_t BStatable::GetNodeRef ( node_ref ref) const

Fills out ref with the node_ref of the node.

Parameters
refthe node_ref to be set.
See also
GetStat() for return codes.
Since
BeOS R3

◆ GetOwner()

status_t BStatable::GetOwner ( uid_t *  owner) const

Fills out the node's UID into owner.

Parameters
ownerA pointer to a uid_t to be set.
See also
SetOwner()
GetStat() for return codes.
Since
BeOS R3

◆ GetPermissions()

status_t BStatable::GetPermissions ( mode_t *  permissions) const

Fills out perms with the permissions of the node.

Parameters
permissionsThe permissions to get from the node.
See also
SetPermissions()
GetStat() for return codes.
Since
BeOS R3

◆ GetSize()

status_t BStatable::GetSize ( off_t *  size) const

Fills out the size of the node's data (not counting attributes) into size.

Parameters
sizeA pointer to a off_t variable to be set.
See also
GetStat() for return codes.
Since
BeOS R3

◆ GetStat()

status_t BStatable::GetStat ( struct stat *  stat) const
pure virtual

Fills out the stat structure for the node.

This method may be used to access the stat structure of a node directly.

Parameters
statThe stat structure to be filled in.
Returns
A status code.
Return values
B_OKEverything went fine.
B_NO_MEMORYCould not allocate enough memory.
B_BAD_VALUEThe node does not exist.
B_NOT_ALLOWEDNode or volume was read only.
Since
BeOS R3

Implemented in BEntry, and BNode.

◆ GetVolume()

status_t BStatable::GetVolume ( BVolume volume) const

Fills out vol with the the volume that the node lives on.

Parameters
volumeA pointer to a BVolume object to be set.
See also
BVolume
GetStat() for return codes.
Since
Haiku R1

◆ IsDirectory()

bool BStatable::IsDirectory ( ) const

Returns whether or not the node is a directory.

Returns
true, if the node is properly initialized and is a directory, false otherwise.
Since
BeOS R5

◆ IsFile()

bool BStatable::IsFile ( ) const

Returns whether or not the node is a file.

Returns
true, if the node is properly initialized and is a file, false otherwise.
Since
BeOS R5

◆ IsSymLink()

bool BStatable::IsSymLink ( ) const

Returns whether or not the node is a symbolic link.

Returns
true, if the node is properly initialized and is a symlink, false otherwise.
Since
BeOS R5

◆ SetAccessTime()

status_t BStatable::SetAccessTime ( time_t  atime)

Sets the node's access time to atime.

See also
GetModificationTime()
GetStat() for return codes.
Since
BeOS R3

◆ SetCreationTime()

status_t BStatable::SetCreationTime ( time_t  ctime)

Sets the node's creation time to ctime.

Parameters
ctimeThe creation time to set the node to.
See also
GetStat() for return codes.
Since
BeOS R3

◆ SetGroup()

status_t BStatable::SetGroup ( gid_t  group)

Sets the node's GID to group.

Parameters
groupThe GID to set the node to.
See also
GetStat() for return codes.
Since
BeOS R3

◆ SetModificationTime()

status_t BStatable::SetModificationTime ( time_t  mtime)

Sets the node's last modification time to mtime.

Parameters
mtimeThe modification time to set the node to.
See also
GetStat() for return codes.
Since
BeOS R3

◆ SetOwner()

status_t BStatable::SetOwner ( uid_t  owner)

Sets the node's UID to owner.

Parameters
ownerThe UID to set the node to.
See also
GetStat() for return codes.
Since
BeOS R3

◆ SetPermissions()

status_t BStatable::SetPermissions ( mode_t  permissions)

Sets the node's permissions to perms.

Parameters
permissionsThe permissions to set the node to.
See also
GetStat() for return codes.
Since
BeOS R3