QIODeviceS.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                        Base synchronous i/o device                            *
00004 *                                                                               *
00005 *********************************************************************************
00006 *        Copyright (C) 2003 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 QIODEVICES_H
00023 #define QIODEVICES_H
00024 
00025 #include "QIODevice.h"
00026 
00027 namespace FX {
00028 
00052 class FXAPI QIODeviceS : public QIODevice
00053 {
00054 protected:
00055     QIODeviceS(const QIODeviceS &o) : QIODevice(o) { }
00056 public:
00057     QIODeviceS() : QIODevice() { }
00058     virtual bool isSynchronous() const { return true; }
00059 
00061     virtual bool create(FXuint mode=IO_ReadWrite)=0;
00063     virtual bool open(FXuint mode=IO_ReadWrite)=0;
00065     virtual void truncate(FXfval) { }
00067     virtual FXfval at() const { return 0; }
00069     virtual bool at(FXfval) { return false; }
00071     virtual bool atEnd() const { return size()==0; }
00072     // NOTE: Next two are defined in QIODevice.cxx
00074     virtual FXuval readBlockFrom(char *data, FXuval maxlen, FXfval pos);
00076     virtual FXuval writeBlockTo(FXfval pos, const char *data, FXuval maxlen);
00077 public:
00086     static bool waitForData(QIODeviceS **signalled, FXuint no, QIODeviceS **list, FXuint waitfor=FXINFINITE);
00088     static FXuint waitForDataMax() throw();
00089 private:
00090     friend class QSSLDevice;
00091     virtual FXDLLLOCAL void *int_getOSHandle() const=0;
00092 };
00093 
00094 } // namespace
00095 
00096 #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