44 const char DIGITS[] =
"00010203040506070809" 45 "10111213141516171819" 46 "20212223242526272829" 47 "30313233343536373839" 48 "40414243444546474849" 49 "50515253545556575859" 50 "60616263646566676869" 51 "70717273747576777879" 52 "80818283848586878889" 53 "90919293949596979899";
56 buffer[0] =
static_cast<char>(
'0' + value);
62 buffer[0] = DIGITS[value];
63 buffer[1] = DIGITS[value + 1];
68 return sprintf(buffer,
"%d", value);
81 boost::container::static_vector<const std::string*, 16> strings_chain;
86 const auto& str = leaf_node->
value();
87 const size_t S = str.size();
88 if (S == 1 && str[0] == NUM_PLACEHOLDER)
96 strings_chain.push_back(&str);
97 leaf_node = leaf_node->
parent();
100 std::reverse(strings_chain.begin(), strings_chain.end());
102 size_t array_count = 0;
105 buffer_str.resize(num_bytes);
106 char*
buffer = &buffer_str.front();
108 for (
const auto& str : strings_chain)
110 const size_t S = str->size();
111 if (S == 1 && (*str)[0] == NUM_PLACEHOLDER)
113 buffer[offset++] =
'.';
120 buffer[offset++] = SEPARATOR;
122 std::memcpy(&buffer[offset], str->data(), S);
127 buffer_str.resize(offset);
const TreeNode * parent() const
auto sprintf(const S &fmt, const T &... args) -> std::basic_string< Char >
Element of the tree. it has a single parent and N >= 0 children.
int printNumber(char *buffer, uint16_t value)
int toStr(std::string &destination) const
Utility functions to print the entire branch.