Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include/AdblockPlus/FilterEngine.h

Issue 10254076: API cleanup, get rid of JsObject and GetProperty() methods that don`t return JsValue (Closed)
Patch Set: Slightly better Filter/Subscription constructors Created April 26, 2013, 11:51 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/AdblockPlus/JsValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/FilterEngine.h
===================================================================
--- a/include/AdblockPlus/FilterEngine.h
+++ b/include/AdblockPlus/FilterEngine.h
@@ -8,52 +8,34 @@
#include <AdblockPlus/JsValue.h>
#include "tr1_memory.h"
namespace AdblockPlus
{
class FilterEngine;
- class JsObject : public JsValue
- {
- public:
- std::string GetProperty(const std::string& name, const std::string& defaultValue) const;
- int64_t GetProperty(const std::string& name, int64_t defaultValue) const;
- bool GetProperty(const std::string& name, bool defaultValue) const;
- inline std::string GetProperty(const std::string& name, const char* defaultValue) const
- {
- return GetProperty(name, std::string(defaultValue));
- }
- inline int64_t GetProperty(const std::string& name, int defaultValue) const
- {
- return GetProperty(name, static_cast<int64_t>(defaultValue));
- }
-
- protected:
- JsObject(JsValuePtr value);
- };
-
- class Filter : public JsObject,
+ class Filter : public JsValue,
public std::tr1::enable_shared_from_this<Filter>
{
public:
enum Type {TYPE_BLOCKING, TYPE_EXCEPTION,
TYPE_ELEMHIDE, TYPE_ELEMHIDE_EXCEPTION,
TYPE_COMMENT, TYPE_INVALID};
+ Type GetType();
bool IsListed();
void AddToList();
void RemoveFromList();
bool operator==(const Filter& filter) const;
Filter(JsValuePtr value);
};
- class Subscription : public JsObject,
+ class Subscription : public JsValue,
public std::tr1::enable_shared_from_this<Subscription>
{
public:
bool IsListed();
void AddToList();
void RemoveFromList();
void UpdateFilters();
bool IsUpdating();
« no previous file with comments | « no previous file | include/AdblockPlus/JsValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld