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

[more] CIMName ()
Constructs an object with no name.
[more] CIMName (const String& name)
Constructor creates a new CIMName object from name.
[more] CIMName (const char* name)
Constructor creates a new CIMName object from string provided as input.
[more]CIMName& operator= (const CIMName& name)
Assigns one CIMName to another.
[more]CIMName& operator= (const String& name)
Sets the name of the associated object to name.
[more]const String& getString () const
Gets a reference a String containing the name from the associated object.
[more]Boolean isNull () const
Tests if name is Null, ie.
[more]void clear ()
Clears the CIMName.
[more]Boolean equal (const CIMName& name) const
Compares the CIMName object against another CIMName object for equality.
[more]static Boolean legal (const String& name)
Determines if the name string input is legal as defined in the CIMName class definition.

o 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.

o 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.

o 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.

oCIMName& operator=(const CIMName& name)
Assigns one CIMName to another.

Throws:
bad_alloc Thrown if there is insufficient memory.
Parameters:
name - CIMName object to copy.

oCIMName& 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.

oconst 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();

oBoolean 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());

ovoid clear()
Clears the CIMName.

        CIMMame n("name");
        n.clear();
        assert(n.isNull());
        

oBoolean 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
...

ostatic 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