(file) Return to CIMName.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

 1 mike  1.3 //%/////////////////////////////////////////////////////////////////////////////
 2 mike  1.1 //
 3           // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM
 4           //
 5           // Permission is hereby granted, free of charge, to any person obtaining a
 6           // copy of this software and associated documentation files (the "Software"),
 7           // to deal in the Software without restriction, including without limitation
 8           // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 9           // and/or sell copies of the Software, and to permit persons to whom the
10           // Software is furnished to do so, subject to the following conditions:
11           //
12           // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13           // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14           // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15           // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16           // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17           // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18           // DEALINGS IN THE SOFTWARE.
19           //
20 mike  1.3 //==============================================================================
21 mike  1.1 //
22 mike  1.3 // Author: Mike Brasher (mbrasher@bmc.com)
23 mike  1.1 //
24 mike  1.3 // Modified By:
25 mike  1.1 //
26 mike  1.3 //%/////////////////////////////////////////////////////////////////////////////
27 mike  1.1 
28           #ifndef Pegasus_Name_h
29           #define Pegasus_Name_h
30           
31           #include <Pegasus/Common/Config.h>
32           #include <Pegasus/Common/String.h>
33           #include <Pegasus/Common/Exception.h>
34           
35           PEGASUS_NAMESPACE_BEGIN
36           
37           /**
38               The name class defines static methods for handling CIM names.
39               The names of classes, properties, qualifiers, and methods are all
40               CIM names. A CIM name must match the following regular
41               expression:
42               <PRE>
43           
44           	[A-Z-a-z_][A-Za-z_0-9]*
45               </PRE>
46           
47               Notice that the definition of a name is the same as C, C++,
48 mike  1.1     and Java.
49           
50 mike  1.4     This class cannot be instantiated (since its only constructor is
51 mike  1.1     private).
52           */
53           class PEGASUS_COMMON_LINKAGE CIMName
54           {
55           public:
56           
57               /** CIMMethod legal - Determine if the name string input is legal as
58           	defnined in the CIMName class definition
59           	ATTN: Define what is legal
60           	@param - String to test
61           	@return Returns true if the given name is legal. Throws
62           	NullPointer exception if name argument is null.
63               */
64               static Boolean legal(const Char16* name);
65           
66               /** CIMMethod legal - Determine if the name string input is legal as
67           	defnined in the CIMName class definition
68           	@param - String to test
69           	@return Returns true if the given name is legal. Throws
70           	NullPointer exception if name argument is null.
71               */
72 mike  1.1     static Boolean legal(const String& name)
73               {
74           	return legal(name.getData());
75               }
76           
77               /** CIMMethod equal - Compares two names.
78           	@return Return true if the two names are equal. CIM names are
79           	case insensitive and so it this method.
80               */
81 mike  1.5     static Boolean equal(const String& name1, const String& name2)
82               {
83 mike  1.6 	return String::equalNoCase(name1, name2);
84 mike  1.5     }
85 mike  1.1 
86           private:
87           
88               CIMName() { }
89           };
90           
91           PEGASUS_NAMESPACE_END
92           
93           #endif /* Pegasus_Name_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2