48 boost::container::static_vector<const std::string*, 16> strings_chain;
52 const auto& str = leaf_node->
value();
53 strings_chain.push_back(&str);
54 leaf_node = leaf_node->
parent();
57 std::reverse(strings_chain.begin(), strings_chain.end());
59 size_t array_count = 0;
62 for (
const auto& str : strings_chain)
64 const size_t S = str->size();
65 if (S == 1 && (*str)[0] ==
'#')
67 buffer[offset++] =
'.';
72 if (str != strings_chain.front())
74 buffer[offset++] =
'/';
76 std::memcpy(&buffer[offset], str->data(), S);
80 buffer[offset] =
'\0';
93 boost::container::static_vector<const std::string*, 16> strings_chain;
95 size_t total_size = 0;
99 const auto& str = leaf_node->
value();
100 leaf_node = leaf_node->
parent();
101 if (!(leaf_node ==
nullptr && skip_root))
103 strings_chain.emplace_back(&str);
104 const size_t S = str.size();
105 if (S == 1 && str[0] ==
'#')
116 out.resize(total_size);
119 std::reverse(strings_chain.begin(), strings_chain.end());
121 size_t array_count = 0;
124 for (
const auto& str : strings_chain)
126 const size_t S = str->size();
127 if (S == 1 && (*str)[0] ==
'#')
129 buffer[offset++] =
'.';
134 if (str != strings_chain.front())
136 buffer[offset++] =
'/';
138 std::memcpy(&buffer[offset], str->data(), S);
int print_number(char *buffer, uint16_t value)
The StringTreeLeaf is, as the name suggests, a leaf (terminal node) of a StringTree. It provides the pointer to the node and a list of numbers that represent the index that corresponds to the placeholder "#".
Element of the tree. it has a single parent and N >= 0 children.
void CreateStringFromTreeLeaf(const StringTreeLeaf &leaf, bool skip_root, std::string &out)
boost::container::static_vector< uint16_t, 8 > index_array
const StringTreeNode * node_ptr
const TreeNode * parent() const
bool toStr(std::string &destination) const
Utility functions to print the entire branch.