1 /* 2 * Copyright (c) Huawei Technologies Co., Ltd. 2020-2023. All rights reserved. 3 * Description: Implementation for Css style parser. 4 * Create: 2020/03/31 5 */ 6 7 #ifndef CSS_STYLE_PARSER_H 8 #define CSS_STYLE_PARSER_H 9 10 #include <string> 11 #include <unordered_map> 12 #include <vector> 13 14 using ClassStyleMap = std::unordered_map<std::string, std::unordered_map<std::string, std::string>>; 15 16 class CssStyleParser { 17 public: 18 void parseCssStyle(const std::string& style); 19 const std::unordered_map<std::string, std::string>& getArributesMap(const std::string& key) const; 20 static std::vector<std::string> splitString(const std::string& srcString, const std::string& splitString); 21 22 private: 23 ClassStyleMap fStyleMap; 24 }; 25 #endif 26