okteta
fixedsizebytearraymodel.cpp
Go to the documentation of this file.
34 FixedSizeByteArrayModel::FixedSizeByteArrayModel( Byte* data, int size, Byte fillUpByte, QObject* parent )
119 emit contentsChanged( ArrayChangeMetricsList::oneReplacement(removeRange.start(), removeRange.width(), 0) );
128 Size FixedSizeByteArrayModel::replace( const AddressRange& _removeRange, const Byte* insertData, int insertLength )
148 memmove( &mData[behindInsertOffset], &mData[removeRange.nextBehindEnd()], mSize-behindInsertOffset );
155 memmove( &mData[removeRange.start()+insertLength], &mData[behindRemoveOffset], mSize-behindRemoveOffset );
164 emit contentsChanged( ArrayChangeMetricsList::oneReplacement(removeRange.start(), removeRange.width(), insertLength) );
186 const Size displacedLength = toRight ? firstStart - secondRange.end()-1 : secondRange.start() - firstStart;
189 Size smallPartLength, largePartLength, smallPartStart, largePartStart, smallPartDest, largePartDest;
243 emit contentsChanged( ArrayChangeMetricsList::oneSwapping(firstStart, secondRange.start(),secondRange.width()) );
275 int FixedSizeByteArrayModel::compare( const AbstractByteArrayModel& other, const AddressRange& _otherRange, Address offset )
278 //kDebug() << QString("offset: %1, otherRange: (%3/%4)" ).arg(offset).arg(otherRange.start()).arg(otherRange.end())
309 // << QString( "range: (%1/%2), otherRange: (%3/%4)" ).arg(range.start()).arg(range.end()).arg(otherRange.start()).arg(otherRange.end())
int compare(const AbstractByteArrayModel &other, const AddressRange &otherRange, Address offset=0)
Definition: fixedsizebytearraymodel.cpp:275
void reset(unsigned int pos, unsigned int length)
Definition: fixedsizebytearraymodel.cpp:327
could it be useful to hide the data access behind an iterator? * class KDataBufferIterator { public: ...
Definition: abstractbytearraymodel.h:79
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: fixedsizebytearraymodel.cpp:173
virtual Size fill(Byte fillByte, Address offset=0, Size fillLength=-1)
fills the buffer with the FillChar.
Definition: fixedsizebytearraymodel.cpp:251
virtual Size insert(Address offset, const Byte *insertData, int insertLength)
inserts bytes copied from the given source at Position.
Definition: fixedsizebytearraymodel.cpp:72
static ArrayChangeMetricsList oneSwapping(Address firstOffset, Size secondOffset, Size secondLength)
Definition: arraychangemetricslist.h:52
void modifiedChanged(bool isModified)
virtual Size remove(const AddressRange &removeRange)
removes beginning with position as much as possible
Definition: fixedsizebytearraymodel.cpp:100
FixedSizeByteArrayModel(Byte *data, int size, Byte fillUpChar= '\0', QObject *parent=0)
creates a readonly buffer around the given data
Definition: fixedsizebytearraymodel.cpp:34
virtual Size size() const =0
virtual Size replace(const AddressRange &removeRange, const Byte *insertData, int insertLength)
replaces as much as possible
Definition: fixedsizebytearraymodel.cpp:128
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: fixedsizebytearraymodel.h:92
static NumberRange fromWidth(AddressstartIndex, Sizewidth)
constructs a range by width
void contentsChanged(const Okteta::ArrayChangeMetricsList &changeList)
static ArrayChangeMetricsList oneReplacement(Address offset, Size removeLength, Size insertLength)
Definition: arraychangemetricslist.h:47
bool endsBehind(T Value) const
returns true if the range ends later than index.
Definition: range.h:101
virtual Byte byte(Address offset) const =0
locates working range The idea behind is to tell buffer which range will be requested in the followin...
Byte mFillUpByte
Definition: fixedsizebytearraymodel.h:82
virtual void setByte(Address offset, Byte byte)
sets a single byte if the offset is not valid the behaviour is undefined
Definition: fixedsizebytearraymodel.cpp:58
virtual ~FixedSizeByteArrayModel()
Definition: fixedsizebytearraymodel.cpp:333
bool mAutoDelete
Definition: fixedsizebytearraymodel.h:88
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
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.