|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
路径树节点 更多...
#include <path_tree.hpp>
Public 类型 | |
| using | ptr = shared_ptr<node> |
| 节点共享指针 | |
| using | weak_ptr = _NEFORCE weak_ptr<node> |
| 节点弱指针 | |
| using | children_list = vector<ptr> |
| 子节点列表 | |
Public 成员函数 | |
| node (path p, node_type type, size_t depth=0) | |
| 构造节点 | |
| const path & | get_path () const noexcept |
| 获取路径 | |
| node_type | type () const noexcept |
| 获取节点类型 | |
| size_t | depth () const noexcept |
| 获取节点深度 | |
| bool | is_directory () const noexcept |
| 是否为目录 | |
| bool | is_file () const noexcept |
| 是否为文件 | |
| bool | is_root () const noexcept |
| 是否为根节点 | |
| bool | is_leaf () const noexcept |
| 是否为叶节点(无子节点) | |
| ptr | parent () const noexcept |
| 获取父节点 | |
| const children_list & | children () const noexcept |
| 获取子节点列表 | |
| size_t | child_count () const noexcept |
| 获取子节点数量 | |
| ptr | find_child (string_view name) const noexcept |
| 按名称查找直接子节点 | |
| void | add_child (ptr child) |
| 添加子节点 | |
| bool | remove_child (string_view name) noexcept |
| 移除指定子节点 | |
| Public 成员函数 继承自 enable_shared_from_this< node > | |
| shared_ptr< node > | shared_from_this () |
| 获取指向自身的共享指针 | |
额外继承的成员函数 | |
| Protected 成员函数 继承自 enable_shared_from_this< node > | |
| enable_shared_from_this () noexcept=default | |
| 构造函数 | |
| void path_tree::node::add_child | ( | ptr | child | ) |
添加子节点
| child | 子节点共享指针 |
|
nodiscardnoexcept |
|
noexcept |