FXFile.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                             F i l e   C l a s s                               *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (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 GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXFile.h,v 1.100 2006/01/22 17:58:01 fox Exp $                            *
00023 ********************************************************************************/
00024 #ifndef FXFILE_H
00025 #define FXFILE_H
00026 
00027 #ifndef FXIO_H
00028 #include "FXIO.h"
00029 #endif
00030 #include "QFile.h"
00031 
00032 
00033 namespace FX {
00034 
00035 
00039 class FXAPI FXFile : public FXIO {
00040 private:
00041   QFile f;
00042   FXFile(const FXFile&);
00043   FXFile &operator=(const FXFile&);
00044 public:
00045 
00047   FXDEPRECATEDEXT FXFile(){ }
00048 
00050   //FXFile(FXInputHandle handle,FXuint mode);
00051 
00053   FXDEPRECATEDEXT FXFile(const FXString& file,FXuint mode=FXIO::Reading,FXuint perm=FXIO::OwnerReadWrite|FXIO::GroupReadWrite|FXIO::OtherReadWrite);
00054 
00056   QFile &qfile() { return f; }
00057   const QFile &qfile() const { return f; }
00058 
00060   virtual bool open(const FXString& file,FXuint mode=FXIO::Reading,FXuint perm=FXIO::OwnerReadWrite|FXIO::GroupReadWrite|FXIO::OtherReadWrite);
00061 
00063   //virtual bool open(FXInputHandle handle,FXuint mode);
00064 
00066   virtual FXlong position() const;
00067 
00069   virtual FXlong position(FXlong offset,FXuint from=FXIO::Begin);
00070 
00072   virtual FXival readBlock(void* data,FXival count);
00073 
00075   virtual FXival writeBlock(const void* data,FXival count);
00076 
00078   virtual FXlong truncate(FXlong size);
00079 
00081   virtual bool flush();
00082 
00084   virtual FXlong size();
00085 
00087   virtual bool eof();
00088 
00090   virtual bool close();
00091 
00092 
00094   static bool create(const FXString& file,FXuint perm=FXIO::OwnerReadWrite|FXIO::GroupReadWrite|FXIO::OtherReadWrite);
00095 
00097   static bool remove(const FXString& file);
00098 
00100   static bool rename(const FXString& srcfile,const FXString& dstfile);
00101 
00103   static bool link(const FXString& srcfile,const FXString& dstfile);
00104 
00106   static FXString symlink(const FXString& file);
00107 
00109   static bool symlink(const FXString& srcfile,const FXString& dstfile);
00110 
00112   static bool identical(const FXString& file1,const FXString& file2);
00113 
00115   static bool copy(const FXString& srcfile,const FXString& dstfile,bool overwrite=false);
00116 
00118   static bool concat(const FXString& srcfile1,const FXString& srcfile2,const FXString& dstfile,bool overwrite=false);
00119 
00120 
00121 
00123   static bool copyFiles(const FXString& srcfile,const FXString& dstfile,bool overwrite=false);
00124 
00126   static bool moveFiles(const FXString& srcfile,const FXString& dstfile,bool overwrite=false);
00127 
00129   static bool removeFiles(const FXString& path,bool recursive=false);
00130 
00132   virtual ~FXFile();
00133   };
00134 
00135 }
00136 
00137 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:20 2009 for TnFOX by doxygen v1.4.7