00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #ifndef QNAMEDPIPE_H
00026 #define QNAMEDPIPE_H
00027
00028 #include <qobject.h>
00029
00030 #ifdef WIN32
00031 #include <QThread>
00032 #include <windows.h>
00033 #include <tchar.h>
00034 class QNamedPipeThread : public QThread
00035 {
00036 public:
00037 QNamedPipeThread(HANDLE, HANDLE, char *);
00038 ~QNamedPipeThread();
00039 void run();
00040 bool finished;
00041 private:
00042 HANDLE hPipe1, hPipe2;
00043 char *pipeName;
00044 };
00045
00046 #endif
00047
00048 class QNamedPipe: public QObject
00049 {
00050 Q_OBJECT;
00051 public:
00052 QNamedPipe(QString identifier);
00053 ~QNamedPipe();
00054
00055 QString getInputFilePath() const;
00056 QString getOutputFilePath() const;
00057 QString getPipeName() const;
00058
00059 private:
00060 QString name, pathIn,pathOut;
00061 static int namedPipesNum;
00062 #ifdef WIN32
00063 QNamedPipeThread * pipeThread;
00064 #endif
00065 void init(QString uniqueIdentifier);
00066 };
00067
00068 #endif
00069