aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--amalgamate/crow_all.h45
-rw-r--r--include/crow/json.h19
2 files changed, 18 insertions, 46 deletions
diff --git a/amalgamate/crow_all.h b/amalgamate/crow_all.h
index 77fb663..0c88e5d 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 e2d116c..3d9ed18 100644
--- a/include/crow/json.h
+++ b/include/crow/json.h
@@ -1333,6 +1333,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_)
@@ -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);
};