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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXIODevice.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                        I / O   D e v i c e   C l a s s                        *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2005,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 FXIODEVICE_H
00022 #define FXIODEVICE_H
00023 
00024 
00025 #ifndef FXIO_H
00026 #include "FXIO.h"
00027 #endif
00028 
00029 
00030 namespace FX {
00031 
00032 
00037 class FXAPI FXIODevice : public FXIO {
00038 protected:
00039   FXInputHandle device;
00040 private:
00041   FXIODevice(const FXIODevice&);
00042   FXIODevice &operator=(const FXIODevice&);
00043 public:
00044 
00046   FXIODevice();
00047 
00049   FXIODevice(FXInputHandle h,FXuint m);
00050 
00052   virtual FXbool open(FXInputHandle h,FXuint m);
00053 
00055   FXInputHandle handle() const { return device; }
00056 
00058   virtual FXbool isOpen() const;
00059 
00061   virtual FXbool isSerial() const;
00062 
00064   virtual void attach(FXInputHandle h,FXuint m);
00065 
00067   virtual void detach();
00068 
00070   virtual FXlong position() const;
00071 
00073   virtual FXlong position(FXlong offset,FXuint from=FXIO::Begin);
00074 
00076   virtual FXival readBlock(void* data,FXival count);
00077 
00079   virtual FXival writeBlock(const void* data,FXival count);
00080 
00082   virtual FXlong truncate(FXlong size);
00083 
00085   virtual FXbool flush();
00086 
00088   virtual FXbool eof();
00089 
00091   virtual FXlong size();
00092 
00094   virtual FXbool close();
00095 
00097   virtual ~FXIODevice();
00098   };
00099 
00100 }
00101 
00102 #endif

Copyright © 1997-2011 Jeroen van der Zijp