Changeset View
Changeset View
Standalone View
Standalone View
include/QtCrypto/qpipe.h
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
54 | #endif | 54 | #endif | ||
55 | 55 | | |||
56 | #endif | 56 | #endif | ||
57 | 57 | | |||
58 | // Note: for Windows console, I/O must be in UTF-8. Reads are guaranteed to | 58 | // Note: for Windows console, I/O must be in UTF-8. Reads are guaranteed to | ||
59 | // to completely decode (no partial characters). Likewise, writes must | 59 | // to completely decode (no partial characters). Likewise, writes must | ||
60 | // not contain partial characters. | 60 | // not contain partial characters. | ||
61 | 61 | | |||
62 | namespace QCA { | 62 | namespace QCA | ||
63 | 63 | { | |||
64 | 64 | | |||
65 | /** | 65 | /** | ||
66 | \class QPipeDevice qpipe.h QtCrypto | 66 | \class QPipeDevice qpipe.h QtCrypto | ||
67 | 67 | | |||
68 | Unbuffered direct pipe. | 68 | Unbuffered direct pipe. | ||
69 | 69 | | |||
70 | This class is not usually required except for very low level operations. | 70 | This class is not usually required except for very low level operations. | ||
71 | You should use QPipe and QPipeEnd for most applications. | 71 | You should use QPipe and QPipeEnd for most applications. | ||
72 | 72 | | |||
73 | \ingroup UserAPI | 73 | \ingroup UserAPI | ||
74 | */ | 74 | */ | ||
75 | class QCA_EXPORT QPipeDevice : public QObject | 75 | class QCA_EXPORT QPipeDevice : public QObject | ||
76 | { | 76 | { | ||
77 | Q_OBJECT | 77 | Q_OBJECT | ||
78 | public: | 78 | public: | ||
79 | /** | 79 | /** | ||
80 | The type of device | 80 | The type of device | ||
81 | */ | 81 | */ | ||
82 | enum Type | 82 | enum Type { | ||
83 | { | | |||
84 | Read, ///< The pipe end can be read from | 83 | Read, ///< The pipe end can be read from | ||
85 | Write ///< The pipe end can be written to | 84 | Write ///< The pipe end can be written to | ||
86 | }; | 85 | }; | ||
87 | 86 | | |||
88 | /** | 87 | /** | ||
89 | Standard constructor | 88 | Standard constructor | ||
90 | 89 | | |||
91 | \param parent the parent object to this object | 90 | \param parent the parent object to this object | ||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | |||||
218 | class QCA_EXPORT QPipeEnd : public QObject | 217 | class QCA_EXPORT QPipeEnd : public QObject | ||
219 | { | 218 | { | ||
220 | Q_OBJECT | 219 | Q_OBJECT | ||
221 | public: | 220 | public: | ||
222 | 221 | | |||
223 | /** | 222 | /** | ||
224 | The type of error | 223 | The type of error | ||
225 | */ | 224 | */ | ||
226 | enum Error | 225 | enum Error { | ||
227 | { | | |||
228 | ErrorEOF, ///< End of file error | 226 | ErrorEOF, ///< End of file error | ||
229 | ErrorBroken ///< Broken pipe error | 227 | ErrorBroken ///< Broken pipe error | ||
230 | }; | 228 | }; | ||
231 | 229 | | |||
232 | /** | 230 | /** | ||
233 | Standard constructor | 231 | Standard constructor | ||
234 | 232 | | |||
235 | \param parent the parent object for this object | 233 | \param parent the parent object for this object | ||
▲ Show 20 Lines • Show All 275 Lines • ▼ Show 20 Line(s) | 508 | /** | |||
511 | Create the pipe | 509 | Create the pipe | ||
512 | */ | 510 | */ | ||
513 | bool create(); | 511 | bool create(); | ||
514 | #endif | 512 | #endif | ||
515 | 513 | | |||
516 | /** | 514 | /** | ||
517 | The read end of the pipe. | 515 | The read end of the pipe. | ||
518 | */ | 516 | */ | ||
519 | QPipeEnd & readEnd() { return i; } | 517 | QPipeEnd &readEnd() | ||
518 | { | ||||
519 | return i; | ||||
520 | } | ||||
520 | 521 | | |||
521 | /** | 522 | /** | ||
522 | The write end of the pipe. | 523 | The write end of the pipe. | ||
523 | */ | 524 | */ | ||
524 | QPipeEnd & writeEnd() { return o; } | 525 | QPipeEnd &writeEnd() | ||
526 | { | ||||
527 | return o; | ||||
528 | } | ||||
525 | 529 | | |||
526 | private: | 530 | private: | ||
527 | Q_DISABLE_COPY(QPipe) | 531 | Q_DISABLE_COPY(QPipe) | ||
528 | 532 | | |||
529 | QPipeEnd i, o; | 533 | QPipeEnd i, o; | ||
530 | }; | 534 | }; | ||
531 | 535 | | |||
532 | } | 536 | } | ||
533 | 537 | | |||
534 | #endif | 538 | #endif |