00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef QPIPE_H
00024 #define QPIPE_H
00025 #include "QIODeviceS.h"
00026
00027 namespace FX {
00028
00033 class FXString;
00034
00108 struct QPipePrivate;
00109 class FXAPIR QPipe : public QIODeviceS
00110 {
00111 QPipePrivate *p;
00112 bool creator, anonymous;
00113 QPipe(const QPipe &);
00114 QPipe &operator=(const QPipe &);
00115 virtual FXDLLLOCAL void *int_getOSHandle() const;
00116 friend class FXIPCChannel;
00117 void FXDLLLOCAL int_hack_makeWriteNonblocking() const;
00118 friend class QChildProcess;
00119 friend struct QChildProcessPrivate;
00120 void FXDLLLOCAL int_hack_makeHandlesInheritable() throw();
00121 void FXDLLLOCAL int_getOSHandles(void **buf) const throw();
00122 void FXDLLLOCAL int_setOSHandles(void **buf) throw();
00123 public:
00124 QPipe();
00130 QPipe(const FXString &name, bool isDeepPipe=false);
00131 ~QPipe();
00132
00134 const FXString &name() const;
00136 void setName(const FXString &name);
00138 bool isUnique() const { return anonymous; }
00140 void setUnique(bool a) { anonymous=a; }
00141
00143 bool create(FXuint mode=IO_ReadWrite);
00145 bool open(FXuint mode=IO_ReadWrite);
00147 void close();
00149 void flush();
00151 bool reset();
00152
00154 bool atEnd() const;
00156 FXfval size() const;
00158 void truncate(FXfval size);
00160 FXfval at() const;
00162 bool at(FXfval newpos);
00163 virtual const FXACL &permissions() const;
00164 virtual void setPermissions(const FXACL &perms);
00166 static FXACL permissions(const FXString &name);
00168 static void setPermissions(const FXString &name, const FXACL &perms);
00169
00178 FXuval readBlock(char *data, FXuval maxlen);
00188 FXuval writeBlock(const char *data, FXuval maxlen);
00189
00191 int ungetch(int);
00192 public:
00197 FXuval maxAtomicLength();
00198 };
00199
00200 }
00201
00202 #endif