diff --git a/amalgamate/crow_all.h b/amalgamate/crow_all.h index 77fb663b2..0c88e5d3d 100644 --- a/amalgamate/crow_all.h +++ b/amalgamate/crow_all.h @@ -9660,48 +9660,3 @@ namespace crow #pragma once - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/include/crow/json.h b/include/crow/json.h index e2d116c5c..3d9ed1818 100644 --- a/include/crow/json.h +++ b/include/crow/json.h @@ -1333,6 +1333,24 @@ namespace crow return (*o)[str]; } + std::vector keys() const { + std::vector result; + switch (t_) { + case type::Null: return result; + case type::False: return result; + case type::True: return result; + case type::Number: return result; + case type::String: return result; + case type::List: return result; + case type::Object: { + for (auto& kv:*o) { + result.push_back(kv.first); + } + return result; + } + } + } + size_t estimate_length() const { switch(t_) @@ -1373,7 +1391,6 @@ namespace crow return 1; } - friend void dump_internal(const wvalue& v, std::string& out); friend std::string dump(const wvalue& v); };