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

Diff for /pegasus/src/Pegasus/Common/CIMNameInline.h between version 1.5 and 1.6

version 1.5, 2006/11/10 18:14:57 version 1.6, 2008/11/12 21:05:40
Line 151 
Line 151 
     return String::equalNoCase(cimNamespaceName, name);     return String::equalNoCase(cimNamespaceName, name);
 } }
  
   //
   // This function performs a compile-time cast from String to CIMName. It should
   // only be used where the String is already known to contain a valid CIM name,
   // thereby avoiding the overhead of checking every character of the String.
   // This cast is possible because CIMName has a single String member. Note that
   // that sizeof(CIMName) == sizeof(String) and that the classes are identical
   // in their representation, differing only by interface. When compiled for
   // debug, this function checks that str refers to a valid CIM name.
   //
   inline const CIMName& CIMNameCast(const String& str)
   {
   #if defined(PEGASUS_DEBUG)
   
       if (!CIMName::legal(str))
       {
           throw InvalidNameException(str);
       }
   
   #endif
   
       return *((CIMName*)&str);
   }
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 #endif /* Pegasus_CIMNameInline_h */ #endif /* Pegasus_CIMNameInline_h */


Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2