|
In file ../../src/Pegasus/Common/CIMName.h:
class PEGASUS_COMMON_LINKAGE CIMName |
The CIMName class defines methods for handling CIM names.
Documentation
The CIMName class defines methods for handling CIM names.
The names of classes, properties, qualifiers, and methods are all
CIM names. A CIM name must match the following regular
expression:
[A-Za-z_][A-Za-z_0-9]*
Examples:
- name - legal name
- Type - legal name
- 3types - Illegal CIM name
The CIMName class includes the attribute Null which is required
by the DMTF operations definitions. Note that this and the regular
expression limits on CIMName are what separate this from the String
class. This allows the names in CIM operations, such as getClass, to
provide pattern matching tests for the classname parameter as well as
separate the concept of empty from Null.
Inheritance:
Public Methods
| CIMName ()
Constructs an object with no name.
|
| CIMName (const String& name)
Constructor creates a new CIMName object from name.
|
| CIMName (const char* name)
Constructor creates a new CIMName object from string provided as input.
|
CIMName& | operator= (const CIMName& name)
Assigns one CIMName to another.
|
CIMName& | operator= (const String& name)
Sets the name of the associated object to name.
|
const String& | getString () const
Gets a reference a String containing the name from the associated object.
|
Boolean | isNull () const
Tests if name is Null, ie.
|
void | clear ()
Clears the CIMName.
|
Boolean | equal (const CIMName& name) const
Compares the CIMName object against another CIMName object for equality.
|
static Boolean | legal (const String& name)
Determines if the name string input is legal as defined in the CIMName class definition.
|
- CIMName()
-
Constructs an object with no name. A call to isNull() immediately
after constructing the object will return true.
- Throws:
- bad_alloc Thrown if there is insufficient memory.
- CIMName(const String& name)
-
Constructor creates a new CIMName object from name.
name must be a legal CIM name.
- Throws:
- InvalidNameException if name is not
a legal CIMName
bad_alloc Thrown if there is insufficient memory.
- Parameters:
- name - The name to use for the object.
- CIMName(const char* name)
-
Constructor creates a new CIMName object from string
provided as input. The string must be a legal name.
- Throws:
- InvalidNameException if name is not
a legal CIMName
bad_alloc Thrown if there is insufficient memory.
- Parameters:
- name - The name to use for the object.
- CIMName& operator=(const CIMName& name)
-
Assigns one CIMName to another.
- Throws:
- bad_alloc Thrown if there is insufficient memory.
- Parameters:
- name - CIMName object to copy.
- CIMName& operator=(const String& name)
-
Sets the name of the associated object to name.
- Throws:
- InvalidNameException if name is not
a legal CIMName
bad_alloc Thrown if there is insufficient memory.
CIMName n;
String type = "type";
n = type;
- Parameters:
- name - The new name to use for the object.
- const String& getString() const
-
Gets a reference a String containing the name from the
associated object.
- Returns:
- Reference to a String containing the name.
CIMName n("name");
String s = n.getString();
- Boolean isNull() const
-
Tests if name is Null, ie. not set.
- Returns:
- true if name is Null, false if not.
CIMName n;
assert(n.isNull());
n = "name";
assert(!n.isNull());
- void clear()
-
Clears the CIMName.
CIMMame n("name");
n.clear();
assert(n.isNull());
- Boolean equal(const CIMName& name) const
-
Compares the CIMName object against another CIMName object
for equality.
- Parameters:
- name - CIMName to compare with the associated object.
- Returns:
- true if the name passed is equal to the name in this
class. CIM names are case insensitive and so is this method.
CIMName n1 = "name";
CIMName n2 = "InstanceID";
if( n1.equal(n2) )
... Should never get here
else
...
- static Boolean legal(const String& name)
-
Determines if the name string input is legal as
defined in the CIMName class definition. This is a static
method used to test String values to determine if they are
legal names.
- Parameters:
- name - String to test for legality.
- Returns:
- Returns true if the name is legal, otherwise false.
assert(CIMName::legal("name"));
assert(!CIMName::legal("3types"));
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
|