Abstract class holding metadata about the file in the filesystem.
More...
#include </home/travis/build/forGGe/theCore/lib/fs/export/ecl/fs/inode.hpp>
Abstract class holding metadata about the file in the filesystem.
◆ type
Possible filesystem entity types.
Enumerator |
---|
file | File entity.
|
dir | Dir entity.
|
◆ inode()
◆ ~inode()
◆ get_type()
◆ open()
Returns the file descriptor, if this inode represents file.
- Precondition
- inode representing file entity.
Meaningless if used on the dir inode.
- Returns
- Pointer to file descriptor.
Reimplemented in ecl::fat::file_inode.
◆ open_dir()
Returns the descriptor associated with this directory.
- Precondition
- inode representing dir entity.
Meaningless if used on file inode.
- Returns
- Pointer to dir descriptor.
Reimplemented in ecl::fat::dir_inode.
◆ size()
virtual err ecl::fs::inode::size |
( |
size_t & |
sz | ) |
const |
|
pure virtual |
Returns size of a file or number of entries in the directory.
- Parameters
-
[out] | sz | Parameter to store either file size (if this inode represents a file) or count of etries in the directory (if this inode represents a dir). |
- Returns
- Status of operation.
Implemented in ecl::fat::dir_inode, and ecl::fat::file_inode.
◆ get_name()
virtual err ecl::fs::inode::get_name |
( |
char * |
buf, |
|
|
size_t & |
buf_sz |
|
) |
| const |
|
pure virtual |
Gets a name of an entity.
- Parameters
-
[in] | buf | Buffer to store name to. |
[in,out] | buf_sz | On entry: size of a buffer. On exit: bytes written excluding null character. If truncation occur then it will store amount of bytes that would have been written if enough space had been avaliable. |
- Returns
- Status of operation.
Implemented in ecl::fat::dir_inode, and ecl::fat::file_inode.
◆ set_weak()
Assigns weak reference to the inode.
Every file or dir descriptor is associated with inode. To simplify memory management, descriptors holds a smart pointer to inode. But descriptor creation is managed inside the same inode, which reference should be passed to the descriptor. Thus, self-reference is required. Setting weak reference helps avoid cyclic dependency. It then can be passed to descriptors in open() and open_dir() methods.
◆ my_ptr
The documentation for this class was generated from the following files: