HTTPMethod::Get and HTTPMethod::OPTIONS to HTTPMethod::Options.
VS2019 error:
enum "crow::HTTPMethod" has no member "HEAD"
enum "crow::HTTPMethod" has no member "GET"
enum "crow::HTTPMethod" has no member "OPTIONS"
See https://github.com/ipkn/crow/pull/307 for a similar issue.
Added pop() method to query_string, same as get(), but removes the item from the querystring
Added std::string() operator to json::rvalue (allows std::string(json["abc"]), which returns any value that isn't a container to string)
Added lo() method to json::rvalue, returns a vector of json::rvalue containing whatever a json object or list has (difference being a list has no keys)
Added keys() method to json::rvalue, returns a vector of std::string containing the keys of a json object
Made json::wvalue use either std::map or std::unordered_map instead of just std::unordered_map
Added copy constructor to json::wvalue
Added size() method to json::wvalue, returns 1 or the size of the json list.
Added constructor to create json::wvalue from std::vector
Added keys() method to query_string
Documented query_string and improved json doc
Made tests and examples for all the additions
cmake 3.19 complained about Line 49:
> CMake Error at examples/CMakeLists.txt:49 (target_link_libraries):
> The keyword signature for target_link_libraries has already been used with
> the target "basic_example". All uses of target_link_libraries with a
> target must be either all-keyword or all-plain.
>
> The uses of the keyword signature are here:
>
> * examples/CMakeLists.txt:46 (target_link_libraries)
The reason is the missing keyword PRIVATE/INTERFACE/PUBLIC in the offending line.
This edit fixes this.
Here is the modified catchall-function
example added
the code moved to routing.h
only the setter remained in app.h
the integer return is removed
i personally don't need the default parameters:
without crow::response the catchall can take no effect
and without crow::request you know nothing about the request
i only imagine one case, this is to set custom error pages.
so i don't thing default parameters have any big benefit here.
"#ifdef CROW_CATCHALL" was only for me, to find my own modifications feel free to replace it