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

Diff for /pegasus/src/Pegasus/Common/CIMScope.cpp between version 1.13 and 1.14

version 1.13, 2002/06/01 00:56:28 version 1.14, 2002/08/05 16:14:41
Line 23 
Line 23 
 // //
 // Author: Mike Brasher (mbrasher@bmc.com) // Author: Mike Brasher (mbrasher@bmc.com)
 // //
 // Modified By:  // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
   //                (carolann_graves@hp.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include <cstring> #include <cstring>
   #include <Pegasus/Common/Exception.h>
 #include "CIMScope.h" #include "CIMScope.h"
 #include "XmlWriter.h"  
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 43 
Line 44 
 const Uint32 CIMScope::PARAMETER = 64; const Uint32 CIMScope::PARAMETER = 64;
 const Uint32 CIMScope::ANY = (1 | 2 | 4 | 8 | 16 | 32 | 64 ); const Uint32 CIMScope::ANY = (1 | 2 | 4 | 8 | 16 | 32 | 64 );
  
 String ScopeToString(Uint32 scope)  CIMScope::CIMScope ()
       : cimScope (CIMScope::NONE)
   {
   }
   
   CIMScope::CIMScope (const CIMScope & scope)
       : cimScope (scope.cimScope)
   {
   }
   
   CIMScope::CIMScope (const Uint32 scope)
       : cimScope (scope)
   {
       if (scope > CIMScope::ANY)
       {
           //
           //  Invalid scope value
           //
           String scopeString;
           char buffer [32];
           sprintf (buffer, "%lu", (unsigned long) scope);
           scopeString = buffer;
           throw InvalidScope (scopeString);
       }
   }
   
   CIMScope & CIMScope::operator= (const CIMScope & scope)
   {
       this->cimScope = scope.cimScope;
       return *this;
   }
   
   void CIMScope::addScope (const Uint32 scope)
   {
       if (scope > CIMScope::ANY)
       {
           //
           //  Invalid scope value
           //
           String scopeString;
           char buffer [32];
           sprintf (buffer, "%lu", (unsigned long) scope);
           scopeString = buffer;
           throw InvalidScope (scopeString);
       }
   
       this->cimScope |= scope;
   }
   
   Boolean CIMScope::hasScope (const Uint32 scope) const
   {
       if ((this->cimScope & scope) == scope)
       {
           return true;
       }
       else
       {
           return false;
       }
   }
   
   Boolean CIMScope::hasScope (const CIMScope & scope) const
   {
       if ((this->cimScope & scope.cimScope) == scope.cimScope)
       {
           return true;
       }
       else
       {
           return false;
       }
   }
   
   Boolean CIMScope::equal (const CIMScope & scope) const
   {
       if (this->cimScope == scope.cimScope)
       {
           return true;
       }
       else
       {
           return false;
       }
   }
   
   String CIMScope::toString () const
 { {
     String tmp;     String tmp;
  
     if (scope & CIMScope::CLASS)      if (this->hasScope (CIMScope::CLASS))
         tmp += "CLASS ";         tmp += "CLASS ";
  
     if (scope & CIMScope::ASSOCIATION)      if (this->hasScope (CIMScope::ASSOCIATION))
         tmp += "ASSOCIATION ";         tmp += "ASSOCIATION ";
  
     if (scope & CIMScope::INDICATION)      if (this->hasScope (CIMScope::INDICATION))
         tmp += "INDICATION ";         tmp += "INDICATION ";
  
     if (scope & CIMScope::PROPERTY)      if (this->hasScope (CIMScope::PROPERTY))
         tmp += "PROPERTY ";         tmp += "PROPERTY ";
  
     if (scope & CIMScope::REFERENCE)      if (this->hasScope (CIMScope::REFERENCE))
         tmp += "REFERENCE ";         tmp += "REFERENCE ";
  
     if (scope & CIMScope::METHOD)      if (this->hasScope (CIMScope::METHOD))
         tmp += "METHOD ";         tmp += "METHOD ";
  
     if (scope & CIMScope::PARAMETER)      if (this->hasScope (CIMScope::PARAMETER))
         tmp += "PARAMETER ";         tmp += "PARAMETER ";
  
     if (tmp.size())     if (tmp.size())


Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2