• 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
filebytearraymodel.cpp
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 #include "filebytearraymodel.h"
24 
25 // lib
26 #include "filebytearraymodel_p.h"
27 // C
28 #include <stdlib.h>
29 
30 
31 namespace Okteta
32 {
33 
34 FileByteArrayModel::FileByteArrayModel( int pageNumber, int pageSize, QObject* parent )
35  : AbstractByteArrayModel( parent ),
36  d( new FileByteArrayModelPrivate(pageNumber,pageSize) )
37 {
38 }
39 
40 Size FileByteArrayModel::size() const { return d->size(); }
41 bool FileByteArrayModel::isReadOnly() const { return d->isReadOnly(); }
42 bool FileByteArrayModel::isModified() const { return false; }
43 bool FileByteArrayModel::isOpen() const { return d->isOpen(); }
44 
45 void FileByteArrayModel::setReadOnly( bool readOnly ) { d->setReadOnly( readOnly ); }
46 void FileByteArrayModel::setModified( bool ) {}
47 void FileByteArrayModel::setByte( Address, Byte ) {}
48 Byte FileByteArrayModel::byte( Address offset ) const { return d->byte( offset ); }
49 
50 Size FileByteArrayModel::insert( Address /*Pos*/, const Byte*, int /*Length*/ ) { return 0; }
51 Size FileByteArrayModel::remove( const AddressRange& /*Section*/ ) { return 0; }
52 Size FileByteArrayModel::replace( const AddressRange& /*Section*/, const Byte*, int /*Length*/ ) { return 0; }
53 Size FileByteArrayModel::fill( Byte /*FillChar*/, Address /*Pos*/, Size /*Length*/ ) { return 0; }
54 bool FileByteArrayModel::swap( Address /*DestPos*/, const AddressRange& /*SourceSection*/ ) { return false; }
55 
56 bool FileByteArrayModel::open( const QString& fileName ) { return d->open( fileName ); }
57 bool FileByteArrayModel::close() { return d->close(); }
58 
59 FileByteArrayModel::~FileByteArrayModel()
60 {
61  delete d;
62 }
63 
64 }
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
Okteta::FileByteArrayModel::setByte
virtual void setByte(Address offset, Byte byte)
sets a single byte if the offset is not valid the behaviour is undefined
Definition: filebytearraymodel.cpp:47
Okteta::FileByteArrayModel::isReadOnly
virtual bool isReadOnly() const
Default returns true.
Definition: filebytearraymodel.cpp:41
Okteta::FileByteArrayModel::replace
virtual Size replace(const AddressRange &removeRange, const Byte *insertData, int insertLength)
replaces as much as possible
Definition: filebytearraymodel.cpp:52
Okteta::FileByteArrayModel::FileByteArrayModel
FileByteArrayModel(int pageNumber=50, int pageSize=4096, QObject *parent=0)
default is only 50*4k = 200k memory image
Definition: filebytearraymodel.cpp:34
Okteta::FileByteArrayModel::~FileByteArrayModel
virtual ~FileByteArrayModel()
Definition: filebytearraymodel.cpp:59
Okteta::FileByteArrayModelPrivate::isOpen
bool isOpen() const
Definition: filebytearraymodel_p.h:94
KDE::NumberRange< Address, Size >
Okteta::FileByteArrayModelPrivate::setReadOnly
void setReadOnly(bool readonly)
Definition: filebytearraymodel_p.h:92
Okteta::Byte
unsigned char Byte
Definition: byte.h:29
Okteta::FileByteArrayModelPrivate
Definition: filebytearraymodel_p.h:36
Okteta::FileByteArrayModel::isOpen
bool isOpen() const
Definition: filebytearraymodel.cpp:43
filebytearraymodel.h
QObject
Okteta::FileByteArrayModelPrivate::size
Size size() const
Definition: filebytearraymodel_p.h:90
Okteta::FileByteArrayModel::insert
virtual Size insert(Address offset, const Byte *insertData, int insertLength)
inserts bytes copied from the given source at Position.
Definition: filebytearraymodel.cpp:50
Okteta::FileByteArrayModel::close
bool close()
Definition: filebytearraymodel.cpp:57
Okteta::FileByteArrayModel::open
bool open(const QString &filename)
Definition: filebytearraymodel.cpp:56
Okteta::FileByteArrayModel::isModified
virtual bool isModified() const
Definition: filebytearraymodel.cpp:42
Okteta::FileByteArrayModel::swap
virtual bool swap(Address firstStart, const AddressRange &secondRange)
moves the second section before the start of the first which is the same as moving the first behind t...
Definition: filebytearraymodel.cpp:54
Okteta::FileByteArrayModel::setReadOnly
void setReadOnly(bool readOnly=true)
sets the readonly flag for the byte array if this is possible.
Definition: filebytearraymodel.cpp:45
Okteta::FileByteArrayModel::fill
virtual Size fill(Byte fillByte, Address offset=0, Size fillLength=-1)
fills the buffer with the FillChar.
Definition: filebytearraymodel.cpp:53
Okteta::FileByteArrayModel::d
FileByteArrayModelPrivate *const d
Definition: filebytearraymodel.h:70
Okteta::FileByteArrayModelPrivate::isReadOnly
bool isReadOnly() const
Definition: filebytearraymodel_p.h:91
Okteta::FileByteArrayModelPrivate::close
bool close()
Okteta::FileByteArrayModel::size
virtual Size size() const
Definition: filebytearraymodel.cpp:40
Okteta::Size
qint32 Size
Definition: size.h:33
filebytearraymodel_p.h
Okteta::FileByteArrayModel::setModified
virtual void setModified(bool modified=true)
sets the modified flag for the buffer
Definition: filebytearraymodel.cpp:46
Okteta::FileByteArrayModel::byte
virtual Byte byte(Address offset) const
locates working range The idea behind is to tell buffer which range will be requested in the followin...
Definition: filebytearraymodel.cpp:48
Okteta::FileByteArrayModel::remove
virtual Size remove(const AddressRange &removeRange)
removes beginning with position as much as possible
Definition: filebytearraymodel.cpp:51
Okteta::FileByteArrayModelPrivate::open
bool open(const QString &fileName)
Okteta::FileByteArrayModelPrivate::byte
Byte byte(Address offset) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:08 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