|
libxr
1.0
Want to be the best embedded framework
|
RamFS 的目录节点片段 / Directory-node fragment of RamFS
More...
#include <dir.hpp>
Public Member Functions | |
| void | Add (File &file) |
| 添加直属文件节点 / Add a direct child file node | |
| void | Add (Dir &dir) |
| 添加直属目录节点 / Add a direct child directory node | |
| void | Add (Custom &custom) |
| 添加直属自定义节点 / Add a direct child custom node | |
| FsNode * | FindNode (const char *name) |
| 查找直属子节点 / Find a direct child node | |
| File * | FindFile (const char *name) |
| 查找直属文件 / Find a direct child file | |
| File * | FindFileRev (const char *name) |
| 递归查找文件 / Find a file recursively | |
| Dir * | FindDir (const char *name) |
| 查找直属目录,支持 "." 和 ".." / Find a direct child directory, supporting "." and ".." | |
| Dir * | FindDirRev (const char *name) |
| 递归查找目录,支持 "." 和 ".." / Find a directory recursively, supporting "." and ".." | |
| Custom * | FindCustom (const char *name) |
| 查找直属自定义节点 / Find a direct child custom node | |
| Custom * | FindCustomRev (const char *name) |
| 递归查找自定义节点 / Find a custom node recursively | |
| template<typename Func > | |
| ErrorCode | Foreach (Func func) |
| 遍历直属子节点 / Iterate over direct child nodes | |
Public Member Functions inherited from FsNode | |
| FsNodeType | GetNodeType () const |
| 获取节点类型 / Get the node type | |
| const char * | GetName () const |
| 获取节点名称 / Get the node name | |
Private Member Functions | |
| Dir () | |
| 构造一个空目录壳 / Construct one empty directory shell | |
| Dir (const char *name) | |
| 构造一个具名目录壳 / Construct one named directory shell | |
| void | AddNode (FsNode &node) |
| 把一个节点挂到当前目录下 / Attach one node under the current directory | |
| FsNode * | FindNodeByType (const char *name, FsNodeType type) |
| 在当前目录按类型查找直属节点 / Find one direct child node of a given type | |
| FsNode * | FindNodeRevByType (const char *name, FsNodeType type) |
| 递归查找指定类型节点 / Find one node of a given type recursively | |
Private Attributes | |
| Tree | rbt_ |
| 当前目录直属子节点的名称索引树 / Name index tree of direct child nodes. | |
Friends | |
| class | RamFS |
Additional Inherited Members | |
Protected Member Functions inherited from FsNode | |
| FsNode (FsNodeType node_type) | |
| 用指定节点类型构造基类部分 / Construct the base node with a given node type | |
| FsNode (const FsNode &other) | |
| 拷贝构造节点基类部分 / Copy-construct the base-node portion | |
| FsNode & | operator= (const FsNode &)=delete |
Protected Attributes inherited from FsNode | |
| const char * | name_ = nullptr |
| 节点名称缓冲区 / Retained node-name buffer. | |
| FsNodeType | type_ |
| 节点运行时类型 / Runtime node type. | |
| Dir * | parent_ |
| 父目录;根目录保持为空 / Parent directory; stays null for the root. | |
| Tree::Node< FsNode * > | tree_node_ |
RamFS 的目录节点片段 / Directory-node fragment of RamFS
目录节点,管理直属子节点 / Directory node that owns a child namespace
|
explicitprivate |
构造一个具名目录壳 / Construct one named directory shell
| name | 目录名称 / Directory name |
|
inline |
|
inline |
|
inline |
|
private |
把一个节点挂到当前目录下 / Attach one node under the current directory
| node | 待挂接节点 / Node to attach |
| Custom * Dir::FindCustom | ( | const char * | name | ) |
查找直属自定义节点 / Find a direct child custom node
| name | 节点名称 / Node name |
| Custom * Dir::FindCustomRev | ( | const char * | name | ) |
递归查找自定义节点 / Find a custom node recursively
| name | 节点名称 / Node name |
| Dir * Dir::FindDir | ( | const char * | name | ) |
查找直属目录,支持 "." 和 ".." / Find a direct child directory, supporting "." and ".."
| name | 目录名 / Directory name |
| Dir * Dir::FindDirRev | ( | const char * | name | ) |
递归查找目录,支持 "." 和 ".." / Find a directory recursively, supporting "." and ".."
| name | 目录名 / Directory name |
| File * Dir::FindFile | ( | const char * | name | ) |
| File * Dir::FindFileRev | ( | const char * | name | ) |
| FsNode * Dir::FindNode | ( | const char * | name | ) |
查找直属子节点 / Find a direct child node
| name | 节点名称 / Node name |
|
private |
在当前目录按类型查找直属节点 / Find one direct child node of a given type
| name | 节点名称 / Node name |
| type | 目标节点类型 / Desired node type |
|
private |
递归查找指定类型节点 / Find one node of a given type recursively
| name | 节点名称 / Node name |
| type | 目标节点类型 / Desired node type |
|
inline |
|
private |