OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 static DownloadableSubscription_Parser* BINDINGS_EXPORTED ParseDownload(); | 65 static DownloadableSubscription_Parser* BINDINGS_EXPORTED ParseDownload(); |
66 OwnedString BINDINGS_EXPORTED Serialize() const; | 66 OwnedString BINDINGS_EXPORTED Serialize() const; |
67 }; | 67 }; |
68 | 68 |
69 typedef intrusive_ptr<DownloadableSubscription> DownloadableSubscriptionPtr; | 69 typedef intrusive_ptr<DownloadableSubscription> DownloadableSubscriptionPtr; |
70 | 70 |
71 class DownloadableSubscription_Parser : public ref_counted | 71 class DownloadableSubscription_Parser : public ref_counted |
72 { | 72 { |
73 std::vector<OwnedString> mFiltersText; | 73 std::vector<OwnedString> mFiltersText; |
74 OwnedStringMap<OwnedString> mParams; | 74 OwnedStringMap<OwnedString> mParams; |
75 bool mFirstLine; | |
76 public: | 75 public: |
77 DownloadableSubscription_Parser(); | 76 DownloadableSubscription_Parser(); |
78 void BINDINGS_EXPORTED Process(const String& line); | 77 bool BINDINGS_EXPORTED Process(const String& buffer); |
79 // return the expiration interval. | 78 // return the expiration interval. |
80 int64_t BINDINGS_EXPORTED Finalize(DownloadableSubscription&); | 79 int64_t BINDINGS_EXPORTED Finalize(DownloadableSubscription&); |
81 const String& BINDINGS_EXPORTED GetRedirect() const; | 80 const String& BINDINGS_EXPORTED GetRedirect() const; |
82 const String& BINDINGS_EXPORTED GetHomepage() const; | 81 const String& BINDINGS_EXPORTED GetHomepage() const; |
| 82 const String& BINDINGS_EXPORTED GetError() const |
| 83 { |
| 84 return mError; |
| 85 } |
83 private: | 86 private: |
| 87 DependentString mError; |
| 88 OwnedString mRequiredVersion; |
84 static int64_t ParseExpires(const String& expires); | 89 static int64_t ParseExpires(const String& expires); |
| 90 bool ProcessFirstLine(const String& line); |
| 91 void ProcessLine(const String& line); |
| 92 static bool GetNextLine(DependentString& buffer, DependentString& line); |
85 }; | 93 }; |
86 | 94 |
87 ABP_NS_END | 95 ABP_NS_END |
OLD | NEW |