• 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
  • kasten
  • gui
  • io
  • streamencoder
  • sourcecode
bytearraysourcecodestreamencoder.h
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Kasten module, made within the KDE community.
3 
4  Copyright 2007-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 BYTEARRAYSOURCECODESTREAMENCODER_H
24 #define BYTEARRAYSOURCECODESTREAMENCODER_H
25 
26 // lib
27 #include "abstractbytearraystreamencoder.h"
28 // Qt
29 #include <QtCore/QString>
30 
31 
32 namespace Kasten2
33 {
34 
35 class SourceCodeStreamEncoderSettings
36 {
37  public:
38  enum PrimitiveDataType
39  {
40  CharType = 0,
41  UnsignedCharType,
42  ShortType,
43  UnsignedShortType,
44  IntegerType,
45  UnsignedIntegerType,
46  FloatType,
47  DoubleType
48  };
49 
50  public:
51  SourceCodeStreamEncoderSettings();
52 
53  public:
54  QString variableName;
55  int dataType;
56  int elementsPerLine;
57  bool unsignedAsHexadecimal;
58 };
59 
60 
61 // TODO: General synchronizer would load matching encoder and decoder
62 // manually defined by desktopfile
63 class ByteArraySourceCodeStreamEncoder : public AbstractByteArrayStreamEncoder
64 {
65  Q_OBJECT
66 
67  public:
68  ByteArraySourceCodeStreamEncoder();
69  virtual ~ByteArraySourceCodeStreamEncoder();
70 
71  public:
72  SourceCodeStreamEncoderSettings settings() const;
73  void setSettings( const SourceCodeStreamEncoderSettings& settings );
74 
75  public:
76  const char* const* dataTypeNames() const;
77  int dataTypesCount() const;
78 
79  protected: // AbstractByteArrayStreamEncoder API
80  virtual bool encodeDataToStream( QIODevice* device,
81  const ByteArrayView* byteArrayView,
82  const Okteta::AbstractByteArrayModel* byteArrayModel,
83  const Okteta::AddressRange& range );
84 
85  protected:
86  QString printFormatted( const Okteta::AbstractByteArrayModel* byteArrayModel, Okteta::Address offset, unsigned int dataSize ) const;
87 
88  protected:
89  SourceCodeStreamEncoderSettings mSettings;
90 };
91 
92 
93 inline SourceCodeStreamEncoderSettings ByteArraySourceCodeStreamEncoder::settings() const { return mSettings; }
94 inline void ByteArraySourceCodeStreamEncoder::setSettings( const SourceCodeStreamEncoderSettings& settings )
95 {
96  mSettings = settings;
97  emit settingsChanged();
98 }
99 
100 }
101 
102 #endif
Kasten2::SourceCodeStreamEncoderSettings
Definition: bytearraysourcecodestreamencoder.h:35
Okteta::Address
qint32 Address
Definition: address.h:34
Okteta::AbstractByteArrayModel
could it be useful to hide the data access behind an iterator? * class KDataBufferIterator { public: ...
Definition: abstractbytearraymodel.h:79
Kasten2::ByteArraySourceCodeStreamEncoder::mSettings
SourceCodeStreamEncoderSettings mSettings
Definition: bytearraysourcecodestreamencoder.h:89
KDE::NumberRange< Address, Size >
Kasten2::SourceCodeStreamEncoderSettings::IntegerType
Definition: bytearraysourcecodestreamencoder.h:44
Kasten2::AbstractByteArrayStreamEncoder
Definition: abstractbytearraystreamencoder.h:45
Kasten2::SourceCodeStreamEncoderSettings::dataType
int dataType
Definition: bytearraysourcecodestreamencoder.h:55
Kasten2::SourceCodeStreamEncoderSettings::UnsignedCharType
Definition: bytearraysourcecodestreamencoder.h:41
Kasten2::ByteArraySourceCodeStreamEncoder::dataTypesCount
int dataTypesCount() const
Definition: bytearraysourcecodestreamencoder.cpp:73
PrimitiveDataType
Definition: primitivedatatype.h:54
Kasten2::ByteArraySourceCodeStreamEncoder::~ByteArraySourceCodeStreamEncoder
virtual ~ByteArraySourceCodeStreamEncoder()
Definition: bytearraysourcecodestreamencoder.cpp:213
Kasten2::SourceCodeStreamEncoderSettings::UnsignedShortType
Definition: bytearraysourcecodestreamencoder.h:43
Kasten2::SourceCodeStreamEncoderSettings::elementsPerLine
int elementsPerLine
Definition: bytearraysourcecodestreamencoder.h:56
Kasten2::SourceCodeStreamEncoderSettings::CharType
Definition: bytearraysourcecodestreamencoder.h:40
Kasten2::SourceCodeStreamEncoderSettings::FloatType
Definition: bytearraysourcecodestreamencoder.h:46
Kasten2::ByteArraySourceCodeStreamEncoder::printFormatted
QString printFormatted(const Okteta::AbstractByteArrayModel *byteArrayModel, Okteta::Address offset, unsigned int dataSize) const
Definition: bytearraysourcecodestreamencoder.cpp:121
Kasten2::SourceCodeStreamEncoderSettings::UnsignedIntegerType
Definition: bytearraysourcecodestreamencoder.h:45
Kasten2::SourceCodeStreamEncoderSettings::unsignedAsHexadecimal
bool unsignedAsHexadecimal
Definition: bytearraysourcecodestreamencoder.h:57
Kasten2::ByteArraySourceCodeStreamEncoder::encodeDataToStream
virtual bool encodeDataToStream(QIODevice *device, const ByteArrayView *byteArrayView, const Okteta::AbstractByteArrayModel *byteArrayModel, const Okteta::AddressRange &range)
Definition: bytearraysourcecodestreamencoder.cpp:75
abstractbytearraystreamencoder.h
Kasten2::SourceCodeStreamEncoderSettings::DoubleType
Definition: bytearraysourcecodestreamencoder.h:47
Kasten2::ByteArraySourceCodeStreamEncoder::ByteArraySourceCodeStreamEncoder
ByteArraySourceCodeStreamEncoder()
Definition: bytearraysourcecodestreamencoder.cpp:68
Kasten2::SourceCodeStreamEncoderSettings::ShortType
Definition: bytearraysourcecodestreamencoder.h:42
Kasten2::ByteArraySourceCodeStreamEncoder::setSettings
void setSettings(const SourceCodeStreamEncoderSettings &settings)
Definition: bytearraysourcecodestreamencoder.h:94
Kasten2::AbstractByteArrayStreamEncoder::settingsChanged
void settingsChanged()
Kasten2::SourceCodeStreamEncoderSettings::variableName
QString variableName
Definition: bytearraysourcecodestreamencoder.h:54
Kasten2::ByteArraySourceCodeStreamEncoder::dataTypeNames
const char *const * dataTypeNames() const
Definition: bytearraysourcecodestreamencoder.cpp:72
Kasten2::SourceCodeStreamEncoderSettings::SourceCodeStreamEncoderSettings
SourceCodeStreamEncoderSettings()
Definition: bytearraysourcecodestreamencoder.cpp:63
QIODevice
Kasten2::ByteArraySourceCodeStreamEncoder::settings
SourceCodeStreamEncoderSettings settings() const
Definition: bytearraysourcecodestreamencoder.h:93
Kasten2::ByteArraySourceCodeStreamEncoder
Definition: bytearraysourcecodestreamencoder.h:63
Kasten2::ByteArrayView
Definition: bytearrayview.h:51
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