22 #ifndef MAPCSS_PARSER_HPP 23 #define MAPCSS_PARSER_HPP 32 #include <boost/filesystem/path.hpp> 52 void load(
const string& path);
MapCssParser(const shared_ptr< Geodata > &geodata)
Initializes the parser.
SelectorPtr createChildSelectorFromObjectType(const SelectorPtr &next, const shared_ptr< Rule > &rule, obj::ObjectTypeEnum objType)
Creates a selector, selecting children of the specified type.
fsio::vector< op::UnaryTypesEnum, string > UnaryCondition
Stores informations about an unary condition.
SelectorPtr createSelectorFromBinaryCondition(const SelectorPtr &next, const shared_ptr< Rule > &rule, const BinaryCondition &condition)
Creates a selector using an binary operator.
SelectorPtr createSelectorFromCondition(const SelectorPtr &next, const shared_ptr< Rule > &rule, const ConditionType &condition)
Creates a selector for a given condition.
shared_ptr< Selector > SelectorPtr
Shortcut for a shared pointer to the base of all selectors.
shared_ptr< Geodata > geodata
The geodata used to inject them in the rules.
Thrown if the parsing fails.
shared_ptr< Stylesheet > parsedStylesheet
The parsed stylesheet.
A Stylesheet parses a given MapCSS Stylesheet file and stores the defined rules.
fsio::vector< string, op::BinaryTypesEnum, string > BinaryCondition
Stores informations about an binary condition.
shared_ptr< Rule > RulePtr
Shortcut for a shared pointer to rule.
shared_ptr< StyleTemplate > StylePtr
Shortcut for a shared pointer to style.
RulePtr createSelectorChain(const std::vector< SelectorItem > &items)
Creates a chain of selectors from given subselectors.
SelectorPtr createSelectorFromObjectType(const SelectorPtr &next, const shared_ptr< Rule > &rule, obj::ObjectTypeEnum objType, Rule::AcceptableTypes &type)
Creates an selector used to match geoobject types.
boost::variant< UnaryCondition, BinaryCondition > ConditionType
Possible Conditions.
void addAttributeToTemplate(StylePtr &style, const shared_ptr< AttributeCreator > &attrType, const string &specifier, const ParseInfo &info)
Converts a given string into a text position.
ObjectTypeEnum
Enum with object selectors.
excp::ParseException catchedException
The exception that may be catched.
SelectorPtr createSelectorFromUnaryCondition(const SelectorPtr &next, const shared_ptr< Rule > &rule, const UnaryCondition &condition)
Creates a selector using an unary operator.
void applyStyleToRules(std::vector< RulePtr > &rules, const StylePtr &style)
Sets a given style as the style of given rules.
shared_ptr< ParserLogger > logger
Output logger for errors and warnings.
void load(const string &path)
Loads a file from the given path and tries to parse the content into a stylesheet.
void warnUnsupportedAttribute(const string &attribute) const
Emits a warning for unknown mapcss attribute.