31 auto node = leaf.
node;
32 while(node && node->value())
34 fields.push_back( node->value() );
35 node = node->parent();
43 size_t total_size = 0;
46 total_size +=
field->name().size() + 1;
49 total_size += (2 + 4);
53 out.resize( total_size );
54 char*
buffer =
static_cast<char*
>(&out[0]);
56 size_t array_count = 0;
61 const std::string& str =
field->name();
62 bool is_root = (
field == fields.front() );
65 buffer[offset++] =
'/';
67 std::memcpy( &buffer[offset], str.data(), str.size() );
70 if(!is_root &&
field->isArray())
72 buffer[offset++] =
'[';
77 buffer[offset++] =
']';
80 buffer[offset] =
'\0';
void toStr(std::string &destination) const
Utility functions to print the entire branch.
SmallVector< uint16_t, 4 > index_array
const FieldTreeNode * node
static void reverse(lua_State *L, StkId from, StkId to)
SmallVector< const ROSField *, 8 > fields
A ROSMessage will contain one or more ROSField(s). Each field is little more than a name / type pair...
SmallVector< uint16_t, 4 > index_array
static void field(LexState *ls, ConsControl *cc)
int print_number(char *buffer, uint16_t value)
auto size() const FMT_NOEXCEPT -> size_t
LLVM_VECSMALL_ATTRIBUTE_ALWAYS_INLINE size_type size() const
The FieldTreeLeaf 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 "#".