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