From c7fd76090acd08adef144fdc5439a1dee38eca6a Mon Sep 17 00:00:00 2001 From: "warren%netscape.com" Date: Tue, 23 Mar 1999 02:32:09 +0000 Subject: [PATCH] Added stuff to dump out hex. Removed SetCookieString -- didn't make sense. --- rdf/brprof/public/nsIBrowsingProfile.h | 2 -- rdf/brprof/src/nsBrowsingProfile.cpp | 17 ++++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/rdf/brprof/public/nsIBrowsingProfile.h b/rdf/brprof/public/nsIBrowsingProfile.h index 74da2cd32a10..557c1d053bc4 100644 --- a/rdf/brprof/public/nsIBrowsingProfile.h +++ b/rdf/brprof/public/nsIBrowsingProfile.h @@ -78,8 +78,6 @@ public: NS_IMETHOD GetCookieString(char buf[kBrowsingProfileCookieSize]) = 0; - NS_IMETHOD SetCookieString(char buf[kBrowsingProfileCookieSize]) = 0; - NS_IMETHOD GetDescription(char* *htmlResult) = 0; NS_IMETHOD CountPageVisit(const char* url) = 0; diff --git a/rdf/brprof/src/nsBrowsingProfile.cpp b/rdf/brprof/src/nsBrowsingProfile.cpp index b0037f98a592..b65df0790786 100644 --- a/rdf/brprof/src/nsBrowsingProfile.cpp +++ b/rdf/brprof/src/nsBrowsingProfile.cpp @@ -69,7 +69,6 @@ public: NS_IMETHOD GetVector(nsBrowsingProfileVector& result); NS_IMETHOD SetVector(nsBrowsingProfileVector& value); NS_IMETHOD GetCookieString(char buf[kBrowsingProfileCookieSize]); - NS_IMETHOD SetCookieString(char buf[kBrowsingProfileCookieSize]); NS_IMETHOD GetDescription(char* *htmlResult); NS_IMETHOD CountPageVisit(const char* url); @@ -225,14 +224,14 @@ nsBrowsingProfile::SetVector(nsBrowsingProfileVector& value) NS_IMETHODIMP nsBrowsingProfile::GetCookieString(char buf[kBrowsingProfileCookieSize]) { - // XXX translate mVector to hex - return NS_OK; -} - -NS_IMETHODIMP -nsBrowsingProfile::SetCookieString(char buf[kBrowsingProfileCookieSize]) -{ - // XXX translate hex to mVector + // translate mVector to hex + char hexMap[] = "0123456789ABCDEF"; + PRUint8* vector = (PRUint8*)&mVector; + for (PRUint32 i = 0; i < sizeof(mVector); i++) { + char c = vector[i]; + *buf++ = hexMap[c >> 4]; + *buf++ = hexMap[c & 0x0F]; + } return NS_OK; }