(file) Return to AssocTable.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Repository / Attic

Diff for /pegasus/src/Pegasus/Repository/Attic/AssocTable.cpp between version 1.3 and 1.7

version 1.3, 2001/06/17 04:20:33 version 1.7, 2001/07/02 01:50:10
Line 46 
Line 46 
 #define TO_PROPERTY_NAME_INDEX 7 #define TO_PROPERTY_NAME_INDEX 7
 #define NUM_FIELDS 8 #define NUM_FIELDS 8
  
 static inline Boolean _Match(const String& x, const String& pattern)  static inline Boolean _MatchNoCase(const String& x, const String& pattern)
 { {
     return pattern.size() == 0 || x == pattern;      return pattern.size() == 0 || String::equalNoCase(x, pattern);
 } }
  
 static String _Escape(const String& str) static String _Escape(const String& str)
Line 125 
Line 125 
                 default:                 default:
                     result += c;                     result += c;
             }             }
   
               i++;
         }         }
         else         else
             result += c;             result += c;
Line 222 
Line 224 
  
 Boolean AssocTable::containsObject( Boolean AssocTable::containsObject(
     const String& path,     const String& path,
     const String& objectName)      const CIMReference& objectName)
 { {
     // Open input file:     // Open input file:
  
     ifstream is;     ifstream is;
  
     if (!Open(is, path))     if (!Open(is, path))
         throw CannotOpenFile(path);          return false;
  
     // Look at each line:     // Look at each line:
  
Line 246 
Line 248 
  
 Boolean AssocTable::deleteAssociation( Boolean AssocTable::deleteAssociation(
     const String& path,     const String& path,
     const String& assocInstanceName)      const CIMReference& assocInstanceName)
 { {
     // Open input file:     // Open input file:
  
     ifstream is;     ifstream is;
  
     if (!Open(is, path))     if (!Open(is, path))
         throw CannotOpenFile(path);          return false;
  
     // Open output file:     // Open output file:
  
Line 297 
Line 299 
  
 Boolean AssocTable::getAssociatorNames( Boolean AssocTable::getAssociatorNames(
     const String& path,     const String& path,
     const String& objectName,      const CIMReference& objectName,
     const String& assocClass,     const String& assocClass,
     const String& resultClass,     const String& resultClass,
     const String& role,     const String& role,
Line 309 
Line 311 
     ifstream is;     ifstream is;
  
     if (!Open(is, path))     if (!Open(is, path))
         throw CannotOpenFile(path);          return false;
  
     // For each line:     // For each line:
  
Line 319 
Line 321 
     while (_GetRecord(is, fields))     while (_GetRecord(is, fields))
     {     {
         if (objectName == fields[FROM_OBJECT_NAME_INDEX] &&         if (objectName == fields[FROM_OBJECT_NAME_INDEX] &&
             _Match(fields[ASSOC_CLASS_NAME_INDEX], assocClass) &&              _MatchNoCase(fields[ASSOC_CLASS_NAME_INDEX], assocClass) &&
             _Match(fields[TO_CLASS_NAME_INDEX], resultRole) &&              _MatchNoCase(fields[TO_CLASS_NAME_INDEX], resultClass) &&
             _Match(fields[FROM_PROPERTY_NAME_INDEX], role) &&              _MatchNoCase(fields[FROM_PROPERTY_NAME_INDEX], role) &&
             _Match(fields[TO_PROPERTY_NAME_INDEX], resultRole))              _MatchNoCase(fields[TO_PROPERTY_NAME_INDEX], resultRole))
         {         {
             associatorNames.append(fields[TO_OBJECT_NAME_INDEX]);             associatorNames.append(fields[TO_OBJECT_NAME_INDEX]);
             found = true;             found = true;
Line 334 
Line 336 
  
 Boolean AssocTable::getReferenceNames( Boolean AssocTable::getReferenceNames(
     const String& path,     const String& path,
     const String& objectName,      const CIMReference& objectName,
     const String& resultClass,     const String& resultClass,
     const String& role,     const String& role,
     Array<String>& referenceNames)     Array<String>& referenceNames)
Line 344 
Line 346 
     ifstream is;     ifstream is;
  
     if (!Open(is, path))     if (!Open(is, path))
         throw CannotOpenFile(path);          return false;
  
     // For each line:     // For each line:
  
Line 354 
Line 356 
     while (_GetRecord(is, fields))     while (_GetRecord(is, fields))
     {     {
         if (objectName == fields[FROM_OBJECT_NAME_INDEX] &&         if (objectName == fields[FROM_OBJECT_NAME_INDEX] &&
             _Match(fields[ASSOC_CLASS_NAME_INDEX], resultClass) &&              _MatchNoCase(fields[ASSOC_CLASS_NAME_INDEX], resultClass) &&
             _Match(fields[FROM_PROPERTY_NAME_INDEX], role))              _MatchNoCase(fields[FROM_PROPERTY_NAME_INDEX], role))
         {         {
             referenceNames.append(fields[ASSOC_INSTANCE_NAME_INDEX]);             referenceNames.append(fields[ASSOC_INSTANCE_NAME_INDEX]);
             found = true;             found = true;


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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2