37 SetAvailableSpaceForStrings();
42 std::string result{
""};
49 fFlagForVerticalLines.at(level-2) =
true;
51 for(
int i = 0; i < level-2; ++i) {
52 if (fFlagForVerticalLines.at(i)) {
58 result +=
"|__Field ";
66 std::string nameAndType{field.
GetName() +
" (" + field.
GetType() +
")"};
75 for (
int i = 0; i < fWidth; ++i) {
76 fOutput << fFrameSymbol;
80 fOutput << fFrameSymbol <<
' ';
84 fOutput << fFrameSymbol << std::endl;
93 if (level > fDeepestLevel)
94 fDeepestLevel = level;
101 int strSize{
static_cast<int>(str.size())};
102 if (strSize <= availableSpace)
103 return str + std::string(availableSpace - strSize,
' ');
104 else if (availableSpace < 3)
105 return std::string(availableSpace,
'.');
106 return std::string(str, 0, availableSpace - 3) +
"...";
115 while (parentPtr && (parentPtr->GetLevelInfo().GetOrder() != -1)) {
116 hierarchialOrder = std::to_string(parentPtr->GetLevelInfo().GetOrder()) +
"." + hierarchialOrder;
117 parentPtr = parentPtr->GetParent();
119 return hierarchialOrder;
std::string GetName() const
RLevelInfo GetLevelInfo() const
std::string GetType() const
const RFieldBase * GetParent() const
void VisitField(const Detail::RFieldBase &field, int level) final
std::vector< bool > fFlagForVerticalLines
Keeps track when | is used for the tree-like structure.
void SetDeepestLevel(int d)
std::string MakeValueString(const Detail::RFieldBase &field)
ValueString refers to the right side containing the type and name.
void VisitField(const Detail::RFieldBase &field, int level) final
Prints summary of Field.
std::string MakeKeyString(const Detail::RFieldBase &field, int level)
KeyString refers to the left side containing the word "Field" and its hierarchial order.
int GetOrder(const RFieldBase *field=nullptr) const
int GetNumSiblings(const RFieldBase *field=nullptr) const