86 template <
typename Func>
89 return rbt_.Foreach<
FsNode*>([&](Tree::Node<FsNode*>& node)
90 {
return func(*node.data_); });
103 explicit Dir(
const char* name);
RamFS 的自定义节点片段 / Custom-node fragment of RamFS
RamFS 的目录节点片段 / Directory-node fragment of RamFS
Dir * FindDirRev(const char *name)
递归查找目录,支持 "." 和 ".." / Find a directory recursively, supporting "." and ".."
Dir()
构造一个空目录壳 / Construct one empty directory shell
File * FindFileRev(const char *name)
递归查找文件 / Find a file recursively
Dir * FindDir(const char *name)
查找直属目录,支持 "." 和 ".." / Find a direct child directory, supporting "." and ".."
FsNode * FindNodeByType(const char *name, FsNodeType type)
在当前目录按类型查找直属节点 / Find one direct child node of a given type
void AddNode(FsNode &node)
把一个节点挂到当前目录下 / Attach one node under the current directory
void Add(Dir &dir)
添加直属目录节点 / Add a direct child directory node
FsNode * FindNodeRevByType(const char *name, FsNodeType type)
递归查找指定类型节点 / Find one node of a given type recursively
File * FindFile(const char *name)
查找直属文件 / Find a direct child file
FsNode * FindNode(const char *name)
查找直属子节点 / Find a direct child node
ErrorCode Foreach(Func func)
遍历直属子节点 / Iterate over direct child nodes
Tree rbt_
当前目录直属子节点的名称索引树 / Name index tree of direct child nodes.
void Add(Custom &custom)
添加直属自定义节点 / Add a direct child custom node
void Add(File &file)
添加直属文件节点 / Add a direct child file node
Dir(const char *name)
构造一个具名目录壳 / Construct one named directory shell
Custom * FindCustom(const char *name)
查找直属自定义节点 / Find a direct child custom node
Custom * FindCustomRev(const char *name)
递归查找自定义节点 / Find a custom node recursively
RamFS 的文件节点片段 / File-node fragment of RamFS
RamFS 的公共节点基类片段 / Common node-base fragment of RamFS