(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.7 and 1.23

version 1.7, 2001/06/16 23:10:03 version 1.23, 2006/11/07 21:30:36
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
   // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
   // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 20 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  
 //  
 // Modified By:  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include <cstring> #include <cstring>
   #include <Pegasus/Common/InternalException.h>
 #include "CIMScope.h" #include "CIMScope.h"
 #include "XmlWriter.h"  
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 const Uint32 CIMScope::NONE = 0;  const CIMScope CIMScope::NONE = 0;
 const Uint32 CIMScope::CLASS = 1;  const CIMScope CIMScope::CLASS = 1;
 const Uint32 CIMScope::ASSOCIATION = 2;  const CIMScope CIMScope::ASSOCIATION = 2;
 const Uint32 CIMScope::INDICATION = 4;  const CIMScope CIMScope::INDICATION = 4;
 const Uint32 CIMScope::PROPERTY = 8;  const CIMScope CIMScope::PROPERTY = 8;
 const Uint32 CIMScope::REFERENCE = 16;  const CIMScope CIMScope::REFERENCE = 16;
 const Uint32 CIMScope::METHOD = 32;  const CIMScope CIMScope::METHOD = 32;
 const Uint32 CIMScope::PARAMETER = 64;  const CIMScope CIMScope::PARAMETER = 64;
 const Uint32 CIMScope::ANY = (1 | 2 | 4 | 8 | 16 | 32 | 64 );  const CIMScope CIMScope::ANY = CIMScope::CLASS + CIMScope::ASSOCIATION +
                                  CIMScope::INDICATION + CIMScope::PROPERTY +
                                  CIMScope::REFERENCE + CIMScope::METHOD +
                                  CIMScope::PARAMETER;
  
 String ScopeToString(Uint32 scope)  CIMScope::CIMScope ()
       : cimScope (CIMScope::NONE.cimScope)
 { {
     String tmp;  }
   
     if (scope & CIMScope::CLASS)  
         tmp += "CLASS ";  
   
     if (scope & CIMScope::ASSOCIATION)  
         tmp += "ASSOCIATION ";  
   
     if (scope & CIMScope::INDICATION)  
         tmp += "INDICATION ";  
  
     if (scope & CIMScope::PROPERTY)  CIMScope::CIMScope (const CIMScope & scope)
         tmp += "PROPERTY ";      : cimScope (scope.cimScope)
   {
   }
  
     if (scope & CIMScope::REFERENCE)  CIMScope::CIMScope (const Uint32 scope)
         tmp += "REFERENCE ";      : cimScope (scope)
   {
       PEGASUS_ASSERT (scope < 128);
   }
  
     if (scope & CIMScope::METHOD)  CIMScope & CIMScope::operator= (const CIMScope & scope)
         tmp += "METHOD ";  {
       this->cimScope = scope.cimScope;
       return *this;
   }
  
     if (scope & CIMScope::PARAMETER)  void CIMScope::addScope (const CIMScope & scope)
         tmp += "PARAMETER ";  {
       this->cimScope |= scope.cimScope;
   }
  
     if (tmp.size())  Boolean CIMScope::hasScope (const CIMScope & scope) const
         tmp.remove(tmp.size() - 1);  {
       return ((this->cimScope & scope.cimScope) == scope.cimScope);
   }
  
     return tmp;  Boolean CIMScope::equal (const CIMScope & scope) const
   {
       return (this->cimScope == scope.cimScope);
 } }
  
 void ScopeToXml(Array<Sint8>& out, Uint32 scope)  CIMScope CIMScope::operator+ (const CIMScope & scope) const
 { {
     if (scope)      return CIMScope(this->cimScope | scope.cimScope);
   }
   
   String CIMScope::toString () const
     {     {
         out << "<SCOPE";      String tmp;
  
         if (scope & CIMScope::CLASS)      if (this->hasScope (CIMScope::CLASS))
             out << " CLASS=\"true\"";          tmp.append("CLASS ");
  
         if (scope & CIMScope::ASSOCIATION)      if (this->hasScope (CIMScope::ASSOCIATION))
             out << " ASSOCIATION=\"true\"";          tmp.append("ASSOCIATION ");
  
         if (scope & CIMScope::REFERENCE)      if (this->hasScope (CIMScope::INDICATION))
             out << " REFERENCE=\"true\"";          tmp.append("INDICATION ");
  
         if (scope & CIMScope::PROPERTY)      if (this->hasScope (CIMScope::PROPERTY))
             out << " PROPERTY=\"true\"";          tmp.append("PROPERTY ");
  
         if (scope & CIMScope::METHOD)      if (this->hasScope (CIMScope::REFERENCE))
             out << " METHOD=\"true\"";          tmp.append("REFERENCE ");
  
         if (scope & CIMScope::PARAMETER)      if (this->hasScope (CIMScope::METHOD))
             out << " PARAMETER=\"true\"";          tmp.append("METHOD ");
  
         if (scope & CIMScope::INDICATION)      if (this->hasScope (CIMScope::PARAMETER))
             out << " INDICATION=\"true\"";          tmp.append("PARAMETER ");
  
         out << "/>";      if (tmp.size())
     }          tmp.remove(tmp.size() - 1);
   
       return tmp;
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.7  
changed lines
  Added in v.1.23

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2