Commit db4b4cc5 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

fix toJSONString<JSONObject>

parent 3213aa2e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -248,6 +248,13 @@ void toJSONImpl(const bool& val, O* target) {
  }
}

template <typename O>
void toJSONImpl(const JSONObject& obj, O* target) {
  for (const auto& token : obj) {
    target->emplace_back(token);
  }
}

}
}
#endif
+4 −0
Original line number Diff line number Diff line
@@ -37,6 +37,10 @@ void JSONOutputStream::emplace_back(kTokenType token) {
  emplace_back(token, "");
}

void JSONOutputStream::emplace_back(const JSONToken& token) {
  emplace_back(token.type, token.data);
}

void JSONOutputStream::emplace_back(
    kTokenType token,
    const std::string& data) {
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ public:

  void emplace_back(kTokenType token);
  void emplace_back(kTokenType token, const std::string& data);
  void emplace_back(const JSONToken& token);

  void beginObject();
  void endObject();