mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-25 09:48:39 +00:00
[C++] Minireflect: Add option to indent when converting table to string (#7602)
Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
committed by
GitHub
parent
f20b0a45b3
commit
83e7a98f69
@@ -407,8 +407,9 @@ struct ToStringVisitor : public IterationVisitor {
|
|||||||
inline std::string FlatBufferToString(const uint8_t *buffer,
|
inline std::string FlatBufferToString(const uint8_t *buffer,
|
||||||
const TypeTable *type_table,
|
const TypeTable *type_table,
|
||||||
bool multi_line = false,
|
bool multi_line = false,
|
||||||
bool vector_delimited = true) {
|
bool vector_delimited = true,
|
||||||
ToStringVisitor tostring_visitor(multi_line ? "\n" : " ", false, "",
|
const std::string& indent = "") {
|
||||||
|
ToStringVisitor tostring_visitor(multi_line ? "\n" : " ", false, indent,
|
||||||
vector_delimited);
|
vector_delimited);
|
||||||
IterateFlatBuffer(buffer, type_table, &tostring_visitor);
|
IterateFlatBuffer(buffer, type_table, &tostring_visitor);
|
||||||
return tostring_visitor.s;
|
return tostring_visitor.s;
|
||||||
|
|||||||
Reference in New Issue
Block a user