From c0f642df5278b2c36378433159a8e444659d671e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 31 Jan 2010 12:36:18 +0000 Subject: [PATCH] 2010-01-31 Tatsuhiro Tsujikawa Fixed compile error on Mac OS X. * src/CookieStorage.h --- ChangeLog | 5 +++++ src/CookieStorage.h | 39 ++++++++------------------------------- 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index adcdda81..7644ac0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-01-31 Tatsuhiro Tsujikawa + + Fixed compile error on Mac OS X. + * src/CookieStorage.h + 2010-01-31 Tatsuhiro Tsujikawa Removed cookietest.txt from Makefile.am diff --git a/src/CookieStorage.h b/src/CookieStorage.h index 84121a6e..1d343725 100644 --- a/src/CookieStorage.h +++ b/src/CookieStorage.h @@ -54,32 +54,6 @@ public: static const size_t MAX_COOKIE_PER_DOMAIN = 50; - class FindCookie:public std::unary_function { - private: - std::string _requestHost; - std::string _requestPath; - time_t _date; - bool _secure; - public: - FindCookie(const std::string& requestHost, - const std::string& requestPath, - time_t date, bool secure): - _requestHost(requestHost), - _requestPath(requestPath), - _date(date), - _secure(secure) {} - - bool operator()(Cookie& cookie) const - { - if(cookie.match(_requestHost, _requestPath, _date, _secure)) { - cookie.updateLastAccess(); - return true; - } else { - return false; - } - } - }; - class DomainEntry { private: std::string _key; @@ -102,11 +76,14 @@ public: const std::string& requestPath, time_t date, bool secure) { - OutputIterator last = - std::remove_copy_if - (_cookies.begin(), _cookies.end(), out, - std::not1(FindCookie(requestHost, requestPath, date, secure))); - return last; + for(std::deque::iterator i = _cookies.begin(); + i != _cookies.end(); ++i) { + if((*i).match(requestHost, requestPath, date, secure)) { + (*i).updateLastAccess(); + out++ = *i; + } + } + return out; } size_t countCookie() const