Files
MapLibreParticleLab/include/llmr/style/style_parser.hpp
Justin R. Miller 1215f6f1fe refs #101: data sources with styling
* add second, satellite class to stylesheet
 * get rid of tile clipping masks for now
 * flesh out raster styling properties
2014-04-04 13:24:11 -07:00

44 lines
1.4 KiB
C++

#ifndef LLMR_STYLE_STYLE_PARSER
#define LLMR_STYLE_STYLE_PARSER
#include <rapidjson/document.h>
#include <llmr/style/style.hpp>
namespace llmr {
class StyleParser {
public:
using JSVal = const rapidjson::Value&;
void parseBuckets(JSVal value, std::map<std::string, BucketDescription>& buckets);
void parseLayers(JSVal value, std::vector<LayerDescription>& layers);
void parseConstants(JSVal value);
void parseClasses(JSVal value, std::map<std::string, ClassDescription>& classes);
private:
LayerDescription parseLayer(JSVal value);
BucketDescription parseBucket(JSVal value);
std::pair<std::string, ClassDescription> parseClassDescription(JSVal value);
void parseClass(const std::string& name, JSVal value, ClassDescription& class_desc);
FillClass parseFillClass(JSVal value);
LineClass parseLineClass(JSVal value);
PointClass parsePointClass(JSVal value);
TextClass parseTextClass(JSVal value);
BackgroundClass parseBackgroundClass(JSVal value);
RasterClass parseRasterClass(JSVal value);
bool parseBoolean(JSVal value);
std::string parseString(JSVal value);
Color parseColor(JSVal value);
Value parseValue(JSVal value);
FunctionProperty::fn parseFunctionType(JSVal type);
FunctionProperty parseFunction(JSVal value);
private:
std::map<std::string, const rapidjson::Value *> constants;
};
}
#endif