Commit 3213aa2e authored by Paul Asmuth's avatar Paul Asmuth
Browse files

fix fromJSON<JSONObject>

parent 4bf390a5
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -218,6 +218,17 @@ bool fromJSONImpl(
  }
}

template <>
JSONObject fromJSONImpl(
    std::vector<JSONToken>::const_iterator begin,
    std::vector<JSONToken>::const_iterator end) {
  if (begin == end) {
    RAISE(kIndexError);
  }

  return JSONObject(begin, end);
}

} // namespace json

template <>
+9 −2
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include <vector>
#include "fnord/base/buffer.h"
#include "fnord/reflect/reflect.h"
#include "fnord/base/traits.h"

namespace fnord {
namespace json {
@@ -40,7 +41,13 @@ struct JSONToken {

typedef std::vector<JSONToken> JSONObject;

}
}
} // namespace json

template <>
struct TypeIsVector<json::JSONObject> {
  static const bool value = false;
};

} // namespace fnord

#endif