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

Diff for /pegasus/src/Pegasus/Common/DeclContext.cpp between version 1.7 and 1.19

version 1.7, 2001/06/16 23:10:04 version 1.19, 2003/07/31 14:27:33
Line 1 
Line 1 
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM  // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
   // The Open Group, Tivoli Systems
 // //
 // 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 22 
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 "DeclContext.h" #include "DeclContext.h"
 #include "CIMName.h" #include "CIMName.h"
   #include <Pegasus/Common/MessageLoader.h> //l10n
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
 #define PEGASUS_ARRAY_T QPair  
 # include "ArrayImpl.h"  
 #undef PEGASUS_ARRAY_T  
   
 #define PEGASUS_ARRAY_T CPair  
 # include "ArrayImpl.h"  
 #undef PEGASUS_ARRAY_T  
   
 DeclContext::~DeclContext() DeclContext::~DeclContext()
 { {
  
Line 50 
Line 45 
 } }
  
 void SimpleDeclContext::addQualifierDecl( void SimpleDeclContext::addQualifierDecl(
     const String& nameSpace,      const CIMNamespaceName& nameSpace,
     const CIMQualifierDecl& x)     const CIMQualifierDecl& x)
 { {
     if (lookupQualifierDecl(nameSpace, x.getName()))      if (!lookupQualifierDecl(nameSpace, x.getName()).isUninitialized()){
         throw AlreadyExists();          //l10n
                   //throw AlreadyExistsException("declaration of qualifier \"" +
                          //x.getName().getString () + "\"");
           MessageLoaderParms parms("Common.DeclContext.DECLARATION_OF_QUALIFIER",
                                                            "declaration of qualifier \"$0\"",
                                                            x.getName().getString());
           throw AlreadyExistsException(parms);
       }
  
     _qualifierDeclarations.append(QPair(nameSpace, x));     _qualifierDeclarations.append(QPair(nameSpace, x));
 } }
  
 void SimpleDeclContext::addClass( void SimpleDeclContext::addClass(
     const String& nameSpace,      const CIMNamespaceName& nameSpace,
     const CIMClass& x)     const CIMClass& x)
 { {
     if (lookupClass(nameSpace, x.getClassName()))      if (!lookupClass(nameSpace, x.getClassName()).isUninitialized()){
         throw AlreadyExists();          //l10n
                   //throw AlreadyExistsException
               //("class \"" + x.getClassName().getString () + "\"");
           MessageLoaderParms parms("Common.DeclContext.CLASS",
                                                            "class \"$0\"",
                                                            x.getClassName().getString());
           throw AlreadyExistsException(parms);
       }
  
     _classDeclarations.append(CPair(nameSpace, x));     _classDeclarations.append(CPair(nameSpace, x));
 } }
  
 CIMQualifierDecl SimpleDeclContext::lookupQualifierDecl( CIMQualifierDecl SimpleDeclContext::lookupQualifierDecl(
     const String& nameSpace,      const CIMNamespaceName& nameSpace,
     const String& name) const      const CIMName& name) const
 { {
     for (Uint32 i = 0, n = _qualifierDeclarations.size(); i < n; i++)     for (Uint32 i = 0, n = _qualifierDeclarations.size(); i < n; i++)
     {     {
         const String& first = _qualifierDeclarations[i].first;          const CIMNamespaceName& first = _qualifierDeclarations[i].first;
         const CIMQualifierDecl& second = _qualifierDeclarations[i].second;         const CIMQualifierDecl& second = _qualifierDeclarations[i].second;
  
         if (CIMName::equal(first, nameSpace) &&          if (first.equal(nameSpace) &&
             CIMName::equal(second.getName(), name))              second.getName().equal(name))
         {         {
             return second;             return second;
         }         }
Line 90 
Line 99 
 } }
  
 CIMClass SimpleDeclContext::lookupClass( CIMClass SimpleDeclContext::lookupClass(
     const String& nameSpace,      const CIMNamespaceName& nameSpace,
     const String& name) const      const CIMName& name) const
 { {
     for (Uint32 i = 0, n = _classDeclarations.size(); i < n; i++)     for (Uint32 i = 0, n = _classDeclarations.size(); i < n; i++)
     {     {
         const String& first = _classDeclarations[i].first;          const CIMNamespaceName& first = _classDeclarations[i].first;
         const CIMClass& second = _classDeclarations[i].second;         const CIMClass& second = _classDeclarations[i].second;
  
         if (CIMName::equal(first, nameSpace) &&          if (first.equal(nameSpace) &&
             CIMName::equal(second.getClassName(), name))              second.getClassName().equal(name))
         {         {
             return second;             return second;
         }         }


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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2