(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.36 and 1.48.6.1

version 1.36, 2005/02/05 22:59:23 version 1.48.6.1, 2007/09/12 15:46:57
Line 1 
Line 1 
 //%2005////////////////////////////////////////////////////////////////////////  //%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.
Line 8 
Line 8 
 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 // EMC Corporation; VERITAS Software Corporation; The Open Group. // 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 27 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  
 //  
 // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  
 //              David Dillard, VERITAS Software Corp.  
 //                  (david.dillard@veritas.com)  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #ifndef Pegasus_FileSystem_h #ifndef Pegasus_FileSystem_h
Line 46 
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 <Pegasus/Common/Buffer.h>
 #include "OS400ConvertChar.h"  
 #endif  
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 160 
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 FileSystem::glob(
           const String& path,
           const String& pattern,
           Array<String>& filenames);
   
       /** Removes all files located under the directory given by *path* that
           match the given pattern. Uses FileSystem::glob() to match file names.
           Example: removeMatchingFiles("/tmp", "*.txt"). Fails if the pattern
           matches a directory. May only remove ordinary files.
       */
       static Boolean removeMatchingFiles(
           const String& path, const String& pattern);
   
     /** 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 168 
Line 181 
         @exception CannotOpenFile         @exception CannotOpenFile
     */     */
     static void loadFileToMemory(     static void loadFileToMemory(
         Array<char>& array,          Buffer& array,
         const String& fileName);         const String& fileName);
  
     /** Determines whether two files have exactly the same content.     /** Determines whether two files have exactly the same content.
Line 333 
Line 346 
        @return the full absolute pathname to the found filename or an empty        @return the full absolute pathname to the found filename or an empty
        string on failure.        string on failure.
     */     */
     static String getAbsoluteFileName(const String &paths, const String &filename);      static String getAbsoluteFileName(
           const String& paths,
           const String& filename);
  
     /**     /**
         Convert a library name to its corresponding file name by adding the         Convert a library name to its corresponding file name by adding the
Line 345 
Line 360 
     */     */
     static String buildLibraryFileName(const String &libraryName);     static String buildLibraryFileName(const String &libraryName);
  
       static Boolean changeFileOwner(
           const String& fileName,
           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 430 
Line 461 
  
 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;
 } }
  
 inline String FileSystem::getPathDelimiter() inline String FileSystem::getPathDelimiter()
 { {
 #if defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)  #if defined(PEGASUS_OS_TYPE_WINDOWS)
   return String(";");   return String(";");
 #else #else
   return String(":");   return String(":");


Legend:
Removed from v.1.36  
changed lines
  Added in v.1.48.6.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2