MCPcopy Create free account
hub / github.com/ElementsProject/elements / writeArray

Method writeArray

src/univalue/lib/univalue_write.cpp:67–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void UniValue::writeArray(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const
68{
69 s += "[";
70 if (prettyIndent)
71 s += "\n";
72
73 for (unsigned int i = 0; i < values.size(); i++) {
74 if (prettyIndent)
75 indentStr(prettyIndent, indentLevel, s);
76 s += values[i].write(prettyIndent, indentLevel + 1);
77 if (i != (values.size() - 1)) {
78 s += ",";
79 }
80 if (prettyIndent)
81 s += "\n";
82 }
83
84 if (prettyIndent)
85 indentStr(prettyIndent, indentLevel - 1, s);
86 s += "]";
87}
88
89void UniValue::writeObject(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const
90{

Callers

nothing calls this directly

Calls 3

indentStrFunction · 0.85
sizeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected