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

Diff for /pegasus/src/Pegasus/Common/FileSystem.h between version 1.43 and 1.51

version 1.43, 2006/11/10 18:14:58 version 1.51, 2008/08/07 19:20:42
Line 42 
Line 42 
 #include <Pegasus/Common/Linkage.h> #include <Pegasus/Common/Linkage.h>
 #include <fstream> #include <fstream>
 #include <cstdio> #include <cstdio>
 #if defined(PEGASUS_OS_OS400)  
 #include "EBCDIC_OS400.h"  
 #endif  
 #include <Pegasus/Common/Buffer.h> #include <Pegasus/Common/Buffer.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
Line 157 
Line 154 
     */     */
     static Boolean removeFileNoCase(const String& path);     static Boolean removeFileNoCase(const String& path);
  
       /** Produces an array of filenames that match the given pattern under
           the directory given by path. The pattern is limited to asterisks
           only. Examples: "*.txt", "hello*world.c". Returns true on success.
           Return false if the base diretory does not exist or cannot be
           accessed.
       */
       static Boolean glob(
           const String& path,
           const String& pattern,
           Array<String>& filenames);
   
     /** Loads contents of the file into the array. Note that the file is     /** Loads contents of the file into the array. Note that the file is
         opened using binary mode (newline sequences are not expanded to         opened using binary mode (newline sequences are not expanded to
         carriage-return-line-feed sequences on Windows).         carriage-return-line-feed sequences on Windows).
Line 178 
Line 186 
         const String& path1,         const String& path1,
         const String& path2);         const String& path2);
  
     /** Renames a file.      /**
         @param oldPath old name of file.          Renames a file.  If the new name refers to an existing file, it is
         @param newPath new name of file.          removed and replaced with the renamed file.  The rename operation is
         @return true on success.          performed atomically.
           @param oldPath A String containing the name of the file to rename.
           @param newPath A String containing the name to which to rename the file.
           @return A Boolean indicating whether the rename operation was
               successful.
     */     */
     static Boolean renameFile(     static Boolean renameFile(
         const String& oldPath,         const String& oldPath,
         const String& newPath);         const String& newPath);
  
     /** Same as rename file except that the case of the file referred to     /** Same as rename file except that the case of the file referred to
         by oldPath is ignored.          by oldPath is ignored.  The case resolution of the oldPath is
           performed prior to the atomic rename operation.
     */     */
     static Boolean renameFileNoCase(     static Boolean renameFileNoCase(
         const String& oldPath,         const String& oldPath,
Line 344 
Line 357 
     */     */
     static String buildLibraryFileName(const String &libraryName);     static String buildLibraryFileName(const String &libraryName);
  
       /**
          Returns the platform-specific file name extension for dynamic
          libraries.
   
          @return the platform-specific file name extension for dynamic
          libraries.
       */
       static String getDynamicLibraryExtension();
   
     static Boolean changeFileOwner(     static Boolean changeFileOwner(
         const String& fileName,         const String& fileName,
         const String& userName);         const String& userName);
  
       /**
           Flushes the data from the iostream buffers to the OS buffers and
           then flushes the data from the OS buffers to the disk.
   
           This will avoid the possible data loss in case of an OS crash when
           OS filesystem commit directory-level changes immediately while
           file-level changes remain cached (e.g. HP-UX).
   
           @param fstream. The iostream that we want to flush data.
       */
       static void syncWithDirectoryUpdates(PEGASUS_STD(fstream)&);
   
 private: private:
  
     FileSystem() { }     FileSystem() { }
Line 433 
Line 467 
  
 inline Boolean Open(PEGASUS_STD(ifstream)& is, const String& path) inline Boolean Open(PEGASUS_STD(ifstream)& is, const String& path)
 { {
 #if defined(PEGASUS_OS_OS400)  
     is.open(path.getCString(), PEGASUS_STD(_CCSID_T(1208)));  
 #else  
     is.open(path.getCString());     is.open(path.getCString());
 #endif  
     return !!is;     return !!is;
 } }
  
 inline Boolean Open(PEGASUS_STD(ofstream)& os, const String& path) inline Boolean Open(PEGASUS_STD(ofstream)& os, const String& path)
 { {
 #if defined(PEGASUS_OS_OS400)  
     os.open(path.getCString(), PEGASUS_STD(_CCSID_T(1208)));  
 #else  
     os.open(path.getCString());     os.open(path.getCString());
 #endif  
     return !!os;     return !!os;
 } }
  
 inline Boolean OpenAppend(PEGASUS_STD(ofstream)& os, const String& path) inline Boolean OpenAppend(PEGASUS_STD(ofstream)& os, const String& path)
 { {
 #if defined(PEGASUS_OS_OS400)  
     os.open(  
         path.getCString(), PEGASUS_STD(ios::app), PEGASUS_STD(_CCSID_T(1208)));  
 #else  
     os.open(path.getCString(), PEGASUS_STD(ios::app));     os.open(path.getCString(), PEGASUS_STD(ios::app));
 #endif  
     return !!os;     return !!os;
 } }
  


Legend:
Removed from v.1.43  
changed lines
  Added in v.1.51

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2