1 martin 1.27 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.28 //
|
3 martin 1.27 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.28 //
|
10 martin 1.27 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.28 //
|
17 martin 1.27 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.28 //
|
20 martin 1.27 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.28 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.27 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.28 //
|
28 martin 1.27 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.11 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_Char16_h
33 #define Pegasus_Char16_h
34
35 #include <Pegasus/Common/Config.h>
|
36 kumpf 1.13 #include <Pegasus/Common/Linkage.h>
|
37 mike 1.11
38 PEGASUS_NAMESPACE_BEGIN
39
40 /** The Char16 class represents a CIM sixteen bit character (char16).
41 This class is a trivial wrapper for a sixteen bit integer. It is used
42 as the element type in the String class (used to represent the CIM
43 string type). Ordinarily Uint16 could be used; however, a distinguishable
44 type was needed for the purposes of function overloaded which occurs in
45 the CIMValue class.
46 */
|
47 david.dillard 1.22 class PEGASUS_COMMON_LINKAGE Char16
|
48 mike 1.11 {
49 public:
50
|
51 kumpf 1.26 /**
52 Constructs a Char16 with a null (0) value.
53 */
|
54 kumpf 1.14 Char16();
|
55 mike 1.11
|
56 kumpf 1.26 /**
57 Constructs a Char16 with a specified 16-bit character value.
58 @param x The Uint16 value with which to initialize the Char16.
59 */
|
60 kumpf 1.14 Char16(Uint16 x);
|
61 mike 1.11
|
62 kumpf 1.26 /**
63 Constructs a Char16 by copying another Char16 value.
64 @param x The Char16 object to copy.
65 */
|
66 kumpf 1.14 Char16(const Char16& x);
|
67 mike 1.11
|
68 kumpf 1.26 /**
69 Destructs a Char16 object.
70 */
|
71 kumpf 1.14 ~Char16();
|
72 mike 1.11
|
73 kumpf 1.26 /**
74 Assigns the value to a specified 16-bit character value.
75 @param x The Uint16 value to copy.
76 */
|
77 kumpf 1.14 Char16& operator=(Uint16 x);
|
78 mike 1.11
|
79 kumpf 1.26 /**
80 Assigns the value from another Char16 object.
81 @param x The Char16 object to copy.
82 */
|
83 kumpf 1.14 Char16& operator=(const Char16& x);
|
84 mike 1.11
|
85 kumpf 1.26 /**
86 Implicitly converts the Char16 value to a 16-bit integer.
87 */
|
88 kumpf 1.14 operator Uint16() const;
|
89 mike 1.11
90 private:
91 Uint16 _code;
92 };
93
|
94 kumpf 1.26 /**
95 Compares two Char16 objects for equality.
96 @param x The first Char16 to compare.
97 @param y The second Char16 to compare.
98 @return A Boolean indicating whether both operands represent the same
99 character value.
100 */
|
101 kumpf 1.14 PEGASUS_COMMON_LINKAGE Boolean operator==(const Char16& x, const Char16& y);
|
102 kumpf 1.26
103 /**
104 Compares a Char16 object and an 8-bit character for equality.
105 @param x The Char16 to compare.
106 @param y The 8-bit character to compare.
107 @return A Boolean indicating whether both operands represent the same
108 character value.
109 */
|
110 kumpf 1.14 PEGASUS_COMMON_LINKAGE Boolean operator==(const Char16& x, char y);
|
111 kumpf 1.26
112 /**
113 Compares a Char16 object and an 8-bit character for equality.
114 @param x The 8-bit character to compare.
115 @param y The Char16 to compare.
116 @return A Boolean indicating whether both operands represent the same
117 character value.
118 */
|
119 kumpf 1.14 PEGASUS_COMMON_LINKAGE Boolean operator==(char x, const Char16& y);
|
120 kumpf 1.26
121 /**
122 Compares two Char16 objects for inequality.
123 @param x The first Char16 to compare.
124 @param y The second Char16 to compare.
125 @return A Boolean indicating whether the operands represent different
126 character values.
127 */
|
128 kumpf 1.14 PEGASUS_COMMON_LINKAGE Boolean operator!=(const Char16& x, const Char16& y);
|
129 kumpf 1.26
130 /**
131 Compares a Char16 object and an 8-bit character for inequality.
132 @param x The Char16 to compare.
133 @param y The 8-bit character to compare.
134 @return A Boolean indicating whether the operands represent different
135 character values.
136 */
|
137 kumpf 1.14 PEGASUS_COMMON_LINKAGE Boolean operator!=(const Char16& x, char y);
|
138 kumpf 1.26
139 /**
140 Compares a Char16 object and an 8-bit character for inequality.
141 @param x The 8-bit character to compare.
142 @param y The Char16 to compare.
143 @return A Boolean indicating whether the operands represent different
144 character values.
145 */
|
146 kumpf 1.14 PEGASUS_COMMON_LINKAGE Boolean operator!=(char x, const Char16& y);
|
147 mike 1.11
148 PEGASUS_NAMESPACE_END
149
|
150 mike 1.24 #if defined(PEGASUS_INTERNALONLY) && !defined(PEGASUS_DISABLE_INTERNAL_INLINES)
151 # include "Char16Inline.h"
152 #endif
153
|
154 mike 1.11 #endif /* Pegasus_Char16_h */
|