theCore C++ embedded framework
ecl::fat::dir_inode Class Reference

Metadata class for FATFS filesystem directories. More...

#include </home/travis/build/forGGe/theCore/lib/fs/fat/export/ecl/fat/dir_inode.hpp>

Inheritance diagram for ecl::fat::dir_inode:
Collaboration diagram for ecl::fat::dir_inode:

Public Types

using type = typename ecl::fs::inode::type
 
- Public Types inherited from ecl::fs::inode
enum  type { type::file = 0, type::dir = 1 }
 Possible filesystem entity types. More...
 

Public Member Functions

 dir_inode (FATFS *fs, const allocator &alloc, const char *path=nullptr, const char *name=nullptr)
 Constructs FATFS inode for given directory. More...
 
virtual ~dir_inode ()
 Destroys inode. More...
 
type get_type () const override
 Gets type of entity, represented by the curent inode. More...
 
fs::dir_ptr open_dir () override
 Returns the descriptor associated with this directory. More...
 
err size (size_t &sz) const override
 Returns size of a file or number of entries in the directory. More...
 
err get_name (char *buf, size_t &buf_sz) const override
 Gets a name of an entity. More...
 
dir_inodeoperator= (dir_inode &)=delete
 
 dir_inode (const dir_inode &)=delete
 
- Public Member Functions inherited from ecl::fs::inode
 inode ()
 Constructs inode. More...
 
virtual ~inode ()
 Destroys inode. More...
 
virtual file_ptr open ()
 Returns the file descriptor, if this inode represents file. More...
 
void set_weak (const fs::inode_ptr &ptr)
 Assigns weak reference to the inode. More...
 

Additional Inherited Members

- Protected Attributes inherited from ecl::fs::inode
fs::inode_weak my_ptr
 Weak self-pointer. More...
 

Detailed Description

Metadata class for FATFS filesystem directories.

Member Typedef Documentation

◆ type

Constructor & Destructor Documentation

◆ dir_inode() [1/2]

dir_inode::dir_inode ( FATFS *  fs,
const allocator alloc,
const char *  path = nullptr,
const char *  name = nullptr 
)

Constructs FATFS inode for given directory.

If both name and path are null then this inode represents root node.

Parameters
[in]fsFATFS filesystem object,
[in]allocAllocator, used for internal allocations.
[in]pathPath to a parent dir.
[in]nameName of a dir represented by this inode.
Here is the call graph for this function:

◆ ~dir_inode()

dir_inode::~dir_inode ( )
virtual

Destroys inode.

◆ dir_inode() [2/2]

ecl::fat::dir_inode::dir_inode ( const dir_inode )
delete

Member Function Documentation

◆ get_type()

dir_inode::type dir_inode::get_type ( ) const
overridevirtual

Gets type of entity, represented by the curent inode.

Returns
Type of the entity.

Implements ecl::fs::inode.

◆ open_dir()

ecl::fs::dir_ptr dir_inode::open_dir ( )
overridevirtual

Returns the descriptor associated with this directory.

Precondition
inode representing dir entity.

Meaningless if used on file inode.

Returns
Pointer to dir descriptor.

Reimplemented from ecl::fs::inode.

Here is the call graph for this function:

◆ size()

ecl::err dir_inode::size ( size_t &  sz) const
overridevirtual

Returns size of a file or number of entries in the directory.

Parameters
[out]szParameter 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.

Implements ecl::fs::inode.

◆ get_name()

ecl::err dir_inode::get_name ( char *  buf,
size_t &  buf_sz 
) const
overridevirtual

Gets a name of an entity.

Parameters
[in]bufBuffer to store name to.
[in,out]buf_szOn 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.

Implements ecl::fs::inode.

◆ operator=()

dir_inode& ecl::fat::dir_inode::operator= ( dir_inode )
delete

The documentation for this class was generated from the following files: