• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • core
bytearraychange.h
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Core library, made within the KDE community.
3 
4  Copyright 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef OKTETA_BYTEARRAYCHANGE_H
24 #define OKTETA_BYTEARRAYCHANGE_H
25 
26 // lib
27 #include "oktetacore_export.h"
28 #include "arraychangemetrics.h"
29 // Qt
30 #include <QtCore/QByteArray>
31 
32 namespace Okteta
33 {
34 
35 // TODO: do we need the invalid status?
36 // TODO: what about grouped changes
37 // TODO: use change names from original? Only if local are not available
38 class OKTETACORE_EXPORT ByteArrayChange
39 {
40  friend QDataStream& operator<<( QDataStream& outStream, const ByteArrayChange& change );
41  friend QDataStream& operator>>( QDataStream& inStream, ByteArrayChange& change );
42 
43  public:
44  ByteArrayChange();
45  explicit ByteArrayChange( const ArrayChangeMetrics& metrics, const QByteArray& data = QByteArray() );
46 
47  public:
48  const ArrayChangeMetrics& metrics() const;
49  const QByteArray& data() const;
50 
51  protected:
52  ArrayChangeMetrics mMetrics;
53  QByteArray mData;
54 // UserId mUserId;
55 // mTime;
56 };
57 
58 
59 inline ByteArrayChange::ByteArrayChange()
60 {}
61 
62 inline ByteArrayChange::ByteArrayChange( const ArrayChangeMetrics& metrics, const QByteArray& data )
63  : mMetrics( metrics ),
64  mData( data )
65 {}
66 
67 inline const ArrayChangeMetrics& ByteArrayChange::metrics() const { return mMetrics; }
68 inline const QByteArray& ByteArrayChange::data() const { return mData; }
69 
70 
71 QDataStream& operator<<( QDataStream& outStream, const ByteArrayChange& change );
72 QDataStream& operator>>( QDataStream& inStream, ByteArrayChange& change );
73 
74 inline QDataStream& operator<<( QDataStream& outStream, const ByteArrayChange& change )
75 {
76  outStream << change.mMetrics << change.mData;
77  return outStream;
78 }
79 
80 inline QDataStream& operator>>( QDataStream& inStream, ByteArrayChange& change )
81 {
82  inStream >> change.mMetrics >> change.mData;
83  return inStream;
84 }
85 
86 }
87 
88 #endif
Okteta::operator>>
QDataStream & operator>>(QDataStream &inStream, ArrayChangeMetrics &metrics)
Definition: arraychangemetrics.h:160
Okteta::ByteArrayChange::data
const QByteArray & data() const
Definition: bytearraychange.h:68
Okteta::ByteArrayChange::mMetrics
ArrayChangeMetrics mMetrics
Definition: bytearraychange.h:52
OKTETACORE_EXPORT
#define OKTETACORE_EXPORT
Definition: oktetacore_export.h:36
Okteta::ByteArrayChange
Definition: bytearraychange.h:38
Okteta::ByteArrayChange::ByteArrayChange
ByteArrayChange()
Definition: bytearraychange.h:59
Okteta::ByteArrayChange::mData
QByteArray mData
Definition: bytearraychange.h:53
Okteta::ArrayChangeMetrics
Definition: arraychangemetrics.h:38
oktetacore_export.h
Okteta::ByteArrayChange::metrics
const ArrayChangeMetrics & metrics() const
Definition: bytearraychange.h:67
Okteta::operator<<
QDataStream & operator<<(QDataStream &outStream, const ArrayChangeMetrics &metrics)
Definition: arraychangemetrics.h:154
arraychangemetrics.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal