version 1.15, 2002/08/14 22:32:23
|
version 1.21, 2005/02/05 22:59:23
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2005//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// The Open Group, Tivoli Systems |
// 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. |
// | // |
// 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 |
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include <cstring> | #include <cstring> |
#include <Pegasus/Common/Exception.h> |
#include <Pegasus/Common/InternalException.h> |
#include "CIMScope.h" | #include "CIMScope.h" |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
|
|
| |
Boolean CIMScope::hasScope (const CIMScope & scope) const | Boolean CIMScope::hasScope (const CIMScope & scope) const |
{ | { |
if ((this->cimScope & scope.cimScope) == scope.cimScope) |
return ((this->cimScope & scope.cimScope) == scope.cimScope); |
{ |
|
return true; |
|
} |
|
else |
|
{ |
|
return false; |
|
} |
|
} | } |
| |
Boolean CIMScope::equal (const CIMScope & scope) const | Boolean CIMScope::equal (const CIMScope & scope) const |
{ | { |
if (this->cimScope == scope.cimScope) |
return (this->cimScope == scope.cimScope); |
{ |
|
return true; |
|
} |
|
else |
|
{ |
|
return false; |
|
} |
|
} | } |
| |
CIMScope CIMScope::operator+ (const CIMScope & scope) const | CIMScope CIMScope::operator+ (const CIMScope & scope) const |
|
|
String tmp; | String tmp; |
| |
if (this->hasScope (CIMScope::CLASS)) | if (this->hasScope (CIMScope::CLASS)) |
tmp += "CLASS "; |
tmp.append("CLASS "); |
| |
if (this->hasScope (CIMScope::ASSOCIATION)) | if (this->hasScope (CIMScope::ASSOCIATION)) |
tmp += "ASSOCIATION "; |
tmp.append("ASSOCIATION "); |
| |
if (this->hasScope (CIMScope::INDICATION)) | if (this->hasScope (CIMScope::INDICATION)) |
tmp += "INDICATION "; |
tmp.append("INDICATION "); |
| |
if (this->hasScope (CIMScope::PROPERTY)) | if (this->hasScope (CIMScope::PROPERTY)) |
tmp += "PROPERTY "; |
tmp.append("PROPERTY "); |
| |
if (this->hasScope (CIMScope::REFERENCE)) | if (this->hasScope (CIMScope::REFERENCE)) |
tmp += "REFERENCE "; |
tmp.append("REFERENCE "); |
| |
if (this->hasScope (CIMScope::METHOD)) | if (this->hasScope (CIMScope::METHOD)) |
tmp += "METHOD "; |
tmp.append("METHOD "); |
| |
if (this->hasScope (CIMScope::PARAMETER)) | if (this->hasScope (CIMScope::PARAMETER)) |
tmp += "PARAMETER "; |
tmp.append("PARAMETER "); |
| |
if (tmp.size()) | if (tmp.size()) |
tmp.remove(tmp.size() - 1); | tmp.remove(tmp.size() - 1); |