author | kergoth <kergoth> | 2002-06-07 18:53:14 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-06-07 18:53:14 (UTC) |
commit | 640d964cfdc7467f6cacb513087cd3acda2c04f0 (patch) (unidiff) | |
tree | 9a784686c1795f8b1f81eb344598f3b549d43467 /library/qcopmessage_qws.h | |
parent | dfb9c76738bb68e235114c5ad43dbd26a59b98ab (diff) | |
download | opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.zip opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.tar.gz opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.tar.bz2 |
Backing out unintentional merge from TT branch.
-rw-r--r-- | library/qcopmessage_qws.h | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/library/qcopmessage_qws.h b/library/qcopmessage_qws.h deleted file mode 100644 index c19f57d..0000000 --- a/library/qcopmessage_qws.h +++ b/dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of the Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #ifndef QCOP_MESSAGE_H | ||
22 | #define QCOP_MESSAGE_H | ||
23 | |||
24 | #include <qdatastream.h> | ||
25 | #include <qbuffer.h> | ||
26 | |||
27 | class QCopMessage : public QDataStream { | ||
28 | public: | ||
29 | QCopMessage(); | ||
30 | QCopMessage(const QCString& channel, const QCString& message); | ||
31 | QCopMessage(const QCopMessage& orig); | ||
32 | ~QCopMessage(); | ||
33 | |||
34 | void setChannel(QCString& channel) { m_Channel = channel; } | ||
35 | QCString channel() const { return m_Channel; } | ||
36 | void setMessage(QCString& message) { m_Message = message; } | ||
37 | QCString message() const { return m_Message; } | ||
38 | const QByteArray data() const; | ||
39 | |||
40 | QCopMessage& operator=(const QCopMessage& orig); | ||
41 | |||
42 | private: | ||
43 | QCString m_Channel; | ||
44 | QCString m_Message; | ||
45 | }; | ||
46 | |||
47 | // ### No need to inline, just maintaining binary compatability | ||
48 | inline QCopMessage::QCopMessage() : QDataStream(new QBuffer()) { | ||
49 | device()->open(IO_WriteOnly); | ||
50 | } | ||
51 | |||
52 | inline QCopMessage::QCopMessage(const QCString& channel, const QCString& message) | ||
53 | : QDataStream(new QBuffer()), m_Channel(channel), m_Message(message) { | ||
54 | device()->open(IO_WriteOnly); | ||
55 | } | ||
56 | |||
57 | inline QCopMessage::QCopMessage(const QCopMessage& orig) : QDataStream() { | ||
58 | // The QBuffer is going to share the byte array, so it will keep the | ||
59 | // data pointer even when this one goes out of scope. | ||
60 | QByteArray array(((QBuffer*)orig.device())->buffer()); | ||
61 | array.detach(); | ||
62 | setDevice(new QBuffer(array)); | ||
63 | device()->open(IO_Append); | ||
64 | |||
65 | m_Channel = orig.channel(); | ||
66 | m_Message = orig.message(); | ||
67 | } | ||
68 | |||
69 | inline QCopMessage& QCopMessage::operator=(const QCopMessage& orig) { | ||
70 | if (device()) { | ||
71 | delete device(); | ||
72 | unsetDevice(); | ||
73 | } | ||
74 | |||
75 | // The QBuffer is going to share the byte array, so it will keep the | ||
76 | // data pointer even when this one goes out of scope. | ||
77 | QByteArray array(((QBuffer*)orig.device())->buffer()); | ||
78 | array.detach(); | ||
79 | setDevice(new QBuffer(array)); | ||
80 | device()->open(IO_Append); | ||
81 | |||
82 | m_Channel = orig.channel(); | ||
83 | m_Message = orig.message(); | ||
84 | |||
85 | return *this; | ||
86 | } | ||
87 | |||
88 | inline const QByteArray QCopMessage::data() const { | ||
89 | return ((QBuffer*)device())->buffer(); | ||
90 | } | ||
91 | |||
92 | inline QCopMessage::~QCopMessage() { | ||
93 | // If we still have our QBuffer, clean it up... | ||
94 | if (device()) | ||
95 | delete device(); | ||
96 | unsetDevice(); | ||
97 | } | ||
98 | |||
99 | #endif | ||