• 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
bytearraymodel.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 2003,2007 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_BYTEARRAYMODEL_H
24 #define OKTETA_BYTEARRAYMODEL_H
25 
26 // lib
27 #include "abstractbytearraymodel.h"
28 #include "bookmarkable.h"
29 #include "bookmarksconstiterator.h"
30 
31 
32 namespace Okteta
33 {
34 
35 class ByteArrayModelPrivate;
36 
41 class OKTETACORE_EXPORT ByteArrayModel : public AbstractByteArrayModel,
42  public Bookmarkable
43 {
44  Q_OBJECT
45  Q_INTERFACES(
46  Okteta::Bookmarkable
47  )
48 
49  friend class ByteArrayModelPrivate;
50 
51  public:
52  ByteArrayModel( Byte* data, int size, int rawSize = -1, bool keepsMemory = true, QObject* parent = 0 );
53  ByteArrayModel( const Byte* data, int size, QObject* parent = 0 );
54  explicit ByteArrayModel( int size = 0, int maxSize = -1, QObject* parent = 0 );
55 
56  virtual ~ByteArrayModel();
57 
58  public: // AbstractByteArrayModel API
59  virtual Byte byte( Address offset ) const;
60  virtual Size size() const;
61  virtual bool isReadOnly() const;
62  virtual bool isModified() const;
63 
64  virtual Size insert( Address offset, const Byte* insertData, int insertLength );
65  virtual Size remove( const AddressRange& removeRange );
66  virtual Size replace( const AddressRange& removeRange, const Byte* insertData, int insertLength );
67  virtual bool swap( Address firstStart, const AddressRange& secondRange );
68  virtual Size fill( Byte fillByte, Address offset = 0, Size fillLength = -1 );
69  virtual void setByte( Address offset, Byte byte );
70 
71  virtual void setModified( bool modified = true );
72  virtual void setReadOnly( bool isReadOnly = true );
73 
74  public: // Okteta::Bookmarkable API
75  virtual void addBookmarks( const QList<Okteta::Bookmark> &bookmarks );
76  virtual void removeBookmarks( const QList<Okteta::Bookmark> &bookmarks );
77  virtual void removeAllBookmarks();
78  virtual void setBookmark( unsigned int index, const Okteta::Bookmark& bookmark );
79 
80  virtual Okteta::BookmarksConstIterator createBookmarksConstIterator() const;
81  virtual const Okteta::Bookmark& bookmarkAt( unsigned int index ) const;
82  virtual const Okteta::Bookmark& bookmarkFor( int offset ) const;
83  virtual bool containsBookmarkFor( int offset ) const;
84  virtual unsigned int bookmarksCount() const;
85 
86  Q_SIGNALS: // Okteta::Bookmarkable API
87  /*virtual*/ void bookmarksAdded( const QList<Okteta::Bookmark> &bookmarks );
88  /*virtual*/ void bookmarksRemoved( const QList<Okteta::Bookmark> &bookmarks );
89  /*virtual*/ void bookmarksModified( bool modified );
90  /*virtual*/ void bookmarksModified( const QList<int>& indizes );
91 
92  public:
93  void setMaxSize( int maxSize );
96  void setKeepsMemory( bool keepsMemory = true );
100  void setAutoDelete( bool autoDelete = true );
101  void setData( Byte* data, int size, int rawSize = -1, bool keepsMemory = true );
102  void signalContentsChanged( int i1, int i2 );
103 
104  public:
105  Byte* data() const;
106  int maxSize() const;
108  bool keepsMemory() const;
109  bool autoDelete() const;
110 
111  protected:
112  ByteArrayModelPrivate* const d;
113 };
114 
115 }
116 
117 #endif
Okteta::ByteArrayModelPrivate
Definition: bytearraymodel_p.h:39
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
abstractbytearraymodel.h
Okteta::Bookmark
Definition: bookmark.h:38
KDE::NumberRange< Address, Size >
Okteta::Byte
unsigned char Byte
Definition: byte.h:29
QObject
Okteta::Bookmarkable
Definition: bookmarkable.h:39
OKTETACORE_EXPORT
#define OKTETACORE_EXPORT
Definition: oktetacore_export.h:36
Okteta::BookmarksConstIterator
Definition: bookmarksconstiterator.h:36
bookmarksconstiterator.h
Okteta::ByteArrayModel::d
ByteArrayModelPrivate *const d
Definition: bytearraymodel.h:112
Okteta::Size
qint32 Size
Definition: size.h:33
Okteta::ByteArrayModel
Definition: bytearraymodel.h:41
bookmarkable.h
QList
Definition: bookmarkable.h:29
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