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

okteta

  • Okteta
  • FixedSizeByteArrayModel
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Okteta::FixedSizeByteArrayModel Class Reference

#include <fixedsizebytearraymodel.h>

Inheritance diagram for Okteta::FixedSizeByteArrayModel:
Inheritance graph
[legend]

Public Member Functions

 FixedSizeByteArrayModel (Byte *data, int size, Byte fillUpChar= '\0', QObject *parent=0)
 
 FixedSizeByteArrayModel (int size, Byte fillUpChar= '\0', QObject *parent=0)
 
virtual ~FixedSizeByteArrayModel ()
 
virtual Byte byte (Address offset) const
 
int compare (const AbstractByteArrayModel &other, const AddressRange &otherRange, Address offset=0)
 
int compare (const AbstractByteArrayModel &other, Address otherOffset, Size otherLength, Address offset=0)
 
int compare (const AbstractByteArrayModel &other)
 
virtual Size fill (Byte fillByte, Address offset=0, Size fillLength=-1)
 
virtual Size insert (Address offset, const Byte *insertData, int insertLength)
 
virtual bool isModified () const
 
virtual bool isReadOnly () const
 
Byte * rawData () const
 
virtual Size remove (const AddressRange &removeRange)
 
virtual Size replace (const AddressRange &removeRange, const Byte *insertData, int insertLength)
 
virtual void setByte (Address offset, Byte byte)
 
virtual void setModified (bool modified=true)
 
virtual void setReadOnly (bool readOnly=true)
 
virtual Size size () const
 
virtual bool swap (Address firstStart, const AddressRange &secondRange)
 
- Public Member Functions inherited from Okteta::AbstractByteArrayModel
virtual ~AbstractByteArrayModel ()
 
virtual Size copyTo (Byte *dest, const AddressRange &copyRange) const
 
Size copyTo (Byte *dest, Address offset, Size copyLength) const
 
Size fill (Byte fillChar, const AddressRange &fillRange)
 
virtual Address indexOf (const Byte *pattern, int patternLength, Address fromOffset=0, Address toOffset=-1) const
 
Address indexOf (const QByteArray &pattern, Address fromOffset=0, Address toOffset=-1) const
 
Address indexOfCaseInsensitive (const CharCodec *charCodec, const QByteArray &pattern, Address fromOffset=0, Address toOffset=-1) const
 
Size insert (Address offset, const QByteArray &insertData)
 
virtual Address lastIndexOf (const Byte *pattern, int patternLength, Address fromOffset=-1, Address toOffset=0) const
 
Address lastIndexOf (const QByteArray &pattern, Address fromOffset=-1, Address toOffset=0) const
 
Address lastIndexOfCaseInsensitive (const CharCodec *charCodec, const QByteArray &pattern, Address fromOffset=-1, Address toOffset=0) const
 
Size remove (Address offset, Size removeLength)
 
Size replace (const AddressRange &removeRange, const QByteArray &insertData)
 
Size replace (Address offset, Size removeLength, const Byte *insertData, Size insertLength)
 

Protected Member Functions

void reset (unsigned int pos, unsigned int length)
 
- Protected Member Functions inherited from Okteta::AbstractByteArrayModel
 AbstractByteArrayModel (QObject *parent=0)
 

Protected Attributes

bool mAutoDelete:1
 
Byte * mData
 
Byte mFillUpByte
 
bool mModified:1
 
bool mReadOnly:1
 
int mSize
 

Additional Inherited Members

- Signals inherited from Okteta::AbstractByteArrayModel
void contentsChanged (const Okteta::ArrayChangeMetricsList &changeList)
 
void modifiedChanged (bool isModified)
 
void readOnlyChanged (bool isReadOnly)
 
void searchedBytes (Okteta::Size bytes) const
 

Detailed Description

base class for all mData buffers that are used to display TODO: think about a way to inform KHexEdit that there has been a change in the buffer outside.

what kind of changes are possible?

