| 65 | } |
| 66 | |
| 67 | void 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 | |
| 89 | void UniValue::writeObject(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const |
| 90 | { |