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,2022 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);
48 
50  FXInputHandle handle() const { return device; }
51 
53  virtual FXbool isOpen() const;
54 
56  virtual FXuint mode() const;
57 
59  virtual FXbool mode(FXuint m);
60 
62  virtual FXuint perms() const;
63 
65  virtual FXbool perms(FXuint p);
66 
68  virtual FXbool attach(FXInputHandle h);
69 
71  virtual FXbool detach();
72 
74  virtual FXival readBlock(void* ptr,FXival count);
75 
77  virtual FXival writeBlock(const void* ptr,FXival count);
78 
80  virtual FXlong truncate(FXlong sz);
81 
83  virtual FXbool flush();
84 
86  virtual FXint eof();
87 
89  virtual FXlong size();
90 
92  virtual FXbool close();
93 
95  static FXbool valid(FXInputHandle hnd);
96 
98  virtual ~FXIODevice();
99  };
100 
101 }
102 
103 #endif
Definition: FX4Splitter.h:28
FXIODevice manipulates a handle to operating system i/o device, such as pipes, sockets, or files.
Definition: FXIODevice.h:35
FXIO is a base class for a generic i/o device.
Definition: FXIO.h:33
FXInputHandle handle() const
Return handle.
Definition: FXIODevice.h:50

Copyright © 1997-2022 Jeroen van der Zijp