Added String::endsWith().

Added support for "!important" in CSS properties.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2019-11-10 21:58:12 -03:00
parent 78696fc004
commit b0d767c992
5 changed files with 56 additions and 8 deletions

View File

@@ -154,6 +154,20 @@ class EE_API String {
*/
static bool startsWith( const String& haystack, const String& needle );
/** Compare two strings from its end.
* @param haystack The string to search in.
* @param needle The searched string.
* @return true if string starts with the substring
*/
static bool endsWith( const std::string& haystack, const std::string& needle );
/** Compare two strings from its end.
* @param haystack The string to search in.
* @param needle The searched string.
* @return true if string starts with the substring
*/
static bool endsWith( const String& haystack, const String& needle );
/** Replace all occurrences of the search string with the replacement string. */
static void replaceAll( std::string &target, const std::string& that, const std::string& with );

View File

@@ -37,6 +37,9 @@ class EE_API StyleSheetProperty {
std::string mValue;
Uint32 mSpecificity;
bool mVolatile;
bool mImportant;
void checkImportant();
};
typedef std::map<std::string, StyleSheetProperty> StyleSheetProperties;

View File

@@ -1,4 +1,4 @@
#ifndef STYLESHEETSELECTORRULE_HPP
#ifndef STYLESHEETSELECTORRULE_HPP
#define STYLESHEETSELECTORRULE_HPP
#include <eepp/core.hpp>
@@ -68,7 +68,7 @@ class EE_API StyleSheetSelectorRule {
const std::vector<std::string>& getStructuralPseudoClasses() const;
bool hasStructuralPseudoClass(const std::string & cls) const;
protected:
int mSpecificity;
PatternMatch mPatternMatch;
std::string mTagName;