[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:
M. Şamil Ateşoğlu 2022-11-11 05:57:29 +03:00 committed by GitHub
parent f20b0a45b3
commit 83e7a98f69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -407,8 +407,9 @@ struct ToStringVisitor : public IterationVisitor {
inline std::string FlatBufferToString(const uint8_t *buffer,
const TypeTable *type_table,
bool multi_line = false,
bool vector_delimited = true) {
ToStringVisitor tostring_visitor(multi_line ? "\n" : " ", false, "",
bool vector_delimited = true,
const std::string& indent = "") {
ToStringVisitor tostring_visitor(multi_line ? "\n" : " ", false, indent,
vector_delimited);
IterateFlatBuffer(buffer, type_table, &tostring_visitor);
return tostring_visitor.s;