Author
Friedrich W. H. Kossebau

Definition at line 39 of file fixedsizebytearraymodel.h.

Constructor & Destructor Documentation

Okteta::FixedSizeByteArrayModel::FixedSizeByteArrayModel ( Byte *  data,
int  size,
Byte  fillUpChar = '\0',
QObject *  parent = 0 
)

creates a readonly buffer around the given data

Definition at line 34 of file fixedsizebytearraymodel.cpp.

Okteta::FixedSizeByteArrayModel::FixedSizeByteArrayModel ( int  size,
Byte  fillUpChar = '\0',
QObject *  parent = 0 
)
explicit

creates a writeable buffer which is deleted at the end

Definition at line 45 of file fixedsizebytearraymodel.cpp.

Okteta::FixedSizeByteArrayModel::~FixedSizeByteArrayModel ( )
virtual

Definition at line 333 of file fixedsizebytearraymodel.cpp.

Member Function Documentation

Byte Okteta::FixedSizeByteArrayModel::byte ( Address  offset) const
inlinevirtual

locates working range The idea behind is to tell buffer which range will be requested in the following time, so that e.g.

the corresponding pages will be loaded in advance TODO: do we really need this? Where will this lead to real enhancements?

Parameters
Range
Returns
true if successfully, false otherwiseconvenience function, same as above creates an iterator to expects pointer to memory, should be in prepared range it is only expected to be a valid pointer until any further call to this or any modifying function
Parameters
Section
Returns
pointer to convenience function, same as above requests a single byte if the offset is not valid the behaviour is undefined
Parameters
offsetoffset of the datum requested

Implements Okteta::AbstractByteArrayModel.

Definition at line 92 of file fixedsizebytearraymodel.h.

int Okteta::FixedSizeByteArrayModel::compare ( const AbstractByteArrayModel &  other,
const AddressRange &  otherRange,
Address  offset = 0 
)

Definition at line 275 of file fixedsizebytearraymodel.cpp.

int Okteta::FixedSizeByteArrayModel::compare ( const AbstractByteArrayModel &  other,
Address  otherOffset,
Size  otherLength,
Address  offset = 0 
)
inline

Definition at line 104 of file fixedsizebytearraymodel.h.

int Okteta::FixedSizeByteArrayModel::compare ( const AbstractByteArrayModel &  other)
inline

Definition at line 101 of file fixedsizebytearraymodel.h.

Size Okteta::FixedSizeByteArrayModel::fill ( Byte  fillByte,
Address  offset = 0,
Size  fillLength = -1 
)
virtual

fills the buffer with the FillChar.

If the buffer is to small it will be extended as much as possible.

Parameters
fillBytebyte to use
offsetposition where the filling starts
fillLengthnumber of bytes to fill. If Length is -1, the buffer is filled till the end.
Returns
number of filled bytes

Implements Okteta::AbstractByteArrayModel.

Definition at line 251 of file fixedsizebytearraymodel.cpp.

Size Okteta::FixedSizeByteArrayModel::insert ( Address  offset,
const Byte *  insertData,
int  insertLength 
)
virtual

inserts bytes copied from the given source at Position.

The original data beginnung at the position is moved with the buffer enlarged as needed If the buffer is readOnly this is a noop and returns 0.

Parameters
offset
insertDatadata source
insertLengthnumber of bytes to copy
Returns
length of inserted data

Reimplemented from Okteta::AbstractByteArrayModel.

Definition at line 72 of file fixedsizebytearraymodel.cpp.

bool Okteta::FixedSizeByteArrayModel::isModified ( ) const
inlinevirtual
Returns
true if the buffer has been modified, false otherwise

Implements Okteta::AbstractByteArrayModel.

Definition at line 96 of file fixedsizebytearraymodel.h.

bool Okteta::FixedSizeByteArrayModel::isReadOnly ( ) const
inlinevirtual

Default returns true.

