diff options
Diffstat (limited to 'amalgamate/crow_all.h')
-rw-r--r-- | amalgamate/crow_all.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/amalgamate/crow_all.h b/amalgamate/crow_all.h index 41b06ff..7922ab9 100644 --- a/amalgamate/crow_all.h +++ b/amalgamate/crow_all.h @@ -4698,6 +4698,24 @@ namespace crow return (*o)[str]; } + std::vector<std::string> keys() const { + std::vector<std::string> 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_) @@ -4738,7 +4756,6 @@ namespace crow return 1; } - friend void dump_internal(const wvalue& v, std::string& out); friend std::string dump(const wvalue& v); }; |