summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CSS.cpp6
-rw-r--r--src/core/CSS.hpp9
-rw-r--r--src/core/Tokenizer.hpp2
3 files changed, 13 insertions, 4 deletions
diff --git a/src/core/CSS.cpp b/src/core/CSS.cpp
index c3900e8..d131fec 100644
--- a/src/core/CSS.cpp
+++ b/src/core/CSS.cpp
@@ -20,6 +20,12 @@
namespace ousia {
+void RuleSet::merge(Rooted<RuleSet> other){
+ for(auto& o : other->rules){
+ rules[o.first] = o.second;
+ }
+}
+
/*
* different versions of "getChildren".
*/
diff --git a/src/core/CSS.hpp b/src/core/CSS.hpp
index 4cf15be..aa701b5 100644
--- a/src/core/CSS.hpp
+++ b/src/core/CSS.hpp
@@ -85,10 +85,11 @@ public:
return rules;
}
- void merge(Rooted<RuleSet> other)
- {
- rules.insert(other->rules.begin(), other->rules.end());
- }
+ /**
+ * This implements an overriding "insert all" of all rules in the other
+ * RuleSet to the rules in this RuleSet.
+ */
+ void merge(Rooted<RuleSet> other);
};
/**
diff --git a/src/core/Tokenizer.hpp b/src/core/Tokenizer.hpp
index 4aebf56..8f80150 100644
--- a/src/core/Tokenizer.hpp
+++ b/src/core/Tokenizer.hpp
@@ -225,6 +225,8 @@ public:
void consumePeek();
const BufferedCharReader &getInput() const { return input; }
+
+ BufferedCharReader &getInput() { return input; }
};
}