Returns
true if the buffer can only be read, false if writing is allowed

Reimplemented from Okteta::AbstractByteArrayModel.

Definition at line 95 of file fixedsizebytearraymodel.h.

Byte * Okteta::FixedSizeByteArrayModel::rawData ( ) const
inline

Definition at line 107 of file fixedsizebytearraymodel.h.

Size Okteta::FixedSizeByteArrayModel::remove ( const AddressRange &  removeRange)
virtual

removes beginning with position as much as possible

Parameters
removeRange
Returns
length of removed data

Reimplemented from Okteta::AbstractByteArrayModel.

Definition at line 100 of file fixedsizebytearraymodel.cpp.

Size Okteta::FixedSizeByteArrayModel::replace ( const AddressRange &  removeRange,
const Byte *  insertData,
int  insertLength 
)
virtual

replaces as much as possible

Parameters
removeRange
insertData
insertLength
Returns
length of inserted data

Implements Okteta::AbstractByteArrayModel.

Definition at line 128 of file fixedsizebytearraymodel.cpp.

void Okteta::FixedSizeByteArrayModel::reset ( unsigned int  pos,
unsigned int  length 
)
protected

Definition at line 327 of file fixedsizebytearraymodel.cpp.

void Okteta::FixedSizeByteArrayModel::setByte ( Address  offset,
Byte  byte 
)
virtual

sets a single byte if the offset is not valid the behaviour is undefined

Parameters
offsetoffset of the datum requested
bytenew byte value

Implements Okteta::AbstractByteArrayModel.

Definition at line 58 of file fixedsizebytearraymodel.cpp.

void Okteta::FixedSizeByteArrayModel::setModified ( bool  modified = true)
inlinevirtual

sets the modified flag for the buffer

Parameters
modified

Implements Okteta::AbstractByteArrayModel.

Definition at line 99 of file fixedsizebytearraymodel.h.

void Okteta::FixedSizeByteArrayModel::setReadOnly ( bool  isReadOnly = true)
inlinevirtual

sets the readonly flag for the byte array if this is possible.

Default implementation does not do anything.

Parameters
isReadOnlynew state

Reimplemented from Okteta::AbstractByteArrayModel.

Definition at line 98 of file fixedsizebytearraymodel.h.

Size Okteta::FixedSizeByteArrayModel::size ( ) const
inlinevirtual
Returns
the size of the data

Implements Okteta::AbstractByteArrayModel.

Definition at line 93 of file fixedsizebytearraymodel.h.

bool Okteta::FixedSizeByteArrayModel::swap ( Address  firstStart,
const AddressRange &  secondRange 
)
virtual

moves the second section before the start of the first which is the same as moving the first behind the second.

Parameters
firstStartposition of the data where the section should be moved behind
secondRangedata range to be moved
Returns
if operation was successful, otherwise

Implements Okteta::AbstractByteArrayModel.

Definition at line 173 of file fixedsizebytearraymodel.cpp.

Member Data Documentation

bool Okteta::FixedSizeByteArrayModel::mAutoDelete
protected

Definition at line 88 of file fixedsizebytearraymodel.h.

Byte* Okteta::FixedSizeByteArrayModel::mData
protected

Definition at line 78 of file fixedsizebytearraymodel.h.

Byte Okteta::FixedSizeByteArrayModel::mFillUpByte
protected

Definition at line 82 of file fixedsizebytearraymodel.h.

bool Okteta::FixedSizeByteArrayModel::mModified
protected

Definition at line 86 of file fixedsizebytearraymodel.h.

bool Okteta::FixedSizeByteArrayModel::mReadOnly
protected

Definition at line 84 of file fixedsizebytearraymodel.h.

int Okteta::FixedSizeByteArrayModel::mSize
protected

Definition at line 80 of file fixedsizebytearraymodel.h.


The documentation for this class was generated from the following files:
  • fixedsizebytearraymodel.h
  • fixedsizebytearraymodel.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:13 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