(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.11 and 1.21

version 1.11, 2002/05/24 19:20:33 version 1.21, 2004/10/17 20:39:17
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2004////////////////////////////////////////////////////////////////////////
 // //
 // 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.
 // //
 // 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 27 
 // //
 // 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
  
Line 42 
Line 49 
 } }
  
 void SimpleDeclContext::addQualifierDecl( void SimpleDeclContext::addQualifierDecl(
     const String& nameSpace,      const CIMNamespaceName& nameSpace,
     const CIMQualifierDecl& x)     const CIMQualifierDecl& x)
 { {
     if (!lookupQualifierDecl(nameSpace, x.getName()).isNull())      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()).isNull())      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 82 
Line 103 
 } }
  
 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.11  
changed lines
  Added in v.1.21

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2