~ubuntu-branches/ubuntu/quantal/psi/quantal

« back to all changes in this revision

Viewing changes to cutestuff/openpgp/gpgproc/qpipe.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2006-01-20 00:20:36 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060120002036-7nw6yo6totip0ee5
Tags: 0.10-2
* Added upstream changelog (Closes: Bug#327748)
* Mention --no-gpg and --no-gpg-agent in manpage (Closes: Bug#204416)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef QPIPE_H
2
 
#define QPIPE_H
3
 
 
4
 
#include<qstring.h>
5
 
#include<qcstring.h>
6
 
 
7
 
#ifdef Q_WS_WIN
8
 
#include<windows.h>
9
 
typedef HANDLE QPipeId;
10
 
#else
11
 
typedef int QPipeId;
12
 
#endif
13
 
 
14
 
class QPipeEnd
15
 
{
16
 
public:
17
 
        enum { Read, Write };
18
 
        QPipeEnd();
19
 
        ~QPipeEnd();
20
 
 
21
 
        bool isOpen() const;
22
 
        const QPipeId & id() const;
23
 
        void setId(const QPipeId &);
24
 
 
25
 
        void close();
26
 
        void release();
27
 
 
28
 
        QString toString() const;
29
 
 
30
 
        int write(const QByteArray &);
31
 
        QByteArray readAll(bool *done=0);
32
 
 
33
 
#ifdef Q_WS_WIN
34
 
        bool winDupHandle();
35
 
#else
36
 
        bool setBlock(bool b);
37
 
#endif
38
 
 
39
 
private:
40
 
        QPipeId p;
41
 
 
42
 
        void reset();
43
 
};
44
 
 
45
 
class QPipe
46
 
{
47
 
public:
48
 
        QPipe();
49
 
        ~QPipe();
50
 
 
51
 
        void closeReadEnd();
52
 
        void closeWriteEnd();
53
 
 
54
 
        int write(const QByteArray &);
55
 
        QByteArray readAll(bool *done=0);
56
 
 
57
 
        QPipeEnd & readEnd() { return i; }
58
 
        QPipeEnd & writeEnd() { return o; }
59
 
 
60
 
        bool open();
61
 
        void close();
62
 
        void release();
63
 
 
64
 
private:
65
 
        QPipeEnd i, o;
66
 
};
67
 
 
68
 
#endif