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

FXIODevice.h
1 /********************************************************************************
2 * *
3 * I / O D e v i c e C l a s s *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2005,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXIODEVICE_H
22 #define FXIODEVICE_H
23 
24 #ifndef FXIO_H
25 #include "FXIO.h"
26 #endif
27 
28 namespace FX {
29 
30 
35 class FXAPI FXIODevice : public FXIO {
36 protected:
37  FXInputHandle device;
38 private:
39  FXIODevice(const FXIODevice&);
40  FXIODevice &operator=(const FXIODevice&);
41 public:
42 
44  FXIODevice();
45 
47  FXIODevice(FXInputHandle h,FXuint m=FXIO::Reading);
48 
50  virtual FXbool open(FXInputHandle h,FXuint m=FXIO::Reading);
51 
53  FXInputHandle handle() const { return device; }
54 
56  virtual FXbool setMode(FXuint m);
57 
59  virtual FXbool isOpen() const;
60 
62  virtual FXbool isSerial() const;
63 
65  virtual FXbool attach(FXInputHandle h,FXuint m);
66 
68  virtual FXbool detach();
69 
71  virtual FXlong position() const;
72 
74  virtual FXlong position(FXlong offset,FXuint from=FXIO::Begin);
75 
77  virtual FXival readBlock(void* ptr,FXival count);
78 
80  virtual FXival writeBlock(const void* ptr,FXival count);
81 
83  virtual FXlong truncate(FXlong sz);
84 
86  virtual FXbool flush();
87 
89  virtual FXint eof();
90 
92  virtual FXlong size();
93 
95  virtual FXbool close();
96 
98  virtual ~FXIODevice();
99  };
100 
101 }
102 
103 #endif

Copyright © 1997-2016 Jeroen van der Zijp