CIMName.h
1 //%LICENSE////////////////////////////////////////////////////////////////
2 //
3 // 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 //
10 // 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 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // 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 //
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31 
32 #ifndef Pegasus_Name_h
33 #define Pegasus_Name_h
34 
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/Linkage.h>
37 #include <Pegasus/Common/String.h>
38 #include <Pegasus/Common/Array.h>
39 #include <Pegasus/Common/Exception.h>
40 
41 PEGASUS_NAMESPACE_BEGIN
42 
44 //
45 // CIMName
46 //
48 
64 class PEGASUS_COMMON_LINKAGE CIMName
65 {
66 public:
67 
71  CIMName();
72 
79  CIMName(const String& name);
80 
89  CIMName(const char* name);
90 
96  CIMName& operator=(const CIMName& name);
97 
112  CIMName& operator=(const String& name);
113 
123  const String& getString() const;
124 
136  Boolean isNull() const;
137 
147  void clear();
148 
162  Boolean equal(const CIMName& name) const;
163 
175  static Boolean legal(const String& name);
176 
177 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
178 
186  Boolean equal(const char* name) const;
187 
198  CIMName& operator=(const char* name);
199 
200 #endif /* PEGASUS_USE_EXPERIMENTAL_INTERFACES */
201 
202 private:
203  String cimName;
204 };
205 
218 PEGASUS_COMMON_LINKAGE Boolean operator==(
219  const CIMName& name1,
220  const CIMName& name2);
221 
228 PEGASUS_COMMON_LINKAGE Boolean operator!=(
229  const CIMName& name1,
230  const CIMName& name2);
231 
232 #define PEGASUS_ARRAY_T CIMName
233 # include "ArrayInter.h"
234 #undef PEGASUS_ARRAY_T
235 
236 
238 //
239 // CIMNamespaceName
240 //
242 
255 class PEGASUS_COMMON_LINKAGE CIMNamespaceName
256 {
257 public:
258 
263 
270  CIMNamespaceName(const String& name);
271 
280  CIMNamespaceName(const char* name);
281 
288  CIMNamespaceName& operator=(const CIMNamespaceName& name);
289 
304  CIMNamespaceName& operator=(const String& name);
305 
315  const String& getString() const;
316 
328  Boolean isNull() const;
329 
339  void clear();
340 
354  Boolean equal(const CIMNamespaceName& name) const;
355 
367  static Boolean legal(const String& name);
368 
369 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
370 
378  Boolean equal(const char* name) const;
379 
391  CIMNamespaceName& operator=(const char* name);
392 
393 #endif /* PEGASUS_USE_EXPERIMENTAL_INTERFACES */
394 
395 private:
396  String cimNamespaceName;
397 };
398 
411 PEGASUS_COMMON_LINKAGE Boolean operator==(
412  const CIMNamespaceName& name1,
413  const CIMNamespaceName& name2);
414 
421 PEGASUS_COMMON_LINKAGE Boolean operator!=(
422  const CIMNamespaceName& name1,
423  const CIMNamespaceName& name2);
424 
425 #define PEGASUS_ARRAY_T CIMNamespaceName
426 # include "ArrayInter.h"
427 #undef PEGASUS_ARRAY_T
428 
429 PEGASUS_NAMESPACE_END
430 
431 #ifdef PEGASUS_INTERNALONLY
432 # include "CIMNameInline.h"
433 #endif
434 
435 #endif /* Pegasus_Name_h */
Definition: String.h:119
Definition: CIMName.h:64
Definition: CIMName.h:255