diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/JAWS/clients/Caching/URL_Properties.cpp | 31 | ||||
-rw-r--r-- | apps/JAWS/clients/Caching/URL_Properties.h | 8 | ||||
-rw-r--r-- | apps/JAWS/clients/Caching/URL_Properties.i | 8 |
3 files changed, 43 insertions, 4 deletions
diff --git a/apps/JAWS/clients/Caching/URL_Properties.cpp b/apps/JAWS/clients/Caching/URL_Properties.cpp index a3465a607ad..e2806aefd2d 100644 --- a/apps/JAWS/clients/Caching/URL_Properties.cpp +++ b/apps/JAWS/clients/Caching/URL_Properties.cpp @@ -1,4 +1,4 @@ -// URL_Locator.cpp +// URL_Properties.cpp // $Id$ #if !defined (ACE_URL_PROPERTIES_C) @@ -12,6 +12,7 @@ #endif /* __ACE_INLINE__ */ #include "ace/OS.h" +#include "ace/Auto_Ptr.h" template <class T> size_t ace_array_bsize (T &x) @@ -44,6 +45,15 @@ void ace_array_decode (void *buf, T &x) } } +void wstring_dump (const char *n, ACE_WString *wstr) +{ + if (wstr == 0) + ACE_DEBUG ((LM_DEBUG, "%s: %x\n", n, wstr)); + else + ACE_DEBUG ((LM_DEBUG, "%s: %x (\"%s\")\n", n, wstr, + ACE_Auto_Basic_Array_Ptr<char> (wstr->char_rep ()).get ())); +} + void ACE_URL_Property::encode (void *buf) const { @@ -74,6 +84,15 @@ ACE_URL_Property::decode (void *buf) return this ; } +void +ACE_URL_Property::dump (void) const +{ + ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); + wstring_dump ("\n name_", this->name_); + wstring_dump (" value_", this->value_); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +} + size_t ACE_URL_Offer::bsize (void) const { @@ -112,4 +131,14 @@ ACE_URL_Offer::decode (void *buf) return this; } +void +ACE_URL_Offer::dump (void) const +{ + ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); + ACE_DEBUG ((LM_DEBUG, "\n URL: %s\n", this->url_)); + for (int i = 0; i < this->prop_.size (); i++) + this->prop_[i].dump (); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +} + #endif /* ACE_URL_PROPERTIES_C */ diff --git a/apps/JAWS/clients/Caching/URL_Properties.h b/apps/JAWS/clients/Caching/URL_Properties.h index a2aa6d93e09..39bac483e8b 100644 --- a/apps/JAWS/clients/Caching/URL_Properties.h +++ b/apps/JAWS/clients/Caching/URL_Properties.h @@ -77,6 +77,9 @@ public: // Decodes buf and modifies this object, you should // probably create this with default ctor. + void dump (void) const; + // Dump out this object for debug. + protected: ACE_WString *name_; // Property name pointer. @@ -137,6 +140,9 @@ public: // Decodes buf into current object, you better use // the default ctor. + void dump (void) const; + // Dump this object for debug. + protected: char *url_; // URL of this offer. @@ -145,7 +151,7 @@ protected: // Properties associate with this offer. private: - ACE_UNIMPLEMENTED_FUNC (ACE_URL_Offer (void)) + // ACE_UNIMPLEMENTED_FUNC (ACE_URL_Offer (void)) // Do not allow access to default constructor }; diff --git a/apps/JAWS/clients/Caching/URL_Properties.i b/apps/JAWS/clients/Caching/URL_Properties.i index 3d7b1aa7080..d0ca4d73378 100644 --- a/apps/JAWS/clients/Caching/URL_Properties.i +++ b/apps/JAWS/clients/Caching/URL_Properties.i @@ -134,8 +134,12 @@ ACE_URL_Property::value (const ACE_USHORT16 *v) ACE_INLINE size_t ACE_URL_Property::bsize (void) const { - return (this->name_->length () + this->value_->length () + 2) * - sizeof (ACE_USHORT16); + size_t len = 2; + if (this->name_ != 0) + len += this->name_->length (); + if (this->value_ != 0) + len += this->value_->length (); + return len * sizeof (ACE_USHORT16); } ACE_INLINE |