Synalyze It!  1.10
Public Member Functions | List of all members
Element Class Reference

The Element class. More...

Inheritance diagram for Element:
NumberElement OffsetElement StringElement StructureElement

Public Member Functions

Element Element (ELEMENT_TYPE type, String name, bool setDefaults)
 Constructor. More...
 
String getName ()
 Get name. More...
 
 setName (String name)
 Set name. More...
 
String getDescription ()
 Get description. More...
 
 setDescription (String name)
 Set description. More...
 
 addFixedValue (Value value)
 Add fixed value. More...
 
Structure getEnclosingStructure ()
 Get enclosing structure. More...
 
String getLength ()
 Get length. More...
 
LENGTH_UNIT getLengthUnit ()
 Get length unit. More...
 
 setColorRgb (float red, float green, float blue)
 Set fill color (RGB). More...
 
 setLength (String length, LENGTH_UNIT lengthUnit)
 Set length. More...
 
ELEMENT_TYPE getType ()
 Get type. More...
 
bool mustMatch ()
 Get "must match" flag. More...
 
 setMustMatch (BOOL mustMatch)
 Set "must match" flag. More...
 
Value getMinValue ()
 Get minimum value. More...
 
Value getMaxValue ()
 Get maximum value. More...
 
Element getParent ()
 Get parent. More...
 

Detailed Description

The Element class.

An element object represents one item in a structure.

Author
Andreas Pehnack

Constructor & Destructor Documentation

Element Element ( ELEMENT_TYPE  type,
String  name,
bool  setDefaults 
)

Constructor.

Create object of type Element.

Author
Andreas Pehnack
Date
2012-05-11
Parameters
[in]typeThe type of the element
[in]nameThe name of the element
[in]setDefaultsSet defaults for element?
Returns
The new element

Member Function Documentation

addFixedValue ( Value  value)

Add fixed value.

Add fixed value to element.

Author
Andreas Pehnack
Date
2015-08-31
Parameters
[in]valueThe actual value
String getDescription ( )

Get description.

Get description of element.

Author
Andreas Pehnack
Date
2012-05-11
Returns
The description of the element
See also
setDescription
Structure getEnclosingStructure ( )

Get enclosing structure.

Get the enclosing structure of the element.

Author
Andreas Pehnack
Date
2012-05-11
Returns
The structure the element is part of
String getLength ( )

Get length.

Get length of element. For binary or string elements a length of zero means to fill the enclosing structure. Be aware that lengths can be fractions of bytes so call additionally getLengthUnit()

Author
Andreas Pehnack
Date
2012-05-11
Returns
The length of the element in bytes.
See also
getLengthUnit
LENGTH_UNIT getLengthUnit ( )

Get length unit.

Get length unit of element. Valid values are

  • LENGTH_UNIT_BYTES
  • LENGTH_UNIT_BITS
Author
Andreas Pehnack
Date
2012-05-11
Returns
The length of the element in bits.
See also
getLength
Value getMaxValue ( )

Get maximum value.

Get maximum value of element. This is only valid for numbers. This value will be checked if the "must match" flag is set.

Author
Andreas Pehnack
Date
2012-05-11
Returns
The maximum value of the element.
See also
getMinValue
Value getMinValue ( )

Get minimum value.

Get minimum value of element. This is only valid for numbers. This value will be checked if the "must match" flag is set.

Author
Andreas Pehnack
Date
2012-05-11
Returns
The minimum value of the element.
See also
getMaxValue
String getName ( )

Get name.

Get name of element.

Author
Andreas Pehnack
Date
2012-05-11
Returns
The name of the element
See also
setName
Element getParent ( )

Get parent.

Get parent of element. There is only a parent element if the enclosing structure is inherited from another structure.

Author
Andreas Pehnack
Date
2012-05-11
Returns
The parent of the element.
ELEMENT_TYPE getType ( )

Get type.

Get type of element. This can be one of

  • ELEMENT_BINARY
  • ELEMENT_GRAMMAR_REF
  • ELEMENT_NUMBER
  • ELEMENT_STRING
  • ELEMENT_OFFSET
  • ELEMENT_SCRIPT
  • ELEMENT_STRUCTURE
  • ELEMENT_STRUCTURE_REF
Author
Andreas Pehnack
Date
2012-05-11
Returns
The type of the element.
bool mustMatch ( )

Get "must match" flag.

Get if this element has to match while parsing a file. For this check the min/max values are checked and if one of the fixed values matches (if at least one is defined)

Author
Andreas Pehnack
Date
2012-05-11
Returns
Does the element have to match while parsing?
See also
setMustMatch
setColorRgb ( float  red,
float  green,
float  blue 
)

Set fill color (RGB).

This color is displayed is background color for this element in the hex view.

Author
Andreas Pehnack
Date
2014-03-23
Parameters
[in]redRed color component between 0.0 and 1.0
[in]greenGreen color component between 0.0 and 1.0
[in]blueBlue color component between 0.0 and 1.0
setDescription ( String  name)

Set description.

Set description of element.

Author
Andreas Pehnack
Date
2012-05-11
Parameters
[in]nameThe new description of the element
See also
getDescription
setLength ( String  length,
LENGTH_UNIT  lengthUnit 
)

Set length.

Set length of element. For binary or string elements a length of zero means to fill the enclosing structure. The length can contain variables and expressions. For number and binary elements you can specify a length unit LENGTH_UNIT_BITS additionally to LENGTH_UNIT_BYTES.

Author
Andreas Pehnack
Date
2012-05-11
Parameters
[in]lengthThe new length of the element
[in]lengthUnitThe new length unit (bits/bytes) of the element
See also
getLengthUnit
setMustMatch ( BOOL  mustMatch)

Set "must match" flag.

Set if this element has to match while parsing a file. For this check the min/max values are checked and if one of the fixed values matches (if at least one is defined)

Author
Andreas Pehnack
Date
2012-05-15
See also
mustMatch
setName ( String  name)

Set name.

Set name of element.

Author
Andreas Pehnack
Date
2012-05-11
Parameters
[in]nameThe new name of the element
See also
getName

The documentation for this class was generated from the following file: