(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.25 and 1.43

version 1.25, 2003/01/25 14:38:58 version 1.43, 2006/11/10 18:14:58
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // 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.;
   // 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 21 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  
 //  
 // Modified By:  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #ifndef Pegasus_FileSystem_h #ifndef Pegasus_FileSystem_h
Line 34 
Line 38 
 #include <Pegasus/Common/String.h> #include <Pegasus/Common/String.h>
 #include <Pegasus/Common/ArrayInternal.h> #include <Pegasus/Common/ArrayInternal.h>
 #include <Pegasus/Common/InternalException.h> #include <Pegasus/Common/InternalException.h>
   #include <Pegasus/Common/System.h>
 #include <Pegasus/Common/Linkage.h> #include <Pegasus/Common/Linkage.h>
 #include <fstream> #include <fstream>
   #include <cstdio>
   #if defined(PEGASUS_OS_OS400)
   #include "EBCDIC_OS400.h"
   #endif
   #include <Pegasus/Common/Buffer.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 155 
Line 165 
         @exception CannotOpenFile         @exception CannotOpenFile
     */     */
     static void loadFileToMemory(     static void loadFileToMemory(
         Array<Sint8>& 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 296 
Line 306 
     */     */
     static String extractFilePath(const String& path);     static String extractFilePath(const String& path);
  
       /** Changes file permissions on the given file.
           @param path path of the file.
           @param mode the bit-wise inclusive OR of the values for the
           desired permissions.
           @return true on success, false on error and errno is set appropriately.
       */
       static Boolean changeFilePermissions(const String& path, mode_t mode);
   
       /**
          Return OS path specific delimiter.
   
          @return delimiter specific to the platform
       */
       static String getPathDelimiter();
   
       /**
          Returns the absolute pathname for the specified filename.
   
          @param paths directories seperated by an OS specific delimiter to search
          @param filename filename to search for in the paths
   
          @return the full absolute pathname to the found filename or an empty
          string on failure.
       */
       static String getAbsoluteFileName(
           const String& paths,
           const String& filename);
   
       /**
           Convert a library name to its corresponding file name by adding the
           appropriate prefix and suffix.
   
           @param libraryName The name of the library for which to build the file
                              name.
           @return The file name corresponding to the specified library name.
       */
       static String buildLibraryFileName(const String &libraryName);
   
       static Boolean changeFileOwner(
           const String& fileName,
           const String& userName);
   
 private: private:
  
     FileSystem() { }     FileSystem() { }
Line 367 
Line 419 
  
     if (filename != String::EMPTY)     if (filename != String::EMPTY)
     {     {
         if ((filename[0] != '/') && path && path[0])          if (!System::is_absolute_path(filename.getCString()) && path && path[0])
         {         {
             absolutePath.append(path);             absolutePath.append(path);
             absolutePath.append('/');             absolutePath.append('/');
Line 381 
Line 433 
  
 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()
   {
   #if defined(PEGASUS_OS_TYPE_WINDOWS)
       return String(";");
   #else
       return String(":");
   #endif
   }
   
 /** Get the next line from the input file. /** Get the next line from the input file.
 */ */
 PEGASUS_COMMON_LINKAGE Boolean GetLine(PEGASUS_STD(istream)& is, String& line); PEGASUS_COMMON_LINKAGE Boolean GetLine(PEGASUS_STD(istream)& is, String& line);


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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2