okteta
#include <datainformation.h>
Public Types | |
enum | Columns { ColumnName = 0, ColumnType, ColumnValue, COLUMN_COUNT } |
enum | DataInformationEndianess { EndianessFromSettings = 0, EndianessInherit, EndianessLittle, EndianessBig } |
Public Member Functions | |
DataInformation (const QString &name, DataInformationBase *parent=NULL) | |
virtual | ~DataInformation () |
void | beginRead () |
DataInformationEndianess | byteOrder () const |
virtual bool | canHaveChildren () const =0 |
virtual DataInformation * | child (const QString &name) const |
virtual DataInformation * | childAt (unsigned int) const =0 |
virtual unsigned int | childCount () const =0 |
virtual BitCount64 | childPosition (const DataInformation *child, Okteta::Address start) const =0 |
virtual DataInformation * | clone () const =0 |
virtual QWidget * | createEditWidget (QWidget *parent) const =0 |
virtual QVariant | data (int column, int role) const |
virtual QVariant | dataFromWidget (const QWidget *w) const =0 |
QSysInfo::Endian | effectiveByteOrder () const |
virtual Qt::ItemFlags | flags (int column, bool fileLoaded=true) const |
QString | fullObjectPath () const |
bool | hasBeenUpdated () const |
bool | hasBeenValidated () const |
virtual int | indexOf (const DataInformation *const data) const =0 |
virtual bool | isTopLevel () const |
QDebug | logError () const |
ScriptLogger::LogLevel | loggedData () const |
ScriptLogger * | logger () const |
QDebug | logInfo () const |
QDebug | logWarn () const |
DataInformation * | mainStructure () |
QString | name () const |
DataInformationBase * | parent () const |
virtual BitCount64 | positionInFile (Okteta::Address start) const |
virtual qint64 | readData (Okteta::AbstractByteArrayModel *input, Okteta::Address address, BitCount64 bitsRemaining, quint8 *bitOffset)=0 |
virtual void | resetValidationState () |
int | row () const |
void | setByteOrder (DataInformationEndianess newEndianess) |
void | setCustomTypeName (const QString &customTypeName) |
virtual bool | setData (const QVariant &value, Okteta::AbstractByteArrayModel *out, Okteta::Address address, BitCount64 bitsRemaining, quint8 bitOffset)=0 |
void | setLoggedData (ScriptLogger::LogLevel lvl) const |
void | setName (const QString &newName) |
void | setParent (DataInformationBase *newParent) |
void | setToStringFunction (const QScriptValue &value) |
void | setUpdateFunc (const QScriptValue &func) |
void | setValidationFunc (const QScriptValue &func) |
virtual void | setWidgetData (QWidget *w) const =0 |
virtual BitCount32 | size () const =0 |
virtual QString | sizeString () const |
virtual QString | tooltipString () const |
TopLevelDataInformation * | topLevelDataInformation () const |
virtual QScriptValue | toScriptValue (QScriptEngine *engine, ScriptHandlerInfo *handlerInfo) |
QScriptValue | toScriptValue (TopLevelDataInformation *top) |
QScriptValue | toStringFunction () const |
QString | typeName () const |
QScriptValue | updateFunc () const |
QString | validationError () const |
QScriptValue | validationFunc () const |
bool | validationSuccessful () const |
QString | valueString () const |
bool | wasAbleToRead () const |
Public Member Functions inherited from DataInformationBase | |
DataInformationBase () | |
virtual | ~DataInformationBase () |
ArrayDataInformation * | asArray () |
const ArrayDataInformation * | asArray () const |
AbstractBitfieldDataInformation * | asBitfield () |
const AbstractBitfieldDataInformation * | asBitfield () const |
DataInformation * | asDataInformation () |
const DataInformation * | asDataInformation () const |
DummyDataInformation * | asDummy () |
const DummyDataInformation * | asDummy () const |
EnumDataInformation * | asEnum () |
const EnumDataInformation * | asEnum () const |
PointerDataInformation * | asPointer () |
const PointerDataInformation * | asPointer () const |
PrimitiveDataInformation * | asPrimitive () |
const PrimitiveDataInformation * | asPrimitive () const |
StringDataInformation * | asString () |
const StringDataInformation * | asString () const |
StructureDataInformation * | asStruct () |
const StructureDataInformation * | asStruct () const |
TaggedUnionDataInformation * | asTaggedUnion () |
const TaggedUnionDataInformation * | asTaggedUnion () const |
TopLevelDataInformation * | asTopLevel () |
const TopLevelDataInformation * | asTopLevel () const |
UnionDataInformation * | asUnion () |
const UnionDataInformation * | asUnion () const |
virtual bool | isArray () const |
virtual bool | isBitfield () const |
virtual bool | isDummy () const |
virtual bool | isEnum () const |
virtual bool | isPointer () const |
virtual bool | isPrimitive () const |
virtual bool | isString () const |
virtual bool | isStruct () const |
virtual bool | isTaggedUnion () const |
virtual bool | isUnion () const |
Protected Member Functions | |
DataInformation (const DataInformation &) | |
void | setAdditionalFunction (AdditionalData::AdditionalDataType entry, const QScriptValue &value, const char *name) |
Static Protected Member Functions | |
static QVariant | eofReachedData (int role) |
Protected Attributes | |
AdditionalData | mAdditionalData |
DataInformationEndianess | mByteOrder:2 |
bool | mHasBeenUpdated:1 |
bool | mHasBeenValidated:1 |
ScriptLogger::LogLevel | mLoggedData:2 |
QString | mName |
DataInformationBase * | mParent |
bool | mValidationSuccessful:1 |
bool | mWasAbleToRead:1 |
Detailed Description
Interface that must be implemented by all datatypes.
Definition at line 67 of file datainformation.h.
Member Enumeration Documentation
Enumerator | |
---|---|
ColumnName | |
ColumnType | |
ColumnValue | |
COLUMN_COUNT |
Definition at line 82 of file datainformation.h.
Enumerator | |
---|---|
EndianessFromSettings | |
EndianessInherit | |
EndianessLittle | |
EndianessBig |
Definition at line 86 of file datainformation.h.
Constructor & Destructor Documentation
|
explicitprotected |
Definition at line 43 of file datainformation.cpp.
|
explicit |
Definition at line 37 of file datainformation.cpp.
|
virtual |
Definition at line 50 of file datainformation.cpp.
Member Function Documentation
void DataInformation::beginRead | ( | ) |
sets mWasAbleToRead to false for all children and this object.
Gets called once before the reading of the whole structure starts.
Definition at line 118 of file datainformation.cpp.
|
inline |
Definition at line 288 of file datainformation.h.
|
inlinepure virtual |
true for unions and structs and arrays
Implemented in ArrayDataInformation, DataInformationWithChildren, DummyDataInformation, PrimitiveDataInformation, StringDataInformation, and PointerDataInformation.
Definition at line 273 of file datainformation.h.
|
virtual |
Looks for a child of this object with given name.
- Parameters
-
name The name of the child to find
- Returns
- the child with given
name
orNULL
if none found with that name
Definition at line 228 of file datainformation.cpp.
|
inlinepure virtual |
Implemented in ArrayDataInformation, TaggedUnionDataInformation, DummyDataInformation, DataInformationWithChildren, PrimitiveDataInformation, and StringDataInformation.
Definition at line 268 of file datainformation.h.
|
inlinepure virtual |
Implemented in ArrayDataInformation, TaggedUnionDataInformation, StringDataInformation, DataInformationWithChildren, DummyDataInformation, PrimitiveDataInformation, and PointerDataInformation.
Definition at line 278 of file datainformation.h.
|
pure virtual |
- Parameters
-
child the direct child we want to find the address for start the start of the root element
- Returns
- the address of
child
in the file
Implemented in ArrayDataInformation, StringDataInformation, TaggedUnionDataInformation, DummyDataInformation, PrimitiveDataInformation, PointerDataInformation, StructureDataInformation, and UnionDataInformation.
|
pure virtual |
Implemented in BasicPrimitiveDataInformation< T, C >, and PrimitiveDataInformation.
create a QWidget for the QItemDelegate
Implemented in PrimitiveDataInformationWrapper, StringDataInformation, DataInformationWithChildren, ArrayDataInformation, DummyDataInformation, BasicPrimitiveDataInformation< T, C >, BoolBitfieldDataInformation, SignedBitfieldDataInformation, and UnsignedBitfieldDataInformation.
|
virtual |
get the necessary data (for the model)
Reimplemented in StringDataInformation, and DummyDataInformation.
Definition at line 156 of file datainformation.cpp.
|
pure virtual |
get the needed data from the widget
Implemented in PrimitiveDataInformationWrapper, StringDataInformation, DataInformationWithChildren, ArrayDataInformation, DummyDataInformation, BasicPrimitiveDataInformation< T, C >, BoolBitfieldDataInformation, SignedBitfieldDataInformation, and UnsignedBitfieldDataInformation.
|
inline |
Definition at line 389 of file datainformation.h.
|
staticprotected |
Definition at line 189 of file datainformation.cpp.
|
inlinevirtual |
Reimplemented in StringDataInformation, DummyDataInformation, AbstractBitfieldDataInformation, and PrimitiveDataInformation.
Definition at line 251 of file datainformation.h.
QString DataInformation::fullObjectPath | ( | ) | const |
Definition at line 258 of file datainformation.cpp.
|
inline |
Definition at line 339 of file datainformation.h.
|
inline |
Definition at line 349 of file datainformation.h.
|
pure virtual |
Find the index of a DataInformation in this object, needed to calculate the row.
- Returns
- the index of
data
or -1 if not found
Implemented in DataInformationWithDummyChildren, ArrayDataInformation, TaggedUnionDataInformation, DummyDataInformation, PrimitiveDataInformation, DataInformationWithChildren, and PointerDataInformation.
|
inlinevirtual |
Implements DataInformationBase.
Definition at line 298 of file datainformation.h.
|
inline |
just a shorthand for logger->error(this)
Definition at line 324 of file datainformation.h.
|
inline |
whether data was logged from here (and which level it was)
- Returns
- ScriptLogger::LogInvalid if no data was logged or the level of the most severe log
Definition at line 329 of file datainformation.h.
ScriptLogger * DataInformation::logger | ( | ) | const |
Definition at line 134 of file datainformation.cpp.
|
inline |
just a shorthand for logger->info(this)
Definition at line 314 of file datainformation.h.
|
inline |
just a shorthand for logger->warn(this)
Definition at line 319 of file datainformation.h.
DataInformation * DataInformation::mainStructure | ( | ) |
Definition at line 85 of file datainformation.cpp.
|
inline |
Definition at line 258 of file datainformation.h.
|
inline |
Definition at line 309 of file datainformation.h.
|
virtual |
- Parameters
-
start the starting address of the whole structure
- Returns
- the position in the file where this element is located
Definition at line 75 of file datainformation.cpp.
|
pure virtual |
Reads the necessary data from input
and returns the number of bytes read.
- Parameters
-
input the byte array to read from address the starting offset to read from bitsRemaining the number of bits remaining in out
bitOffset the bits that have already been read from the current byte (should be modified in this method)
- Returns
- the number of bits read or
-1
if none were read
Implemented in PrimitiveDataInformationWrapper, ArrayDataInformation, StringDataInformation, TaggedUnionDataInformation, BasicPrimitiveDataInformation< T, C >, PointerDataInformation, AbstractBitfieldDataInformation, DummyDataInformation, UnionDataInformation, and StructureDataInformation.
|
virtual |
Reimplemented in DataInformationWithChildren.
Definition at line 111 of file datainformation.cpp.
int DataInformation::row | ( | ) | const |
Definition at line 249 of file datainformation.cpp.
|
protected |
Definition at line 139 of file datainformation.cpp.
|
inline |
Definition at line 293 of file datainformation.h.
void DataInformation::setCustomTypeName | ( | const QString & | customTypeName | ) |
Set a custom string to be used for typeName() instead of the default.
- Parameters
-
customTypeName the new name. Pass an empty or null string to revert to default behaviour
Definition at line 103 of file datainformation.cpp.
|
pure virtual |
Writes the current data contained in this object to out.
Implemented in PrimitiveDataInformationWrapper, ArrayDataInformation, StringDataInformation, BasicPrimitiveDataInformation< T, C >, AbstractBitfieldDataInformation, DataInformationWithChildren, and DummyDataInformation.
|
inline |
Definition at line 334 of file datainformation.h.
|
inline |
Definition at line 263 of file datainformation.h.
|
inline |
Definition at line 303 of file datainformation.h.
|
inline |
Definition at line 379 of file datainformation.h.
|
inline |
Definition at line 369 of file datainformation.h.
|
inline |
Definition at line 374 of file datainformation.h.
|
pure virtual |
initialize the delegate widget with the correct data
Implemented in PrimitiveDataInformationWrapper, DataInformationWithChildren, StringDataInformation, ArrayDataInformation, BasicPrimitiveDataInformation< T, C >, DummyDataInformation, BoolBitfieldDataInformation, SignedBitfieldDataInformation, and UnsignedBitfieldDataInformation.
|
pure virtual |
the size in bits of this element
Implemented in PrimitiveDataInformationWrapper, StringDataInformation, TaggedUnionDataInformation, ArrayDataInformation, BasicPrimitiveDataInformation< T, C >, DummyDataInformation, DataInformationWithChildren, UnionDataInformation, and AbstractBitfieldDataInformation.
|
virtual |
needs to be virtual for bitfields
Reimplemented in AbstractBitfieldDataInformation.
Definition at line 56 of file datainformation.cpp.
|
virtual |
Reimplemented in DataInformationWithChildren.
Definition at line 202 of file datainformation.cpp.
TopLevelDataInformation * DataInformation::topLevelDataInformation | ( | ) | const |
Definition at line 240 of file datainformation.cpp.
|
virtual |
This method is virtual since DummyDataInformation has to override it.
- Parameters
-
engine the script engine handlerInfo the object holding the script classes
- Returns
- a QScriptValue wrapping this object
Reimplemented in DummyDataInformation.
Definition at line 275 of file datainformation.cpp.
QScriptValue DataInformation::toScriptValue | ( | TopLevelDataInformation * | top | ) |
the same as above, just using the properties from TopLevelDataInformation
Definition at line 288 of file datainformation.cpp.
|
inline |
Definition at line 364 of file datainformation.h.
|
inline |
Definition at line 406 of file datainformation.h.
|
inline |
Definition at line 354 of file datainformation.h.
|
inline |
Definition at line 384 of file datainformation.h.
|
inline |
Definition at line 359 of file datainformation.h.
|
inline |
Definition at line 344 of file datainformation.h.
|
inline |
by default just returns an empty QString
Definition at line 414 of file datainformation.h.
|
inline |
Definition at line 283 of file datainformation.h.
Member Data Documentation
|
protected |
Definition at line 237 of file datainformation.h.
|
protected |
Definition at line 244 of file datainformation.h.
|
protected |
Definition at line 242 of file datainformation.h.
|
protected |
Definition at line 241 of file datainformation.h.
|
mutableprotected |
Definition at line 245 of file datainformation.h.
|
protected |
Definition at line 239 of file datainformation.h.
|
protected |
Definition at line 238 of file datainformation.h.
|
protected |
Definition at line 240 of file datainformation.h.
|
protected |
Definition at line 243 of file datainformation.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.