fcml  1.2.2
Public Member Functions | List of all members
fcml::StatefulDisassembler Class Reference

Stateful disassembler can be used when you have to disassemble a larger piece of code one instruction by one. More...

#include <fcml_stateful_disassembler.hpp>

Public Member Functions

 StatefulDisassembler (Disassembler &disassembler, DisassemblerContext &context, bool enableRendering=false)
 Creates a stateful disassembler for given FCML disassembler and context. More...
 
virtual ~StatefulDisassembler ()
 Destructor. More...
 
StatefulDisassembleroperator>> (Instruction &instruction)
 Disassembles the next instruction pointed by the disassembler state. More...
 
StatefulDisassembleroperator>> (fcml_cstring &instruction)
 Disassembles the next instruction from the buffer and renders it. More...
 
StatefulDisassembleroperator>> (fcml_costream &ostream)
 Disassembles the next instruction from the buffer and renders it directly into the output stream. More...
 
RenderConfiggetRendererConfig ()
 Gets renderer configuration used by the instruction buffer. More...
 
const RenderConfiggetRendererConfig () const
 Gets renderer configuration used by the internally managed instruction renderer. More...
 
const fcml_cstringgetEndOfLine () const
 Gets end of line characters sequence used by the renderer. More...
 
void setEndOfLine (const fcml_cstring &endOfLine)
 Sets dedicated end of line characters. More...
 

Detailed Description

Stateful disassembler can be used when you have to disassemble a larger piece of code one instruction by one.

It also supports rendering directly using internally managed renderer.

Since
1.1.0
Remarks
This class isn't thread-safe.

Constructor & Destructor Documentation

◆ StatefulDisassembler()

fcml::StatefulDisassembler::StatefulDisassembler ( Disassembler disassembler,
DisassemblerContext context,
bool  enableRendering = false 
)
inline

Creates a stateful disassembler for given FCML disassembler and context.

Rendering support can be enabled optionally.

Parameters
disassemblerThe classic FCML disassembler used to disassemble instructions.
contextThe disassembler context.
enableRenderingEnables instruction rendering, which is disabled by default.

◆ ~StatefulDisassembler()

virtual fcml::StatefulDisassembler::~StatefulDisassembler ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ getEndOfLine()

const fcml_cstring& fcml::StatefulDisassembler::getEndOfLine ( ) const
inline

Gets end of line characters sequence used by the renderer.

Returns
End of line characters sequence used by the renderer.
Since
1.1.0

◆ getRendererConfig() [1/2]

RenderConfig& fcml::StatefulDisassembler::getRendererConfig ( )
inline

Gets renderer configuration used by the instruction buffer.

Returns
The renderer configuration.
Since
1.1.0

◆ getRendererConfig() [2/2]

const RenderConfig& fcml::StatefulDisassembler::getRendererConfig ( ) const
inline

Gets renderer configuration used by the internally managed instruction renderer.

Returns
The renderer configuration.
Since
1.1.0

◆ operator>>() [1/3]

StatefulDisassembler& fcml::StatefulDisassembler::operator>> ( Instruction instruction)
inline

Disassembles the next instruction pointed by the disassembler state.

Parameters
[out]instructionThe destination instruction model.
Returns
A reference to the stateful disassembler.
Exceptions
DisassemblingFailedException
Since
1.1.0

◆ operator>>() [2/3]

StatefulDisassembler& fcml::StatefulDisassembler::operator>> ( fcml_cstring instruction)
inline

Disassembles the next instruction from the buffer and renders it.

Parameters
[out]instructionDestination string for the instruction.
Returns
A reference to the stateful disassembler.
Exceptions
DisassemblingFailedException,IllegalStateException,RenderingFailedException
Since
1.1.0

◆ operator>>() [3/3]

StatefulDisassembler& fcml::StatefulDisassembler::operator>> ( fcml_costream ostream)
inline

Disassembles the next instruction from the buffer and renders it directly into the output stream.

Parameters
[out]ostreamThe output stream.
Returns
A reference to the stateful disassembler.
Exceptions
DisassemblingFailedException,IllegalStateException,RenderingFailedException
Since
1.1.0

◆ setEndOfLine()

void fcml::StatefulDisassembler::setEndOfLine ( const fcml_cstring endOfLine)
inline

Sets dedicated end of line characters.

Parameters
endOfLineA sequence of characters used as line ending.
Since
1.1.0

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