summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-09-12 19:18:32 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-09-12 19:18:32 +0000
commit918b4da1d85bb0e6638336e37928dd614f7e2ed2 (patch)
treeae247cae928683fdd192fa59acfc40cd9bdd3be0
parent085c665016be54ef79a0debda1807685d41c9282 (diff)
downloadATCD-918b4da1d85bb0e6638336e37928dd614f7e2ed2.tar.gz
ChangeLogTag:Wed Sep 12 13:53:14 2001 Nanbor Wang <nanbor@cs.wustl.edu>
-rw-r--r--ace/SString.h189
-rw-r--r--ace/SString.i245
-rw-r--r--netsvcs/clients/Naming/Client/Client_Test.cpp14
-rw-r--r--netsvcs/lib/Name_Handler.cpp40
-rw-r--r--netsvcs/lib/Name_Handler.h12
-rw-r--r--tests/Naming_Test.cpp88
-rw-r--r--tests/SString_Test.cpp12
7 files changed, 138 insertions, 462 deletions
diff --git a/ace/SString.h b/ace/SString.h
index 8cd0bb676e7..437d97de138 100644
--- a/ace/SString.h
+++ b/ace/SString.h
@@ -32,112 +32,58 @@ typedef ACE_USHORT16 ACE_WSTRING_TYPE;
typedef ACE_String_Base<char> ACE_CString;
-template ACE_CString operator + (const ACE_CString &,
- const ACE_CString &);
#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
ACE_Export ostream &operator << (ostream &, const ACE_CString &);
#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */
+typedef ACE_String_Base<ACE_WSTRING_TYPE> ACE_WString;
+
+#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
+ACE_Export ostream &operator << (ostream &, const ACE_WString &);
+#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */
+
/**
- * @class ACE_WString
*
- * @brief This class provides a wrapper facade for C wide strings.
*
- * This class uses an <ACE_Allocator> to allocate memory. The
- * user can make this a persistant class by providing an
- * <ACE_Allocator> with a persistable memory pool. This class is
- * optimized for efficiency, so it doesn't provide any internal
- * locking.
+ *
*/
-class ACE_Export ACE_WString
+class ACE_Export ACE_NS_WString : public ACE_WString
{
public:
- /// No position constant
- static const int npos;
-
/// Default constructor.
- ACE_WString (ACE_Allocator *alloc = 0);
+ ACE_NS_WString (ACE_Allocator *alloc = 0);
/// Constructor that copies <s> into dynamically allocated memory.
- ACE_WString (const char *s,
- ACE_Allocator *alloc = 0);
+ ACE_NS_WString (const char *s,
+ ACE_Allocator *alloc = 0);
/// Constructor that copies <s> into dynamically allocated memory.
- ACE_WString (const ACE_WSTRING_TYPE *s,
- ACE_Allocator *alloc = 0);
+ ACE_NS_WString (const ACE_WSTRING_TYPE *s,
+ ACE_Allocator *alloc = 0);
#if defined (ACE_WSTRING_HAS_USHORT_SUPPORT)
/// Constructor that takes in a ushort16 string (mainly used by the
/// ACE Name_Space classes)
- ACE_WString (const ACE_USHORT16 *s,
- size_t len,
- ACE_Allocator *alloc = 0);
+ ACE_NS_WString (const ACE_USHORT16 *s,
+ size_t len,
+ ACE_Allocator *alloc = 0);
#endif /* ACE_WSTRING_HAS_USHORT_SUPPORT */
/// Constructor that copies <len> ACE_WSTRING_TYPE's of <s> into dynamically
/// allocated memory (will NUL terminate the result).
- ACE_WString (const ACE_WSTRING_TYPE *s,
- size_t len,
- ACE_Allocator *alloc = 0);
+ ACE_NS_WString (const ACE_WSTRING_TYPE *s,
+ size_t len,
+ ACE_Allocator *alloc = 0);
/// Constructor that dynamically allocates memory for <len> + 1
/// ACE_WSTRING_TYPE characters. The newly created memory is set memset to 0.
- ACE_WString (size_t len, ACE_Allocator *alloc = 0);
+ ACE_NS_WString (size_t len, ACE_Allocator *alloc = 0);
/// Copy constructor.
- ACE_WString (const ACE_WString &s);
+ ACE_NS_WString (const ACE_NS_WString &s);
/// Constructor that copies <c> into dynamically allocated memory.
- ACE_WString (ACE_WSTRING_TYPE c, ACE_Allocator *alloc = 0);
-
- /// Deletes the memory...
- ~ACE_WString (void);
-
- /// Return the <slot'th> character in the string (doesn't perform
- /// bounds checking).
- ACE_WSTRING_TYPE operator [] (size_t slot) const;
-
- /// Return the <slot'th> character by reference in the string
- /// (doesn't perform bounds checking).
- ACE_WSTRING_TYPE &operator [] (size_t slot);
-
- /// Assignment operator (does copy memory).
- ACE_WString &operator = (const ACE_WString &);
-
- /// Copy <s>
- void set (const ACE_WSTRING_TYPE *s);
-
- /// Copy <len> bytes of <s> (will NUL terminate the result)
- void set (const ACE_WSTRING_TYPE *s,
- size_t len);
-
- /**
- * Return a substring given an offset and length, if length == -1
- * use rest of str return empty substring if offset or offset/length
- * are invalid.
- */
- ACE_WString substring (size_t offset, ssize_t length = -1) const;
-
- /// Same as substring
- ACE_WString substr (size_t offset, ssize_t length = -1) const;
-
- /// Concat operator (does copy memory).
- ACE_WString &operator += (const ACE_WString &);
-
- /// Concat operator (does copy memory)
- ACE_WString &operator += (const ACE_WSTRING_TYPE *);
-
- /// Returns a hash value for this string.
- u_long hash (void) const;
-
- /// Return the length of the string.
- size_t length (void) const;
-
- /// Return the size of the buffer.
- size_t buffer_size(void) const;
-
- /// Gets a copy of the underlying pointer.
- ACE_WSTRING_TYPE *rep (void) const;
+ ACE_NS_WString (ACE_WSTRING_TYPE c, ACE_Allocator *alloc = 0);
/// Transform into a copy of the ASCII character representation.
/// (caller must delete)
@@ -146,99 +92,8 @@ public:
/// Transform into a copy of a USHORT16 representation (caller must
/// delete). Note, behavior is undefined when sizeof (wchar_t) != 2.
ACE_USHORT16 *ushort_rep (void) const;
-
- /// Get at the underlying representation directly!
- const ACE_WSTRING_TYPE *fast_rep (void) const;
-
- /// Same as STL String's <c_str> and <fast_rep>.
- const ACE_WSTRING_TYPE *c_str (void) const;
-
- /// Comparison operator that will match substrings. Returns the
- /// slot of the first location that matches, else -1.
- int strstr (const ACE_WString &s) const;
-
- /// Find <str> starting at pos. Returns the slot of the first
- /// location that matches (will be >= pos), else npos.
- int find (const ACE_WString &str, int pos = 0) const;
-
- /// Find <s> starting at pos. Returns the slot of the first
- /// location that matches (will be >= pos), else npos.
- int find (const ACE_WSTRING_TYPE *s, int pos = 0) const;
-
- /// Find <c> starting at pos. Returns the slot of the first
- /// location that matches (will be >= pos), else npos.
- int find (ACE_WSTRING_TYPE c, int pos = 0) const;
-
- /// Find <c> starting at pos (counting from the end). Returns the
- /// slot of the first location that matches, else npos.
- int rfind (ACE_WSTRING_TYPE c, int pos = npos) const;
-
- /// Equality comparison operator (must match entire string).
- int operator == (const ACE_WString &s) const;
-
- /// Less than comparison operator.
- int operator < (const ACE_WString &s) const;
-
- /// Greater than comparison operator.
- int operator > (const ACE_WString &s) const;
-
- /// Inequality comparison operator.
- int operator != (const ACE_WString &s) const;
-
- /// Performs a <strcmp>-style comparison.
- int compare (const ACE_WString &s) const;
-
- /// Dump the state of an object.
- void dump (void) const;
-
- /// Declare the dynamic allocation hooks.
- ACE_ALLOC_HOOK_DECLARE;
-
- /// Computes the length of a "0" terminated ACE_WSTRING_TYPE *.
- static size_t strlen (const ACE_WSTRING_TYPE *);
-
- /// Traditional style strstr
- static const ACE_WSTRING_TYPE *strstr (const ACE_WSTRING_TYPE *s1,
- const ACE_WSTRING_TYPE *s2);
-
- /**
- * This method is designed for high-performance. Please use with
- * care ;-) If the current size of the string is less than <len>,
- * the string is resized to the new length. The data is zero'd
- * out after this operation.
- */
- void resize (size_t len);
-
-private:
- /**
- * This method checks the size of the buffer. If the size of the
- * buffer is not large enough the buffer will be resized. All new
- * allocated space is zero'd out after this operation.
- */
- void check_allocate (size_t len);
-
- /// Pointer to a memory allocator.
- ACE_Allocator *allocator_;
-
- /// Size of the buffer of the ACE_WString
- size_t buf_len_;
-
- /// Length of the ACE_WString.
- size_t len_;
-
- /// Pointer to data.
- ACE_WSTRING_TYPE *rep_;
-
- /// Represents the "NULL" string to simplify the internal logic.
- static ACE_WSTRING_TYPE NULL_WString_;
};
-ACE_Export ACE_INLINE ACE_WString operator+ (const ACE_WString &,
- const ACE_WString &);
-#if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
-ACE_Export ostream &operator << (ostream &, const ACE_WString &);
-#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */
-
/**
* @class ACE_SString
*
diff --git a/ace/SString.i b/ace/SString.i
index e15015178b6..3dbcb91de08 100644
--- a/ace/SString.i
+++ b/ace/SString.i
@@ -4,6 +4,39 @@
#include "ace/Malloc_Base.h"
ACE_INLINE
+ACE_NS_WString::ACE_NS_WString (ACE_Allocator *alloc)
+ : ACE_WString (alloc)
+{
+}
+
+ACE_INLINE
+ACE_NS_WString::ACE_NS_WString (const ACE_WSTRING_TYPE *s,
+ size_t len,
+ ACE_Allocator *alloc)
+ : ACE_WString (s, len, alloc)
+{
+}
+
+ACE_INLINE
+ACE_NS_WString::ACE_NS_WString (size_t len, ACE_Allocator *alloc)
+ : ACE_WString (len, alloc)
+{
+}
+
+ACE_INLINE
+ACE_NS_WString::ACE_NS_WString (const ACE_NS_WString &s)
+ : ACE_WString (s)
+{
+}
+
+ACE_INLINE
+ACE_NS_WString::ACE_NS_WString (ACE_WSTRING_TYPE c, ACE_Allocator *alloc)
+ : ACE_WString (c, alloc)
+{
+}
+
+
+ACE_INLINE
ACE_SString::~ACE_SString (void)
{
}
@@ -172,218 +205,6 @@ ACE_SString::length (void) const
return this->len_;
}
-
-ACE_INLINE size_t
-ACE_WString::length (void) const
-{
- ACE_TRACE ("ACE_WString::length");
- return this->len_;
-}
-
-ACE_INLINE ACE_WString
-operator+ (const ACE_WString &s,
- const ACE_WString &t)
-{
- ACE_WString temp (s.length () + t.length ());
- temp = s;
- temp += t;
- return temp;
-}
-
-ACE_INLINE ACE_WString
-ACE_WString::substr (size_t offset,
- ssize_t length) const
-{
- return this->substring (offset, length);
-}
-
-// Get a copy of the underlying representation.
-
-ACE_INLINE ACE_WSTRING_TYPE *
-ACE_WString::rep (void) const
-{
- ACE_TRACE ("ACE_WString::rep");
-
- ACE_WSTRING_TYPE *t;
- ACE_NEW_RETURN (t,
- ACE_WSTRING_TYPE[this->len_ + 1],
- 0);
- ACE_OS::memcpy (t,
- this->rep_,
- this->len_ * sizeof (ACE_WSTRING_TYPE));
-
- // 0 terminate
- t[this->len_] = 0;
-
- return t;
-}
-
-// Get at the underlying representation directly!
-
-ACE_INLINE const ACE_WSTRING_TYPE *
-ACE_WString::fast_rep (void) const
-{
- if (this->rep_ == 0)
- return &ACE_WString::NULL_WString_;
- else
- return this->rep_;
-}
-
-ACE_INLINE const ACE_WSTRING_TYPE *
-ACE_WString::c_str (void) const
-{
- if (this->rep_ == 0)
- return &ACE_WString::NULL_WString_;
- else
- return this->rep_;
-}
-
-// Comparison operator.
-
-ACE_INLINE int
-ACE_WString::operator== (const ACE_WString &s) const
-{
- ACE_TRACE ("ACE_WString::operator==");
- return this->len_ == s.len_
- && ACE_OS::memcmp ((const void *) this->rep_,
- (const void *) s.rep_,
- this->len_ * sizeof (ACE_WSTRING_TYPE)) == 0;
-}
-
-// Less than comparison operator.
-
-ACE_INLINE int
-ACE_WString::operator < (const ACE_WString &s) const
-{
- ACE_TRACE ("ACE_WString::operator <");
- return this->len_ < s.len_
- ? ACE_OS::memcmp ((const void *) this->rep_,
- (const void *) s.rep_,
- this->len_ * sizeof (ACE_WSTRING_TYPE)) <= 0
- : ACE_OS::memcmp ((const void *) this->rep_,
- (const void *) s.rep_,
- s.len_ * sizeof (ACE_WSTRING_TYPE)) < 0;
-}
-
-// Greater than comparison operator.
-
-ACE_INLINE int
-ACE_WString::operator > (const ACE_WString &s) const
-{
- ACE_TRACE ("ACE_WString::operator >");
- return this->len_ <= s.len_
- ? ACE_OS::memcmp ((const void *) this->rep_,
- (const void *) s.rep_,
- this->len_ * sizeof (ACE_WSTRING_TYPE)) > 0
- : ACE_OS::memcmp ((const void *) this->rep_,
- (const void *) s.rep_,
- s.len_ * sizeof (ACE_WSTRING_TYPE)) >= 0;
-}
-
-// Comparison operator.
-
-ACE_INLINE int
-ACE_WString::operator!= (const ACE_WString &s) const
-{
- ACE_TRACE ("ACE_WString::operator!=");
- return !(*this == s);
-}
-
-ACE_INLINE int
-ACE_WString::compare (const ACE_WString &s) const
-{
- ACE_TRACE ("ACE_WString::compare");
-
- return ACE_OS::memcmp ((const void *) this->rep_,
- (const void *) s.rep_,
- this->len_ * sizeof (ACE_WSTRING_TYPE));
-}
-
-// Return the <slot'th> character in the string.
-
-ACE_INLINE ACE_WSTRING_TYPE
-ACE_WString::operator[] (size_t slot) const
-{
- ACE_TRACE ("ACE_WString::operator[]");
- return this->rep_[slot];
-}
-
-// Return the <slot'th> character in the string.
-
-ACE_INLINE ACE_WSTRING_TYPE &
-ACE_WString::operator[] (size_t slot)
-{
- ACE_TRACE ("ACE_WString::operator[]");
- return this->rep_[slot];
-}
-
-ACE_INLINE int
-ACE_WString::find (const ACE_WSTRING_TYPE *s, int pos) const
-{
- ACE_WSTRING_TYPE *substr = this->rep_ + pos;
- const ACE_WSTRING_TYPE *pointer = ACE_WString::strstr (substr, s);
- if (pointer == 0)
- return ACE_WString::npos;
- else
- return pointer - this->rep_;
-}
-
-ACE_INLINE int
-ACE_WString::find (ACE_WSTRING_TYPE c, int pos) const
-{
- if (pos == ACE_WString::npos)
- pos = this->len_;
-
- for (size_t i = pos; i < this->len_; i++)
- if (this->rep_[i] == c)
- return ACE_static_cast (int, i);
-
- return ACE_WString::npos;
-}
-
-ACE_INLINE int
-ACE_WString::strstr (const ACE_WString &s) const
-{
- ACE_TRACE ("ACE_WString::strstr");
-
- return this->find (s.rep_);
-}
-
-ACE_INLINE int
-ACE_WString::find (const ACE_WString &str, int pos) const
-{
- return this->find (str.rep_, pos);
-}
-
-ACE_INLINE int
-ACE_WString::rfind (ACE_WSTRING_TYPE c, int pos) const
-{
- if (pos == ACE_WString::npos)
- pos = this->len_;
-
- for (int i = pos - 1; i >= 0; i--)
- if (this->rep_[i] == c)
- return i;
-
- return ACE_WString::npos;
-}
-
-ACE_INLINE size_t
-ACE_WString::buffer_size(void) const
-{
- ACE_TRACE ("ACE_WString::buffer_size");
- return this->buf_len_;
-}
-
-ACE_INLINE u_long
-ACE_WString::hash (void) const
-{
- return ACE::hash_pjw
- (ACE_reinterpret_cast (char *, ACE_const_cast (ACE_WSTRING_TYPE *,
- this->rep_)),
- this->len_ * sizeof (ACE_WSTRING_TYPE));
-}
-
ACE_INLINE
ACE_Auto_String_Free::ACE_Auto_String_Free (char* p)
: p_ (p)
diff --git a/netsvcs/clients/Naming/Client/Client_Test.cpp b/netsvcs/clients/Naming/Client/Client_Test.cpp
index 2df1e540275..72c7e9b8494 100644
--- a/netsvcs/clients/Naming/Client/Client_Test.cpp
+++ b/netsvcs/clients/Naming/Client/Client_Test.cpp
@@ -34,7 +34,7 @@ public:
void list_options (void);
// Print name options
- int bind (const char *key,
+ int bind (const char *key,
const char *value,
const char *type = "");
// Bind a key to a value
@@ -129,8 +129,8 @@ Client_Test::open (void)
this->display_menu ();
if (ACE_Event_Handler::register_stdin_handler (this,
- ACE_Reactor::instance (),
- ACE_Thread_Manager::instance ()) == -1)
+ ACE_Reactor::instance (),
+ ACE_Thread_Manager::instance ()) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
"register_stdin_handler"),
@@ -438,7 +438,7 @@ Client_Test::unbind (const char *key)
}
int
-Client_Test::rebind (const char *key,
+Client_Test::rebind (const char *key,
const char *value,
const char *type)
{
@@ -460,7 +460,7 @@ Client_Test::list_names (const char *pattern)
{
ACE_PWSTRING_ITERATOR set_iterator (set);
- for (ACE_WString *name = 0;
+ for (ACE_NS_WString *name = 0;
set_iterator.next (name) !=0;
set_iterator.advance())
ACE_DEBUG ((LM_DEBUG,
@@ -484,7 +484,7 @@ Client_Test::list_values (const char *pattern)
{
ACE_PWSTRING_ITERATOR set_iterator (set);
- for (ACE_WString *value = 0;
+ for (ACE_NS_WString *value = 0;
set_iterator.next (value) !=0;
set_iterator.advance())
ACE_DEBUG ((LM_DEBUG,
@@ -508,7 +508,7 @@ Client_Test::list_types (const char *pattern)
{
ACE_PWSTRING_ITERATOR set_iterator (set);
- for (ACE_WString *type = 0;
+ for (ACE_NS_WString *type = 0;
set_iterator.next (type) !=0;
set_iterator.advance())
ACE_DEBUG ((LM_DEBUG,
diff --git a/netsvcs/lib/Name_Handler.cpp b/netsvcs/lib/Name_Handler.cpp
index e8d50e221e4..bfa2eb7c591 100644
--- a/netsvcs/lib/Name_Handler.cpp
+++ b/netsvcs/lib/Name_Handler.cpp
@@ -374,10 +374,10 @@ int
ACE_Name_Handler::shared_bind (int rebind)
{
ACE_TRACE ("ACE_Name_Handler::shared_bind");
- ACE_WString a_name (this->name_request_.name (),
- this->name_request_.name_len () / sizeof (ACE_USHORT16));
- ACE_WString a_value (this->name_request_.value (),
- this->name_request_.value_len () / sizeof (ACE_USHORT16));
+ ACE_NS_WString a_name (this->name_request_.name (),
+ this->name_request_.name_len () / sizeof (ACE_USHORT16));
+ ACE_NS_WString a_value (this->name_request_.value (),
+ this->name_request_.value_len () / sizeof (ACE_USHORT16));
int result;
if (rebind == 0)
{
@@ -414,13 +414,13 @@ ACE_Name_Handler::resolve (void)
#if 0
ACE_DEBUG ((LM_DEBUG, "request for RESOLVE \n"));
#endif /* 0 */
- ACE_WString a_name (this->name_request_.name (),
- this->name_request_.name_len () / sizeof (ACE_USHORT16));
+ ACE_NS_WString a_name (this->name_request_.name (),
+ this->name_request_.name_len () / sizeof (ACE_USHORT16));
// The following will deliver our reply back to client we
// pre-suppose success (indicated by type RESOLVE).
- ACE_WString avalue;
+ ACE_NS_WString avalue;
char *atype;
if (NAMING_CONTEXT::instance ()->resolve (a_name, avalue, atype) == 0)
{
@@ -447,8 +447,8 @@ ACE_Name_Handler::unbind (void)
#if 0
ACE_DEBUG ((LM_DEBUG, "request for UNBIND \n"));
#endif /* 0 */
- ACE_WString a_name (this->name_request_.name (),
- this->name_request_.name_len () / sizeof (ACE_USHORT16));
+ ACE_NS_WString a_name (this->name_request_.name (),
+ this->name_request_.name_len () / sizeof (ACE_USHORT16));
if (NAMING_CONTEXT::instance ()->unbind (a_name) == 0)
return this->send_reply (0);
@@ -457,7 +457,7 @@ ACE_Name_Handler::unbind (void)
}
ACE_Name_Request
-ACE_Name_Handler::name_request (ACE_WString *one_name)
+ACE_Name_Handler::name_request (ACE_NS_WString *one_name)
{
ACE_TRACE ("ACE_Name_Handler::name_request");
ACE_Auto_Basic_Array_Ptr<ACE_USHORT16> one_name_urep (one_name->ushort_rep ());
@@ -469,7 +469,7 @@ ACE_Name_Handler::name_request (ACE_WString *one_name)
}
ACE_Name_Request
-ACE_Name_Handler::value_request (ACE_WString *one_value)
+ACE_Name_Handler::value_request (ACE_NS_WString *one_value)
{
ACE_TRACE ("ACE_Name_Handler::value_request");
ACE_Auto_Basic_Array_Ptr<ACE_USHORT16> one_value_urep (one_value->ushort_rep ());
@@ -481,7 +481,7 @@ ACE_Name_Handler::value_request (ACE_WString *one_value)
}
ACE_Name_Request
-ACE_Name_Handler::type_request (ACE_WString *one_type)
+ACE_Name_Handler::type_request (ACE_NS_WString *one_type)
{
ACE_TRACE ("ACE_Name_Handler::type_request");
return ACE_Name_Request (ACE_Name_Request::LIST_TYPES,
@@ -497,8 +497,8 @@ ACE_Name_Handler::lists (void)
ACE_TRACE ("ACE_Name_Handler::lists");
ACE_PWSTRING_SET set;
- ACE_WString pattern (this->name_request_.name (),
- this->name_request_.name_len () / sizeof (ACE_USHORT16));
+ ACE_NS_WString pattern (this->name_request_.name (),
+ this->name_request_.name_len () / sizeof (ACE_USHORT16));
// Get the index into the list table
int index = ACE_LIST_MAP (this->name_request_.msg_type (),
@@ -518,9 +518,9 @@ ACE_Name_Handler::lists (void)
}
else
{
- ACE_WString *one_entry = 0;
+ ACE_NS_WString *one_entry = 0;
- for (ACE_Unbounded_Set_Iterator<ACE_WString> set_iterator (set);
+ for (ACE_Unbounded_Set_Iterator<ACE_NS_WString> set_iterator (set);
set_iterator.next (one_entry) !=0;
set_iterator.advance())
{
@@ -547,8 +547,8 @@ ACE_Name_Handler::lists_entries (void)
{
ACE_TRACE ("ACE_Name_Handler::lists_entries");
ACE_BINDING_SET set;
- ACE_WString pattern (this->name_request_.name (),
- this->name_request_.name_len () / sizeof (ACE_USHORT16));
+ ACE_NS_WString pattern (this->name_request_.name (),
+ this->name_request_.name_len () / sizeof (ACE_USHORT16));
int result = -1;
@@ -598,9 +598,9 @@ ACE_Name_Handler::lists_entries (void)
set_iterator.next (one_entry) !=0;
set_iterator.advance())
{
- ACE_Auto_Basic_Array_Ptr<ACE_USHORT16>
+ ACE_Auto_Basic_Array_Ptr<ACE_USHORT16>
name_urep (one_entry->name_.ushort_rep ());
- ACE_Auto_Basic_Array_Ptr<ACE_USHORT16>
+ ACE_Auto_Basic_Array_Ptr<ACE_USHORT16>
value_urep (one_entry->value_.ushort_rep ());
ACE_Name_Request mynrq (this->name_request_.msg_type (),
name_urep.get (),
diff --git a/netsvcs/lib/Name_Handler.h b/netsvcs/lib/Name_Handler.h
index e1ec4b9ee5b..cf01cd98a38 100644
--- a/netsvcs/lib/Name_Handler.h
+++ b/netsvcs/lib/Name_Handler.h
@@ -32,7 +32,7 @@
class Naming_Context : public ACE_Naming_Context
{
// = TITLE
- //
+ //
// This helper class adds the correct default constructor to the
// <ACE_Naming_Context> class so that we can use it in
// <ACE_Singleton>.
@@ -62,10 +62,10 @@ public:
typedef int (ACE_Name_Handler::*OPERATION) (void);
// Pointer to a member function of ACE_Name_Handler returning int
- typedef int (ACE_Naming_Context::*LIST_OP) (ACE_PWSTRING_SET &, const ACE_WString &);
+ typedef int (ACE_Naming_Context::*LIST_OP) (ACE_PWSTRING_SET &, const ACE_NS_WString &);
// Pointer to a member function of ACE_Naming_Context returning int
- typedef ACE_Name_Request (ACE_Name_Handler::*REQUEST) (ACE_WString *);
+ typedef ACE_Name_Request (ACE_Name_Handler::*REQUEST) (ACE_NS_WString *);
// Pointer to a member function of ACE_Name_Handler returning ACE_Name_Request
// = Initialization and termination.
@@ -173,13 +173,13 @@ private:
// Handle LIST_NAME_ENTRIES, LIST_VALUE_ENTRIES, and
// LIST_TYPE_ENTRIES requests.
- ACE_Name_Request name_request (ACE_WString *one_name);
+ ACE_Name_Request name_request (ACE_NS_WString *one_name);
// Create a name request.
- ACE_Name_Request value_request (ACE_WString *one_name);
+ ACE_Name_Request value_request (ACE_NS_WString *one_name);
// Create a value request.
- ACE_Name_Request type_request (ACE_WString *one_name);
+ ACE_Name_Request type_request (ACE_NS_WString *one_name);
// Create a type request.
};
diff --git a/tests/Naming_Test.cpp b/tests/Naming_Test.cpp
index b763564772d..9acab24452c 100644
--- a/tests/Naming_Test.cpp
+++ b/tests/Naming_Test.cpp
@@ -31,7 +31,7 @@ static char type[BUFSIZ];
static void
print_time (ACE_Profile_Timer &timer,
- const char *test)
+ const char *test)
{
ACE_Profile_Timer::ACE_Elapsed_Time et;
timer.stop ();
@@ -40,9 +40,9 @@ print_time (ACE_Profile_Timer &timer,
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n ***** %s ***** \n"), test));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("real time = %f secs, user time = %f secs, system time = %f secs\n"),
- et.real_time, et.user_time, et.system_time));
+ et.real_time, et.user_time, et.system_time));
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("time per call = %f usecs\n\n"),
- (et.real_time / double (ACE_NS_MAX_ENTRIES)) * 1000000));
+ (et.real_time / double (ACE_NS_MAX_ENTRIES)) * 1000000));
}
static void
@@ -55,10 +55,10 @@ test_bind (ACE_Naming_Context &ns_context)
for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++)
{
ACE_OS::sprintf (name, "%s%d", "name", array[i]);
- ACE_WString w_name (name);
+ ACE_NS_WString w_name (name);
ACE_OS::sprintf (value, "%s%d", "value", array[i]);
- ACE_WString w_value (value);
+ ACE_NS_WString w_value (value);
ACE_OS::sprintf (type, "%s%d", "type", array [i]);
ACE_ASSERT (ns_context.bind (w_name, w_value, type) != -1);
@@ -69,8 +69,8 @@ static void
test_find_failure (ACE_Naming_Context &ns_context)
{
ACE_OS::sprintf (name, "%s", "foo-bar");
- ACE_WString w_name (name);
- ACE_WString w_value;
+ ACE_NS_WString w_name (name);
+ ACE_NS_WString w_value;
char *l_type = 0;
// Do the finds.
@@ -88,10 +88,10 @@ test_rebind (ACE_Naming_Context &ns_context)
for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++)
{
ACE_OS::sprintf (name, "%s%d", "name", array[i]);
- ACE_WString w_name (name);
+ ACE_NS_WString w_name (name);
ACE_OS::sprintf (value, "%s%d", "value", -array[i]);
- ACE_WString w_value (value);
+ ACE_NS_WString w_value (value);
ACE_OS::sprintf (type, "%s%d", "type", -array[i]);
ACE_ASSERT (ns_context.rebind (w_name, w_value, type) != -1);
@@ -108,7 +108,7 @@ test_unbind (ACE_Naming_Context &ns_context)
for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++)
{
ACE_OS::sprintf (name, "%s%d", "name", array[i]);
- ACE_WString w_name (name);
+ ACE_NS_WString w_name (name);
ACE_ASSERT (ns_context.unbind (w_name) != -1);
}
}
@@ -126,47 +126,47 @@ test_find (ACE_Naming_Context &ns_context, int sign, int result)
for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++)
{
if (sign == 1)
- {
- ACE_OS::sprintf (temp_val, "%s%d", "value", array[i]);
- ACE_OS::sprintf (temp_type, "%s%d", "type", array[i]);
- }
+ {
+ ACE_OS::sprintf (temp_val, "%s%d", "value", array[i]);
+ ACE_OS::sprintf (temp_type, "%s%d", "type", array[i]);
+ }
else
- {
- ACE_OS::sprintf (temp_val, "%s%d", "value", -array[i]);
- ACE_OS::sprintf (temp_type, "%s%d", "type", -array[i]);
- }
+ {
+ ACE_OS::sprintf (temp_val, "%s%d", "value", -array[i]);
+ ACE_OS::sprintf (temp_type, "%s%d", "type", -array[i]);
+ }
ACE_OS::sprintf (name, "%s%d", "name", array[i]);
- ACE_WString w_name (name);
- ACE_WString w_value;
+ ACE_NS_WString w_name (name);
+ ACE_NS_WString w_value;
char *type_out = 0;
- ACE_WString val (temp_val);
+ ACE_NS_WString val (temp_val);
ACE_ASSERT (ns_context.resolve (w_name, w_value, type_out) == result);
char *l_value = w_value.char_rep ();
if (l_value)
- {
- ACE_ASSERT (w_value == val);
- if (ns_context.name_options ()->debug ())
- {
- if (type_out)
- ACE_DEBUG ((LM_DEBUG,
+ {
+ ACE_ASSERT (w_value == val);
+ if (ns_context.name_options ()->debug ())
+ {
+ if (type_out)
+ ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Name: %s\tValue: %s\tType: %s\n"),
- name, l_value, type_out));
- else
- ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Name: %s\tValue: %s\n"),
- name, l_value));
- }
-
- if (type_out)
- {
- ACE_ASSERT (ACE_OS::strcmp (type_out, temp_type) == 0);
- delete[] type_out;
- }
- }
+ name, l_value, type_out));
+ else
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Name: %s\tValue: %s\n"),
+ name, l_value));
+ }
+
+ if (type_out)
+ {
+ ACE_ASSERT (ACE_OS::strcmp (type_out, temp_type) == 0);
+ delete[] type_out;
+ }
+ }
delete[] l_value;
}
@@ -197,7 +197,7 @@ main (int argc, ACE_TCHAR *argv[])
else
{
ACE_OS::strcpy (temp_file, ACE::basename (name_options->process_name (),
- ACE_DIRECTORY_SEPARATOR_CHAR));
+ ACE_DIRECTORY_SEPARATOR_CHAR));
ACE_OS_String::strcat (temp_file, ACE_TEXT ("XXXXXX"));
// Set the database name using mktemp to generate a unique file name
@@ -207,7 +207,7 @@ main (int argc, ACE_TCHAR *argv[])
ACE_ASSERT (ns_context->open (ACE_Naming_Context::PROC_LOCAL, 1) != -1);
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("time to test %d iterations using %s\n"),
- ACE_NS_MAX_ENTRIES, name_options->use_registry () ?
+ ACE_NS_MAX_ENTRIES, name_options->use_registry () ?
ACE_TEXT ("Registry") : ACE_TEXT ("ACE")));
ACE_Profile_Timer timer;
@@ -243,9 +243,9 @@ main (int argc, ACE_TCHAR *argv[])
print_time (timer, "Unbinds");
ACE_OS::sprintf (temp_file, ACE_TEXT ("%s%s%s"),
- name_options->namespace_dir (),
- ACE_DIRECTORY_SEPARATOR_STR,
- name_options->database ());
+ name_options->namespace_dir (),
+ ACE_DIRECTORY_SEPARATOR_STR,
+ name_options->database ());
delete ns_context;
diff --git a/tests/SString_Test.cpp b/tests/SString_Test.cpp
index fe73d352f50..3cfa80a19a7 100644
--- a/tests/SString_Test.cpp
+++ b/tests/SString_Test.cpp
@@ -142,12 +142,12 @@ main (int, ACE_TCHAR *[])
}
{
- ACE_WString s0 ("hello");
- ACE_WString s1 ("hello");
- ACE_WString s2 ("world");
- ACE_WString s3 ("ll");
- ACE_WString s4 ("ello");
- ACE_WString s5 = s1 + " " + s2;
+ ACE_WString s0 (ACE_TEXT_WIDE ("hello"));
+ ACE_WString s1 (ACE_TEXT_WIDE ("hello"));
+ ACE_WString s2 (ACE_TEXT_WIDE ("world"));
+ ACE_WString s3 (ACE_TEXT_WIDE ("ll"));
+ ACE_WString s4 (ACE_TEXT_WIDE ("ello"));
+ ACE_WString s5 = s1 + ACE_TEXT_WIDE (" ") + s2;
ACE_WSTRING_TYPE single_character = 'z';
ACE_WString single_character_string (single_character);