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

Diff for /pegasus/src/Pegasus/Common/FileSystem.cpp between version 1.50 and 1.62.2.3

version 1.50, 2004/05/18 11:03:38 version 1.62.2.3, 2006/03/17 21:40:48
Line 1 
Line 1 
 //%2003////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L. P., IBM Corp., 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.; // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
 // IBM Corp.; EMC Corporation, The Open Group. // 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 28 
Line 34 
 // Modified By: // Modified By:
 //         Ramnath Ravindran(Ramnath.Ravindran@compaq.com) //         Ramnath Ravindran(Ramnath.Ravindran@compaq.com)
 //         Amit K Arora, IBM (amita@in.ibm.com) //         Amit K Arora, IBM (amita@in.ibm.com)
   //         Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
   //         Sean Keenan, Hewlett-Packard Company (sean.keenan@hp.com)
   //         David Dillard, VERITAS Software Corp.
   //             (david.dillard@veritas.com)
   //         Sean Keenan, Hewlett-Packard Company (sean.keenan@hp.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 145 
Line 156 
 } }
  
 void FileSystem::loadFileToMemory( void FileSystem::loadFileToMemory(
     Array<Sint8>& array,      Buffer& array,
     const String& fileName)     const String& fileName)
 { {
     Uint32 fileSize;     Uint32 fileSize;
Line 163 
Line 174 
     size_t n;     size_t n;
  
     while ((n = fread(buffer, 1, sizeof(buffer), fp)) > 0)     while ((n = fread(buffer, 1, sizeof(buffer), fp)) > 0)
         array.append(buffer, n);          array.append(buffer, static_cast<Uint32>(n));
  
     fclose(fp);     fclose(fp);
 } }
Line 416 
Line 427 
   String path = String::EMPTY;   String path = String::EMPTY;
   String root = String::EMPTY;   String root = String::EMPTY;
   String tempPath = paths;   String tempPath = paths;
   
   
   do {   do {
     if (( pos = tempPath.find(FileSystem::getPathDelimiter())) == PEG_NOT_FOUND) {     if (( pos = tempPath.find(FileSystem::getPathDelimiter())) == PEG_NOT_FOUND) {
                 pos = tempPath.size();                 pos = tempPath.size();
Line 434 
Line 447 
           //  cout << "File does not exist.\n";           //  cout << "File does not exist.\n";
           }           }
   } while (tempPath.size() > 0);   } while (tempPath.size() > 0);
   
   return root;   return root;
 } }
  
   String FileSystem::buildLibraryFileName(const String &libraryName)
   {
       String fileName;
   
       //
       // Add the necessary prefix and suffix to convert the library name to its
       // corresponding file name.
       //
   #if defined(PEGASUS_OS_TYPE_WINDOWS)
       fileName = libraryName + String(".dll");
   #elif defined(PEGASUS_PLATFORM_HPUX_PARISC_ACC)
       fileName = String("lib") + libraryName + String(".sl");
   #elif defined(PEGASUS_OS_OS400)
       fileName = libraryName;
   #elif defined(PEGASUS_OS_DARWIN)
       fileName = String("lib") + libraryName + String(".dylib");
   #elif defined(PEGASUS_OS_VMS)
       fileName = String("lib") + libraryName;
   #else
       fileName = String("lib") + libraryName + String(".so");
   #endif
   
       return fileName;
   }
   
  
 Boolean GetLine(PEGASUS_STD(istream)& is, String& line) Boolean GetLine(PEGASUS_STD(istream)& is, String& line)
 { {
     line.clear();     line.clear();
  
     Boolean gotChar = false;     Boolean gotChar = false;
   #ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
       char input[1000];
       is.getline(input,1000);
       line.assign(input);
   
       gotChar = !(is.rdstate() & PEGASUS_STD(istream)::failbit);
   #else
     char c;     char c;
  
     while (is.get(c))     while (is.get(c))
Line 454 
Line 500 
  
         line.append(c);         line.append(c);
     }     }
   #endif
  
     return gotChar;     return gotChar;
 } }


Legend:
Removed from v.1.50  
changed lines
  Added in v.1.62.2.3

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2