libadblockplus
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
AdblockPlus::Filter Class Reference

Wrapper for an Adblock Plus filter object. More...

#include <FilterEngine.h>

Inheritance diagram for AdblockPlus::Filter:
Inheritance graph
[legend]
Collaboration diagram for AdblockPlus::Filter:
Collaboration graph
[legend]

Public Types

enum  Type {
  TYPE_BLOCKING, TYPE_EXCEPTION, TYPE_ELEMHIDE, TYPE_ELEMHIDE_EXCEPTION,
  TYPE_ELEMHIDE_EMULATION, TYPE_COMMENT, TYPE_INVALID
}
 Filter types, see https://adblockplus.org/en/filters.
 

Public Member Functions

 Filter (const Filter &src)
 
 Filter (Filter &&src)
 
Filteroperator= (const Filter &src)
 
Filteroperator= (Filter &&src)
 
Type GetType () const
 Retrieves the type of this filter. More...
 
bool IsListed () const
 Checks whether this filter has been added to the list of custom filters. More...
 
void AddToList ()
 Adds this filter to the list of custom filters.
 
void RemoveFromList ()
 Removes this filter from the list of custom filters.
 
bool operator== (const Filter &filter) const
 
- Public Member Functions inherited from AdblockPlus::JsValue
 JsValue (JsValue &&src)
 
 JsValue (const JsValue &src)
 
JsValueoperator= (const JsValue &src)
 
JsValueoperator= (JsValue &&src)
 
bool IsUndefined () const
 
bool IsNull () const
 
bool IsString () const
 
bool IsNumber () const
 
bool IsBool () const
 
bool IsObject () const
 
bool IsArray () const
 
bool IsFunction () const
 
std::string AsString () const
 
StringBuffer AsStringBuffer () const
 
int64_t AsInt () const
 
bool AsBool () const
 
JsValueList AsList () const
 
std::vector< std::string > GetOwnPropertyNames () const
 Returns a list of property names if this is an object (see IsObject()). More...
 
JsValue GetProperty (const std::string &name) const
 Returns a property value if this is an object (see IsObject()). More...
 
void SetStringBufferProperty (const std::string &name, const StringBuffer &val)
 Sets a property value string if this is an object (see IsObject()). More...
 
std::string GetClass () const
 Returns the value's class name, e.g. Array for arrays (see IsArray()). More...
 
JsValue Call (const JsValueList &params=JsValueList()) const
 Invokes the value as a function (see IsFunction()). More...
 
JsValue Call (const JsValueList &params, const AdblockPlus::JsValue &thisValue) const
 Invokes the value as a method (see IsFunction()). More...
 
JsValue Call (const JsValue &arg) const
 Invokes the value as a function (see IsFunction()) with single parameter. More...
 
v8::Local< v8::Value > UnwrapValue () const
 
void SetProperty (const std::string &name, const std::string &val)
 Sets a property value if this is an object (see IsObject()). More...
 
void SetProperty (const std::string &name, const StringBuffer &val)
 Sets a property value if this is an object (see IsObject()). More...
 
void SetProperty (const std::string &name, int64_t val)
 Sets a property value if this is an object (see IsObject()). More...
 
void SetProperty (const std::string &name, bool val)
 Sets a property value if this is an object (see IsObject()). More...
 
void SetProperty (const std::string &name, const JsValue &value)
 Sets a property value if this is an object (see IsObject()). More...
 
void SetProperty (const std::string &name, const char *val)
 Sets a property value if this is an object (see IsObject()). More...
 
void SetProperty (const std::string &name, int val)
 Sets a property value if this is an object (see IsObject()). More...
 

Protected Member Functions

 Filter (JsValue &&value)
 Creates a wrapper for an existing JavaScript filter object. More...
 

Friends

class FilterEngine
 

Additional Inherited Members

- Protected Attributes inherited from AdblockPlus::JsValue
JsEnginePtr jsEngine
 

Detailed Description

Wrapper for an Adblock Plus filter object.

There are no accessors for most filter properties, use GetProperty() to retrieve them by name.

Constructor & Destructor Documentation

AdblockPlus::Filter::Filter ( JsValue &&  value)
protected

Creates a wrapper for an existing JavaScript filter object.

Normally you shouldn't call this directly, but use FilterEngine::GetFilter() instead.

Parameters
valueJavaScript filter object.

Member Function Documentation

Type AdblockPlus::Filter::GetType ( ) const

Retrieves the type of this filter.

Returns
Type of this filter.
bool AdblockPlus::Filter::IsListed ( ) const

Checks whether this filter has been added to the list of custom filters.

Returns
true if this filter has been added.

The documentation for this class was generated from the following file: