Add support for tile plugin

This commit is contained in:
Patrick Niklaus
2016-03-03 01:48:30 +01:00
parent 209d1ada6a
commit 28de928a5d
34 changed files with 457 additions and 243 deletions
-10
View File
@@ -50,15 +50,6 @@ namespace json
struct Object;
struct Array;
// For encoding raw binary data in a JSON response
struct Buffer
{
Buffer() = default;
Buffer(const char *value) : value(value) {}
Buffer(std::string value) : value(std::move(value)) {}
std::string value;
};
struct String
{
String() = default;
@@ -87,7 +78,6 @@ struct Null
};
using Value = mapbox::util::variant<String,
Buffer,
Number,
mapbox::util::recursive_wrapper<Object>,
mapbox::util::recursive_wrapper<Array>,
-15
View File
@@ -25,13 +25,6 @@ struct Renderer
{
explicit Renderer(std::ostream &_out) : out(_out) {}
void operator()(const Buffer &buffer) const
{
out << "\"";
out << escape_JSON(buffer.value);
out << "\"";
}
void operator()(const String &string) const
{
out << "\"";
@@ -88,14 +81,6 @@ struct ArrayRenderer
{
explicit ArrayRenderer(std::vector<char> &_out) : out(_out) {}
void operator()(const Buffer &buffer) const
{
out.push_back('\"');
const auto string_to_insert = escape_JSON(buffer.value);
out.insert(std::end(out), std::begin(string_to_insert), std::end(string_to_insert));
out.push_back('\"');
}
void operator()(const String &string) const
{
out.push_back('\"');