| Index: include/AdblockPlus/FilterEngine.h |
| =================================================================== |
| --- a/include/AdblockPlus/FilterEngine.h |
| +++ b/include/AdblockPlus/FilterEngine.h |
| @@ -47,23 +47,23 @@ namespace AdblockPlus |
| enum Type {TYPE_BLOCKING, TYPE_EXCEPTION, |
| TYPE_ELEMHIDE, TYPE_ELEMHIDE_EXCEPTION, |
| TYPE_COMMENT, TYPE_INVALID}; |
| /** |
| * Retrieves the type of this filter. |
| * @return Type of this filter. |
| */ |
| - Type GetType(); |
| + Type GetType() const; |
| /** |
| * Checks whether this filter has been added to the list of custom filters. |
| * @return `true` if this filter has been added. |
| */ |
| - bool IsListed(); |
| + bool IsListed() const; |
| /** |
| * Adds this filter to the list of custom filters. |
| */ |
| void AddToList(); |
| /** |
| * Removes this filter from the list of custom filters. |
| @@ -90,17 +90,17 @@ namespace AdblockPlus |
| class Subscription : public JsValue, |
| public std::enable_shared_from_this<Subscription> |
| { |
| public: |
| /** |
| * Checks if this subscription has been added to the list of subscriptions. |
| * @return `true` if this subscription has been added. |
| */ |
| - bool IsListed(); |
| + bool IsListed() const; |
| /** |
| * Adds this subscription to the list of subscriptions. |
| */ |
| void AddToList(); |
| /** |
| * Removes this subscription from the list of subscriptions. |
| @@ -112,17 +112,17 @@ namespace AdblockPlus |
| * subscription URL. |
| */ |
| void UpdateFilters(); |
| /** |
| * Checks if the subscription is currently being updated. |
| * @return `true` if the subscription is currently being updated. |
| */ |
| - bool IsUpdating(); |
| + bool IsUpdating() const; |
| bool operator==(const Subscription& subscription) const; |
| /** |
| * Creates a wrapper for an existing JavaScript subscription object. |
| * Normally you shouldn't call this directly, but use |
| * FilterEngine::GetSubscription() instead. |
| * @param value JavaScript subscription object. |
| @@ -274,24 +274,24 @@ namespace AdblockPlus |
| bool IsFirstRun() const; |
| /** |
| * Retrieves a filter object from its text representation. |
| * @param text Text representation of the filter, |
| * see https://adblockplus.org/en/filters. |
| * @return New `Filter` instance. |
| */ |
| - FilterPtr GetFilter(const std::string& text); |
| + FilterPtr GetFilter(const std::string& text) const; |
| /** |
| * Retrieves a subscription object for the supplied URL. |
| * @param url Subscription URL. |
| * @return New `Subscription` instance. |
| */ |
| - SubscriptionPtr GetSubscription(const std::string& url); |
| + SubscriptionPtr GetSubscription(const std::string& url) const; |
| /** |
| * Retrieves the list of custom filters. |
| * @return List of custom filters. |
| */ |
| std::vector<FilterPtr> GetListedFilters() const; |
| /** |
| @@ -406,17 +406,17 @@ namespace AdblockPlus |
| */ |
| void SetPref(const std::string& pref, JsValuePtr value); |
| /** |
| * Extracts the host from a URL. |
| * @param url URL to extract the host from. |
| * @return Extracted host. |
| */ |
| - std::string GetHostFromURL(const std::string& url); |
| + std::string GetHostFromURL(const std::string& url) const; |
| /** |
| * Sets the callback invoked when an application update becomes available. |
| * @param callback Callback to invoke. |
| */ |
| void SetUpdateAvailableCallback(UpdateAvailableCallback callback); |
| /** |
| @@ -457,29 +457,29 @@ namespace AdblockPlus |
| * stored value. |
| */ |
| void SetAllowedConnectionType(const std::string* value); |
| /** |
| * Retrieves previously stored allowed connection type. |
| * @return Preference value, or `nullptr` if it doesn't exist. |
| */ |
| - std::unique_ptr<std::string> GetAllowedConnectionType(); |
| + std::unique_ptr<std::string> GetAllowedConnectionType() const; |
| /** |
| * Compares two version strings in |
| * [Mozilla toolkit version format](https://developer.mozilla.org/en/docs/Toolkit_version_format). |
| * @param v1 First version string. |
| * @param v2 Second version string. |
| * @return |
| * - `0` if `v1` and `v2` are identical. |
| * - A negative number if `v1` is less than `v2`. |
| * - A positive number if `v1` is greater than `v2`. |
| */ |
| - int CompareVersions(const std::string& v1, const std::string& v2); |
| + int CompareVersions(const std::string& v1, const std::string& v2) const; |
| /** |
| * Retrieves the `ContentType` for the supplied string. |
| * @param contentType Content type string. |
| * @return The `ContentType` for the string. |
| * @throw `std::invalid_argument`, if an invalid `contentType` was supplied. |
| */ |
| static ContentType StringToContentType(const std::string& contentType); |