Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

/home/jeroen/FOX/fox/fox-1.7.33/include/FXFile.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                             F i l e   C l a s s                               *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXFILE_H
00022 #define FXFILE_H
00023 
00024 #ifndef FXIODEVICE_H
00025 #include "FXIODevice.h"
00026 #endif
00027 
00028 
00029 namespace FX {
00030 
00031 
00035 class FXAPI FXFile : public FXIODevice {
00036 private:
00037   FXFile(const FXFile&);
00038   FXFile &operator=(const FXFile&);
00039 public:
00040 
00042   FXFile(){ }
00043 
00045   FXFile(FXInputHandle h,FXuint m);
00046 
00048   FXFile(const FXString& file,FXuint m=FXIO::Reading,FXuint perm=FXIO::AllReadWrite);
00049 
00051   virtual FXbool open(const FXString& file,FXuint m=FXIO::Reading,FXuint perm=FXIO::AllReadWrite);
00052 
00054   virtual FXbool open(FXInputHandle h,FXuint m);
00055 
00057   virtual FXbool isSerial() const;
00058 
00060   virtual FXlong position() const;
00061 
00063   virtual FXlong position(FXlong offset,FXuint from=FXIO::Begin);
00064 
00066   virtual FXival readBlock(void* data,FXival count);
00067 
00069   virtual FXival writeBlock(const void* data,FXival count);
00070 
00072   virtual FXlong truncate(FXlong s);
00073 
00075   virtual FXbool flush();
00076 
00078   virtual FXlong size();
00079 
00081   virtual FXbool eof();
00082 
00084   virtual FXbool close();
00085 
00086 
00088   static FXbool create(const FXString& file,FXuint perm=FXIO::AllReadWrite);
00089 
00091   static FXbool remove(const FXString& file);
00092 
00094   static FXbool rename(const FXString& srcfile,const FXString& dstfile);
00095 
00097   static FXbool link(const FXString& srcfile,const FXString& dstfile);
00098 
00100   static FXString symlink(const FXString& file);
00101 
00103   static FXbool symlink(const FXString& srcfile,const FXString& dstfile);
00104 
00106   static FXbool identical(const FXString& file1,const FXString& file2);
00107 
00109   static FXbool copy(const FXString& srcfile,const FXString& dstfile,FXbool overwrite=false);
00110 
00112   static FXbool concat(const FXString& srcfile1,const FXString& srcfile2,const FXString& dstfile,FXbool overwrite=false);
00113 
00114 
00115 
00117   static FXbool copyFiles(const FXString& srcfile,const FXString& dstfile,FXbool overwrite=false);
00118 
00120   static FXbool moveFiles(const FXString& srcfile,const FXString& dstfile,FXbool overwrite=false);
00121 
00123   static FXbool removeFiles(const FXString& path,FXbool recursive=false);
00124 
00125 
00127   virtual ~FXFile();
00128   };
00129 
00130 }
00131 
00132 #endif

Copyright © 1997-2011 Jeroen van der Zijp