Author: stippi Date: Tue Mar 9 21:18:48 2010 New Revision: 305 URL: http://mmlr.dyndns.org/changeset/305 Log: Added a whole bunch of setters and getters... not used anywhere, yet. Modified: webkit/trunk/WebKit/haiku/API/NetworkCookie.cpp webkit/trunk/WebKit/haiku/API/NetworkCookie.h Modified: webkit/trunk/WebKit/haiku/API/NetworkCookie.cpp ============================================================================== --- webkit/trunk/WebKit/haiku/API/NetworkCookie.cpp Tue Mar 9 13:49:35 2010 (r304) +++ webkit/trunk/WebKit/haiku/API/NetworkCookie.cpp Tue Mar 9 21:18:48 2010 (r305) @@ -47,6 +47,13 @@ _ParseRawValue(rawValue); } +BNetworkCookie::BNetworkCookie(const BNetworkCookie& other) + : fExpirationDate() + , fRawValue() +{ + *this = other; +} + BNetworkCookie::~BNetworkCookie() { } @@ -59,11 +66,47 @@ return into->AddString("raw value", AsRawValue().String()); } -BString BNetworkCookie::AsRawValue() const +BNetworkCookie& BNetworkCookie::operator=(const BNetworkCookie& other) { - // TODO: Recompose the raw value, once parsing into individual fields - // is implemented. - return fRawValue; + if (this == &other) + return *this; + + fExpirationDate = other.fExpirationDate; + fDomain = other.fDomain; + fPath = other.fPath; + fComment = other.fComment; + fName = other.fName; + fValue = other.fValue; + fIsSecure = other.fIsSecure; + fIsHTTPOnly = other.fIsHTTPOnly; + fRawValue = other.fRawValue; + + return *this; +} + +bool BNetworkCookie::operator==(const BNetworkCookie& other) const +{ + if (this == &other) + return true; + + return fExpirationDate == other.fExpirationDate + && fDomain == other.fDomain + && fPath == other.fPath + && fComment == other.fComment + && fName == other.fName + && fValue == other.fValue + && fIsSecure == other.fIsSecure + && fIsHTTPOnly == other.fIsHTTPOnly; +} + +bool BNetworkCookie::operator!=(const BNetworkCookie& other) const +{ + return !(*this == other); +} + +void BNetworkCookie::SetExpirationDate(const BDateTime& dateTime) +{ + fExpirationDate = dateTime; } const BDateTime& BNetworkCookie::ExpirationDate() const @@ -71,6 +114,83 @@ return fExpirationDate; } +void BNetworkCookie::SetDomain(const BString& domain) +{ + fDomain = domain; +} + +const BString& BNetworkCookie::Domain() const +{ + return fDomain; +} + +void BNetworkCookie::SetPath(const BString& path) +{ + fPath = path; +} + +const BString& BNetworkCookie::Path() const +{ + return fPath; +} + +void BNetworkCookie::SetComment(const BString& comment) +{ + fComment = comment; +} + +const BString& BNetworkCookie::Comment() const +{ + return fComment; +} + +void BNetworkCookie::SetName(const BString& name) +{ + fName = name; +} + +const BString& BNetworkCookie::Name() const +{ + return fName; +} + +void BNetworkCookie::SetValue(const BString& value) +{ + fValue = value; +} + +const BString& BNetworkCookie::Value() const +{ + return fValue; +} + +void BNetworkCookie::SetIsSecure(bool isSecure) +{ + fIsSecure = isSecure; +} + +bool BNetworkCookie::IsSecure() const +{ + return fIsSecure; +} + +void BNetworkCookie::SetIsHTTPOnly(bool isHTTPOnly) +{ + fIsHTTPOnly = isHTTPOnly; +} + +bool BNetworkCookie::IsHTTPOnly() const +{ + return fIsHTTPOnly; +} + +BString BNetworkCookie::AsRawValue() const +{ + // TODO: Recompose the raw value, once parsing into individual fields + // is implemented. + return fRawValue; +} + // #pragma mark - private void BNetworkCookie::_ParseRawValue(const BString& rawValue) Modified: webkit/trunk/WebKit/haiku/API/NetworkCookie.h ============================================================================== --- webkit/trunk/WebKit/haiku/API/NetworkCookie.h Tue Mar 9 13:49:35 2010 (r304) +++ webkit/trunk/WebKit/haiku/API/NetworkCookie.h Tue Mar 9 21:18:48 2010 (r305) @@ -37,19 +37,55 @@ public: BNetworkCookie(const BString& rawValue); BNetworkCookie(const BMessage& archive); + BNetworkCookie(const BNetworkCookie& other); virtual ~BNetworkCookie(); virtual status_t Archive(BMessage* into, bool deep = true) const; - BString AsRawValue() const; + BNetworkCookie& operator=(const BNetworkCookie& other); + bool operator==(const BNetworkCookie& other) const; + bool operator!=(const BNetworkCookie& other) const; + + void SetExpirationDate(const BDateTime& dateTime); const BDateTime& ExpirationDate() const; + void SetDomain(const BString& domain); + const BString& Domain() const; + + void SetPath(const BString& path); + const BString& Path() const; + + void SetComment(const BString& comment); + const BString& Comment() const; + + void SetName(const BString& name); + const BString& Name() const; + + void SetValue(const BString& value); + const BString& Value() const; + + void SetIsSecure(bool isSecure); + bool IsSecure() const; + + void SetIsHTTPOnly(bool isHTTPOnly); + bool IsHTTPOnly() const; + + BString AsRawValue() const; + private: void _ParseRawValue(const BString& rawValue); private: BDateTime fExpirationDate; + BString fDomain; + BString fPath; + BString fComment; + BString fName; + BString fValue; + bool fIsSecure; + bool fIsHTTPOnly; + BString fRawValue; };