3 //=============================================================================
5 * @file Local_Name_Space.h
7 * $Id: Local_Name_Space.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Prashant Jain (pjain@cs.wustl.edu)
10 * @author Irfan Pyarali (irfan@wuerl.wustl.edu)
11 * @author Douglas C. Schmidt (schmidt@cs.wustl.edu).
13 //=============================================================================
15 #ifndef ACE_LOCAL_NAME_SPACE_H
16 #define ACE_LOCAL_NAME_SPACE_H
18 #include /**/ "ace/pre.h"
20 #include "ace/Malloc_T.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
31 * @class ACE_NS_String
33 * @brief This class and ACE_NS_Internal are used as Adapters to work
34 * with the Map_Manager.
36 * In order to work correctly, this class must be able to
37 * convert back and forth with <ACE_NS_WStrings>.
39 class ACE_Export ACE_NS_String
43 /// Default "no-op" constructor.
46 /// Initialization method.
47 ACE_NS_String (ACE_WCHAR_T
*dst
,
48 const ACE_WCHAR_T
*src
,
51 /// Converts an ACE_NS_WString to an ACE_NS_String;
52 ACE_NS_String (const ACE_NS_WString
&);
55 ~ACE_NS_String (void);
57 /// Converts an ACE_NS_String to fresh copy of an ACE_NS_WString;
58 operator ACE_NS_WString () const;
60 /// Return the ASCII character representation.
61 char *char_rep (void) const;
63 /// Matches on substrings.
64 int strstr (const ACE_NS_String
&) const;
66 /// Compare an ACE_NS_String.
67 bool operator == (const ACE_NS_String
&) const;
69 /// Compare an ACE_NS_String.
70 bool operator != (const ACE_NS_String
&) const;
72 /// Returns length of the string
73 size_t len (void) const;
75 /// Returns the underlying representation.
76 ACE_WCHAR_T
*fast_rep (void) const;
78 /// Returns a hash value for this string.
79 u_long
hash (void) const;
82 /// Length of the string.
85 /// This actually points into shared/persistent memory.
88 /// Should rep_ be deleted when destructed (only used
89 /// for WString conversions)
94 * @class ACE_NS_Internal
96 * @brief This class and ACE_NS_String are used as Adapters to work
97 * with the Map_Manager.
99 class ACE_Export ACE_NS_Internal
102 /// No-op constructor.
103 ACE_NS_Internal (void);
106 ACE_NS_Internal (ACE_NS_String
&value
, const char *type
);
108 /// Compare an ACE_NS_Internal
109 bool operator == (const ACE_NS_Internal
&) const;
112 ACE_NS_String
value (void);
115 const char *type (void);
118 /// Contains the value of the string.
119 ACE_NS_String value_
;
121 /// Contains the type of the string.
125 ACE_END_VERSIONED_NAMESPACE_DECL
127 // Include the ACE_Local_Name_Space templates stuff at this point.
128 #include "ace/Local_Name_Space_T.h"
130 #include /**/ "ace/post.h"
132 #endif /* ACE_LOCAL_NAME_SPACE_H */