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

The Results class. More...

Public Member Functions

Result addStructureStart (Structure structure, long startPos, int iteration, String name, bool addSizeToEnclosing)
 Add start of a structure to the results. More...
 
Result addStructureStartAtPosition (Structure structure, long startPos, int iteration, String name)
 Add start of a structure to the results. More...
 
Result addStructureEnd (long endPos)
 Add end of a structure to the results. More...
 
Result addElement (Element element, long length, int iteration, Value value)
 Add a structure element to the results. Length is specified in bytes. More...
 
Result addElementBits (Element element, long length, int iteration, Value value)
 Add a structure element to the results. Length is specified in bits. More...
 
 cut (Result result)
 Cut results. More...
 
Result getLastResult ()
 Get last result. More...
 
Result getPrevResult (Result result)
 Get previous result. More...
 
Result getResultByName (String name)
 Get result by name. More...
 
Result getRootResult ()
 Get root result. More...
 
 exportToFile (String fileName, Format format)
 Export to file. More...
 

Detailed Description

The Results class.

A results object contains the results of the structure mapping process

Author
Andreas Pehnack
Date
2009-09-08

Member Function Documentation

◆ addElement()

Result addElement ( Element  element,
long  length,
int  iteration,
Value  value 
)

Add a structure element to the results. Length is specified in bytes.

The returned result can be used to remove all results from this on using the cut method.

Author
Andreas Pehnack
Date
2009-09-08
Parameters
[in]elementThe structure element that was mapped
[in]lengthLength of the element in bytes
[in]iterationHow often was this structure element mapped consecutively? (Array of structures)
[in]valueThe value resulting of the element being mapped to the file
Returns
The added result

◆ addElementBits()

Result addElementBits ( Element  element,
long  length,
int  iteration,
Value  value 
)

Add a structure element to the results. Length is specified in bits.

The returned result can be used to remove all results from this on using the cut method.

Author
Andreas Pehnack
Date
2012-06-07
Parameters
[in]elementThe structure element that was mapped
[in]lengthLength of the element in bits
[in]iterationHow often was this structure element mapped consecutively? (Array of structures)
[in]valueThe value resulting of the element being mapped to the file
Returns
The added result

◆ addStructureEnd()

Result addStructureEnd ( long  endPos)

Add end of a structure to the results.

The returned result can be used to remove all results from this on using the cut method.

Author
Andreas Pehnack
Date
2009-09-08
Parameters
[in]endPosWhere in the file did the structure end? Padding bytes are calculated automatically
Returns
The added result

◆ addStructureStart()

Result addStructureStart ( Structure  structure,
long  startPos,
int  iteration,
String  name,
bool  addSizeToEnclosing 
)

Add start of a structure to the results.

The returned result can be used to remove all results from this on using the cut method. This method is used usually when the structure is enclosed in another structure.

Author
Andreas Pehnack
Date
2009-09-08
Parameters
[in]structureThe structure that was mapped
[in]startPosWhere in the file was the structure mapped? (bytes)
[in]iterationHow often was this structure mapped consecutively? (Array of structures)
[in]nameName to show for the result
[in]addSizeToEnclosingAdd size to the enclosing structure result? Set this to true if the structure is actually contained in the enclosing structure in the result tree.
Returns
The added result

◆ addStructureStartAtPosition()

Result addStructureStartAtPosition ( Structure  structure,
long  startPos,
int  iteration,
String  name 
)

Add start of a structure to the results.

The returned result can be used to remove all results from this on using the cut method. This method is used usually when the structure is referenced from another position and not enclosed in another structure.

Author
Andreas Pehnack
Date
2009-09-08
Parameters
[in]structureThe structure that was mapped
[in]startPosWhere in the file was the structure mapped? (bytes)
[in]iterationHow often was this structure mapped consecutively? (for arrays of structures)
[in]nameName to show for the result
Returns
The added result

◆ cut()

cut ( Result  result)

Cut results.

You usually do this when you parsed in a wrong way and need to reparse from a certain position. So save a reference to the result where you may want to restart.

Author
Andreas Pehnack
Parameters
[in]resultFirst result
Date
2009-09-08

◆ exportToFile()

exportToFile ( String  fileName,
Format  format 
)

Export to file.

Export tree of parsing results to XML or text file.

Author
Andreas Pehnack
Date
2015-10-17
Parameters
[in]fileNameOutput file
[in]formatExport format. Can be EXPORT_RESULTS_FORMAT_TEXT or EXPORT_RESULTS_FORMAT_XML

◆ getLastResult()

Result getLastResult ( )

Get last result.

This is the result that was added most recently.

Author
Andreas Pehnack
Date
2009-09-08
Returns
The result or NULL if there is none

◆ getPrevResult()

Result getPrevResult ( Result  result)

Get previous result.

Pass here the successor of the result you want.

Author
Andreas Pehnack
Date
2009-09-08
Parameters
[in]resultThe result you want the predecessor for
Returns
The result or NULL if there is none

◆ getResultByName()

Result getResultByName ( String  name)

Get result by name.

The search starts at the end.

Author
Andreas Pehnack
Date
2011-11-05
Parameters
[in]nameName of the result you're looking for
Returns
The result or NULL if there is none

◆ getRootResult()

Result getRootResult ( )

Get root result.

Get root result which contains the first layer of the parsing results.

Author
Andreas Pehnack
Date
2015-10-17
Returns
The root result or NULL if there is none

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