libxr  1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
fs_node.hpp
1
8 class FsNode
9 {
10 public:
15 [[nodiscard]] FsNodeType GetNodeType() const { return type_; }
16
21 [[nodiscard]] const char* GetName() const { return name_; }
22
23 protected:
24 const char* name_ = nullptr;
25 FsNodeType type_;
26 Dir* parent_ = nullptr;
27
32 explicit FsNode(FsNodeType node_type);
33
43 FsNode(const FsNode& other);
44 FsNode& operator=(const FsNode&) = delete;
45
46 Tree::Node<FsNode*> tree_node_;
47
48 friend class Dir;
49 };
RamFS 的目录节点片段 / Directory-node fragment of RamFS
Definition dir.hpp:9
RamFS 的公共节点基类片段 / Common node-base fragment of RamFS
Definition fs_node.hpp:9
FsNode(FsNodeType node_type)
用指定节点类型构造基类部分 / Construct the base node with a given node type
FsNode(const FsNode &other)
拷贝构造节点基类部分 / Copy-construct the base-node portion
FsNodeType GetNodeType() const
获取节点类型 / Get the node type
Definition fs_node.hpp:15
FsNodeType type_
节点运行时类型 / Runtime node type.
Definition fs_node.hpp:25
Tree::Node< FsNode * > tree_node_
当前节点挂进目录树时使用的树节点包装 / Tree node wrapper used when inserted into a directory tree.
Definition fs_node.hpp:46
const char * GetName() const
获取节点名称 / Get the node name
Definition fs_node.hpp:21
Dir * parent_
父目录;根目录保持为空 / Parent directory; stays null for the root.
Definition fs_node.hpp:26
const char * name_
节点名称缓冲区 / Retained node-name buffer.
Definition fs_node.hpp:24