QFile.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                                File i/o device                                *
00004 *                                                                               *
00005 *********************************************************************************
00006 *        Copyright (C) 2003-2006 by Niall Douglas.   All Rights Reserved.       *
00007 *       NOTE THAT I DO NOT PERMIT ANY OF MY CODE TO BE PROMOTED TO THE GPL      *
00008 *********************************************************************************
00009 * This code is free software; you can redistribute it and/or modify it under    *
00010 * the terms of the GNU Library General Public License v2.1 as published by the  *
00011 * Free Software Foundation EXCEPT that clause 3 does not apply ie; you may not  *
00012 * "upgrade" this code to the GPL without my prior written permission.           *
00013 * Please consult the file "License_Addendum2.txt" accompanying this file.       *
00014 *                                                                               *
00015 * This code is distributed in the hope that it will be useful,                  *
00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                          *
00018 *********************************************************************************
00019 * $Id:                                                                          *
00020 ********************************************************************************/
00021 
00022 #ifndef QFile_H
00023 #define QFile_H
00024 
00025 #include "QIODevice.h"
00026 #include "FXTime.h"
00027 
00032 
00033 extern "C" { struct stat; }
00034 
00035 namespace FX {
00036 
00074 class QFilePrivate;
00075 class QMemMap;
00076 class FXAPIR QFile : public QIODevice
00077 {
00078     QFilePrivate *p;
00079     QFile(const QFile &);
00080     QFile &operator=(const QFile &);
00081     struct WantStdioType
00082     {
00083         typedef int foo;
00084     };
00085     struct WantLightQFile { };
00086     QFile(WantStdioType);
00087     QFile(const FXString &name, WantLightQFile);
00088     friend class QMemMap;
00089     friend class FXProcess;
00090     FXDLLLOCAL int int_fileDescriptor() const;
00091 public:
00092     QFile();
00094     QFile(const FXString &name);
00095     ~QFile();
00097     const FXString &name() const;
00099     void setName(const FXString &name);
00101     bool exists() const;
00103     bool remove();
00105     FXfval reloadSize();
00110     static QIODevice &stdio(bool applyCRLFTranslation=false);
00111 
00112     using QIODevice::mode;
00113     virtual bool open(FXuint mode);
00114     virtual void close();
00115     virtual void flush();
00116     virtual FXfval size() const;
00117     virtual void truncate(FXfval size);
00118     virtual FXfval at() const;
00119     virtual bool at(FXfval newpos);
00120     virtual bool atEnd() const;
00121     virtual const FXACL &permissions() const;
00122     virtual void setPermissions(const FXACL &perms);
00124     static FXACL permissions(const FXString &path);
00126     static void setPermissions(const FXString &path, const FXACL &perms);
00127     virtual FXuval readBlock(char *data, FXuval maxlen);
00128     virtual FXuval writeBlock(const char *data, FXuval maxlen);
00129     virtual FXuval readBlockFrom(char *data, FXuval maxlen, FXfval pos);
00130     virtual FXuval writeBlockTo(FXfval pos, const char *data, FXuval maxlen);
00131     virtual int ungetch(int c);
00132 };
00133 
00134 }
00135 
00136 #endif

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