Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Local_Name_Space.h
blobb2bf2948b9fadba916e6742935f943c2f1cebbc1
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Local_Name_Space.h
7 * @author Prashant Jain (pjain@cs.wustl.edu)
8 * @author Irfan Pyarali (irfan@wuerl.wustl.edu)
9 * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu).
11 //=============================================================================
13 #ifndef ACE_LOCAL_NAME_SPACE_H
14 #define ACE_LOCAL_NAME_SPACE_H
16 #include /**/ "ace/pre.h"
18 #include "ace/Malloc_T.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 class ACE_NS_WString;
28 /**
29 * @class ACE_NS_String
31 * @brief This class and ACE_NS_Internal are used as Adapters to work
32 * with the Map_Manager.
34 * In order to work correctly, this class must be able to
35 * convert back and forth with <ACE_NS_WStrings>.
37 class ACE_Export ACE_NS_String
39 public:
40 // = Initialization.
41 /// Default "no-op" constructor.
42 ACE_NS_String ();
44 /// Initialization method.
45 ACE_NS_String (ACE_WCHAR_T *dst,
46 const ACE_WCHAR_T *src,
47 size_t len);
49 /// Converts an ACE_NS_WString to an ACE_NS_String;
50 ACE_NS_String (const ACE_NS_WString &);
52 /// Destructor
53 ~ACE_NS_String ();
55 /// Converts an ACE_NS_String to fresh copy of an ACE_NS_WString;
56 operator ACE_NS_WString () const;
58 /// Return the ASCII character representation.
59 char *char_rep () const;
61 /// Matches on substrings.
62 int strstr (const ACE_NS_String &) const;
64 /// Compare an ACE_NS_String.
65 bool operator == (const ACE_NS_String &) const;
67 /// Compare an ACE_NS_String.
68 bool operator != (const ACE_NS_String &) const;
70 /// Returns length of the string
71 size_t len () const;
73 /// Returns the underlying representation.
74 ACE_WCHAR_T *fast_rep () const;
76 /// Returns a hash value for this string.
77 u_long hash () const;
79 private:
80 /// Length of the string.
81 size_t len_;
83 /// This actually points into shared/persistent memory.
84 ACE_WCHAR_T *rep_;
86 /// Should rep_ be deleted when destructed (only used
87 /// for WString conversions)
88 bool delete_rep_;
91 /**
92 * @class ACE_NS_Internal
94 * @brief This class and ACE_NS_String are used as Adapters to work
95 * with the Map_Manager.
97 class ACE_Export ACE_NS_Internal
99 public:
100 /// No-op constructor.
101 ACE_NS_Internal ();
103 /// Constructor.
104 ACE_NS_Internal (ACE_NS_String &value, const char *type);
106 /// Compare an ACE_NS_Internal
107 bool operator == (const ACE_NS_Internal &) const;
109 /// Return value.
110 ACE_NS_String value ();
112 /// Return type.
113 const char *type ();
115 private:
116 /// Contains the value of the string.
117 ACE_NS_String value_;
119 /// Contains the type of the string.
120 const char *type_;
123 ACE_END_VERSIONED_NAMESPACE_DECL
125 // Include the ACE_Local_Name_Space templates stuff at this point.
126 #include "ace/Local_Name_Space_T.h"
128 #include /**/ "ace/post.h"
130 #endif /* ACE_LOCAL_NAME_SPACE_H */