MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / writeObject

Method writeObject

opt_utils/src/json.cpp:838–854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

836 }
837 }
838 void Writer::writeObject(const Object &node, unsigned int level)
839 {
840 result += "{" + fi->GetNewline();
841
842 for (Object::const_iterator it = node.begin(); it != node.end(); ++it)
843 {
844 const std::string &name = (*it).first;
845 const Node &value = (*it).second;
846
847 if (it != node.begin())
848 result += "," + fi->GetNewline();
849 result += fi->GetIndentation(level+1) + "\""+name+"\"" + ":" + fi->GetSpacing();
850 writeNode(value, level+1);
851 }
852
853 result += fi->GetNewline() + fi->GetIndentation(level) + "}";
854 }
855 void Writer::writeArray(const Array &node, unsigned int level)
856 {
857 result += "[" + fi->GetNewline();

Callers

nothing calls this directly

Calls 3

GetIndentationMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected