1 mike 1.11 //%/////////////////////////////////////////////////////////////////////////////
2 //
|
3 kumpf 1.13 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
|
5 mike 1.11 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 kumpf 1.13 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
10 mike 1.11 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
|
13 kumpf 1.13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
14 mike 1.11 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
16 kumpf 1.13 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
19 mike 1.11 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 //
22 //==============================================================================
23 //
24 // Author: Mike Brasher (mbrasher@bmc.com)
25 //
|
26 kumpf 1.17 // Modified By: Roger Kumpf, Hewlett Packard Company (roger_kumpf@hp.com)
|
27 kumpf 1.20 // Carol Ann Krug Graves, Hewlett-Packard Company
28 // (carolann_graves@hp.com)
|
29 mike 1.11 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_Name_h
33 #define Pegasus_Name_h
34
35 #include <Pegasus/Common/Config.h>
|
36 kumpf 1.17 #include <Pegasus/Common/Linkage.h>
|
37 mike 1.11 #include <Pegasus/Common/String.h>
|
38 kumpf 1.17 #include <Pegasus/Common/Array.h>
39 #include <Pegasus/Common/Exception.h>
|
40 mike 1.11
41 PEGASUS_NAMESPACE_BEGIN
42
|
43 kumpf 1.17 ////////////////////////////////////////////////////////////////////////////////
44 //
45 // CIMName
46 //
47 ////////////////////////////////////////////////////////////////////////////////
48
|
49 mike 1.11 /**
|
50 kumpf 1.17 The CIMName class defines methods for handling CIM names.
|
51 kumpf 1.14 <p>
|
52 mike 1.11 The names of classes, properties, qualifiers, and methods are all
53 CIM names. A CIM name must match the following regular
54 expression:
55 <PRE>
56
57 [A-Z-a-z_][A-Za-z_0-9]*
58 </PRE>
59 */
60 class PEGASUS_COMMON_LINKAGE CIMName
61 {
62 public:
63
|
64 kumpf 1.22 ///
|
65 kumpf 1.17 CIMName();
|
66 kumpf 1.22 ///
|
67 kumpf 1.17 CIMName(const String& name);
|
68 kumpf 1.22 ///
|
69 kumpf 1.17 CIMName(const char* name);
70
|
71 kumpf 1.22 ///
|
72 kumpf 1.17 CIMName& operator=(const CIMName& name);
|
73 kumpf 1.22 ///
|
74 kumpf 1.17 CIMName& operator=(const String& name);
|
75 kumpf 1.20
76 #ifndef PEGASUS_REMOVE_DEPRECATED
|
77 kumpf 1.17 CIMName& operator=(const char* name);
|
78 kumpf 1.20 #endif
|
79 kumpf 1.17
|
80 kumpf 1.22 ///
|
81 kumpf 1.20 const String& getString() const;
|
82 kumpf 1.17
|
83 kumpf 1.20 #ifndef PEGASUS_REMOVE_DEPRECATED
|
84 kumpf 1.17 operator String() const;
|
85 kumpf 1.20 #endif
|
86 kumpf 1.17
|
87 kumpf 1.22 ///
|
88 kumpf 1.17 Boolean isNull() const;
89
|
90 kumpf 1.22 ///
|
91 kumpf 1.17 void clear();
92
|
93 kumpf 1.22 /** Compares two names.
94 @return true if the name passed is equal to the name in this
95 class. CIM names are case insensitive and so is this method.
|
96 kumpf 1.17 */
97 Boolean equal(const CIMName& name) const;
98
|
99 kumpf 1.22 /** Determines if the name string input is legal as
100 defnined in the CIMName class definition.
101 @param name String to test for legality.
102 @return true if the given name is legal, false otherwise.
|
103 mike 1.11 */
|
104 kumpf 1.21 static Boolean legal(const String& name);
|
105 mike 1.11
106 private:
|
107 kumpf 1.17 String cimName;
108 };
109
|
110 kumpf 1.18 PEGASUS_COMMON_LINKAGE Boolean operator==(
111 const CIMName& name1,
112 const CIMName& name2);
|
113 kumpf 1.17
114 #define PEGASUS_ARRAY_T CIMName
115 # include "ArrayInter.h"
116 #undef PEGASUS_ARRAY_T
117
118
119 ////////////////////////////////////////////////////////////////////////////////
120 //
121 // CIMNamespaceName
122 //
123 ////////////////////////////////////////////////////////////////////////////////
124
125 /**
|
126 kumpf 1.19 The CIMNamespaceName class defines methods for handling CIM namespace names.
|
127 kumpf 1.17 <p>
128 A CIM namespace name must match the following expression:
129 <PRE>
|
130 kumpf 1.22 <CIMName>[/<CIMName>]...
|
131 kumpf 1.17 </PRE>
|
132 kumpf 1.22 </p>
|
133 kumpf 1.17 */
134 class PEGASUS_COMMON_LINKAGE CIMNamespaceName
135 {
136 public:
137
|
138 kumpf 1.22 ///
|
139 kumpf 1.17 CIMNamespaceName();
|
140 kumpf 1.22 ///
|
141 kumpf 1.17 CIMNamespaceName(const String& name);
|
142 kumpf 1.22 ///
|
143 kumpf 1.17 CIMNamespaceName(const char* name);
144
|
145 kumpf 1.22 ///
|
146 kumpf 1.17 CIMNamespaceName& operator=(const CIMNamespaceName& name);
|
147 kumpf 1.22 ///
|
148 kumpf 1.17 CIMNamespaceName& operator=(const String& name);
|
149 kumpf 1.20
150 #ifndef PEGASUS_REMOVE_DEPRECATED
|
151 kumpf 1.17 CIMNamespaceName& operator=(const char* name);
|
152 kumpf 1.20 #endif
|
153 kumpf 1.17
|
154 kumpf 1.22 ///
|
155 kumpf 1.20 const String& getString() const;
|
156 kumpf 1.17
|
157 kumpf 1.20 #ifndef PEGASUS_REMOVE_DEPRECATED
|
158 kumpf 1.17 operator String() const;
|
159 kumpf 1.20 #endif
|
160 kumpf 1.17
|
161 kumpf 1.22 ///
|
162 kumpf 1.17 Boolean isNull() const;
163
|
164 kumpf 1.22 ///
|
165 kumpf 1.17 void clear();
166
|
167 kumpf 1.22 /** Compares two names.
168 @return true if the name passed is equal to the name in this
169 class. CIM names are case insensitive and so is this method.
|
170 kumpf 1.17 */
171 Boolean equal(const CIMNamespaceName& name) const;
|
172 mike 1.11
|
173 kumpf 1.22 /** Determines if the name string input is legal as
174 defnined in the CIMNamespaceName class definition.
175 @param name String to test for legality.
176 @return true if the given name is legal, false otherwise.
|
177 kumpf 1.17 */
|
178 kumpf 1.21 static Boolean legal(const String& name);
|
179 kumpf 1.17
180 private:
181 String cimNamespaceName;
|
182 mike 1.11 };
|
183 kumpf 1.20
184 PEGASUS_COMMON_LINKAGE Boolean operator==(
185 const CIMNamespaceName& name1,
186 const CIMNamespaceName& name2);
187
188 #define PEGASUS_ARRAY_T CIMNamespaceName
189 # include "ArrayInter.h"
190 #undef PEGASUS_ARRAY_T
|
191 mike 1.11
192 PEGASUS_NAMESPACE_END
193
194 #endif /* Pegasus_Name_h */
|