#include <CIMName.h>

Public Member Functions

 CIMNamespaceName ()
 
 CIMNamespaceName (const String &name)
 
 CIMNamespaceName (const char *name)
 
CIMNamespaceNameoperator= (const CIMNamespaceName &name)
 
CIMNamespaceNameoperator= (const String &name)
 
const StringgetString () const
 
Boolean isNull () const
 
void clear ()
 
Boolean equal (const CIMNamespaceName &name) const
 

Static Public Member Functions

static Boolean legal (const String &name)
 

Detailed Description

The CIMNamespaceName class represents the DMTF standard CIM namespace name definition.

A CIM namespace name must match the following expression:

    <CIMName>[ / <CIMName> ]*

A namespace name with a leading '/' character is accepted, but the leading character is removed. A CIMNamespaceName may be null, meaning that it has no value.

Constructor & Destructor Documentation

◆ CIMNamespaceName() [1/3]

CIMNamespaceName::CIMNamespaceName ( )

Constructs a null CIMName.

◆ CIMNamespaceName() [2/3]

CIMNamespaceName::CIMNamespaceName ( const String name)

Constructs a non-null CIMNamespaceName with the specified name.

Parameters
nameA String containing the CIM namespace name.
Exceptions
InvalidNameExceptionIf the String does not contain a valid CIM namespace name.

◆ CIMNamespaceName() [3/3]

CIMNamespaceName::CIMNamespaceName ( const char *  name)

Constructs a non-null CIMNamespaceName with the specified name.

Parameters
nameA character string containing the CIM namespace name.
Exceptions
InvalidNameExceptionIf the character string does not contain a valid CIM namespace name.
Allexceptions thrown by String(const char* str) can be thrown here

Member Function Documentation

◆ clear()

void CIMNamespaceName::clear ( )

Sets the CIM namespace name to a null value.

Example:

CIMNamespaceName n("root/test");
n.clear();
assert(n.isNull());

◆ equal()

Boolean CIMNamespaceName::equal ( const CIMNamespaceName name) const

Compares the CIMNamespaceName with a specified CIMNamespaceName. Comparisons of CIM namespace names are case-insensitive.

Example:

CIMNamespaceName n1("root/cimv2");
CIMNamespaceName n2("Root/CimV2");
assert(n1.equal(n2));
Parameters
nameThe CIMNamespaceName to be compared.
Returns
True if this name is equivalent to the specified name, false otherwise.

◆ getString()

const String& CIMNamespaceName::getString ( ) const

Gets a String form of the CIM namespace name.

Example:

CIMNamespaceName n("test/ns1");
String s = n.getString();
Returns
A reference to a String containing the CIM namespace name.

◆ isNull()

Boolean CIMNamespaceName::isNull ( ) const

Determines whether the CIM namespace name is null.

Example:

CIMNamespaceName n;
assert(n.isNull());
n = "root/test";
assert(!n.isNull());
Returns
True if the CIM namespace name is null, false otherwise.

◆ legal()

static Boolean CIMNamespaceName::legal ( const String name)
static

Determines whether a name is a valid CIM namespace name.

Example:

assert(CIMNamespaceName::legal("root/test"));
assert(!CIMNamespaceName::legal("Wrong!"));
Parameters
nameA String containing the name to test.
Returns
True if the specified name is a valid CIM namespace name, false otherwise.

◆ operator=() [1/2]

CIMNamespaceName& CIMNamespaceName::operator= ( const CIMNamespaceName name)

Assigns the value of the specified CIMNamespaceName object to this object.

Parameters
nameThe CIMNamespaceName object from which to assign this CIMNamespaceName object.

◆ operator=() [2/2]

CIMNamespaceName& CIMNamespaceName::operator= ( const String name)

Sets the CIMNamespaceName with a String name. The resulting CIMNamespaceName object is non-null.

Example:

CIMNamespaceName n;
String name = "root/cimv2";
n = name;
Parameters
nameA String containing the CIM namespace name to set.
Returns
A reference to this CIMNamespaceName object.
Exceptions
InvalidNameExceptionIf the String does not contain a valid CIM namespace name.

The documentation for this class was generated from the following file:
  • /root/rpmbuild/BUILD/pegasus/src/Pegasus/Common/CIMName.h