27 #ifndef FCML_RENDERER_HPP_ 28 #define FCML_RENDERER_HPP_ 60 _throwExceptionOnError(true),
73 _throwExceptionOnError(true),
74 _renderFlags(renderFlags),
75 _preferedMnemonicPadding(0),
76 _preferedCodePadding(0) {
81 return _preferedCodePadding;
86 _preferedCodePadding = preferedCodePadding;
91 return _preferedMnemonicPadding;
96 _preferedMnemonicPadding = preferedMnemonicPadding;
106 _renderFlags = renderFlags;
117 return _throwExceptionOnError;
128 _throwExceptionOnError = throwExceptionOnError;
134 bool _throwExceptionOnError;
136 fcml_uint32_t _renderFlags;
138 fcml_uint16_t _preferedMnemonicPadding;
140 fcml_uint16_t _preferedCodePadding;
191 RenderTypeConverter::convert(renderConfig, render_config);
196 DisassemblerTypeConverter::convert(assemblerResult,
197 disassembler_result);
203 &disassembler_result);
205 DisassemblerTypeConverter::free(disassembler_result);
209 FCML_TEXT(
"Can not render instruction."), error);
#define FCML_REND_MAX_BUFF_LEN
The rendered instruction size can not exceed this value.
Definition: fcml_renderer.h:42
fcml_uint16_t getPreferedMnemonicPadding() const
Definition: fcml_renderer.hpp:90
C++ wrappers common classes.
RenderConfig()
Creates an empty renderer configuration.
Definition: fcml_renderer.hpp:59
C++ wrapper for the FCML disassembler.
RenderConfig(fcml_uint32_t renderFlags)
Creates a renderer configuration for given renderer flags.
Definition: fcml_renderer.hpp:72
std::basic_string< fcml_char > fcml_cstring
By using this type definition here, it will be definitely much easier to support UNICODE in future re...
Definition: fcml_common.hpp:53
#define FCML_TEXT(x)
Used to code literal strings.
Definition: fcml_types.h:61
Converts objects to their structures counterparts.
Definition: fcml_renderer.hpp:149
void setPreferedCodePadding(fcml_uint16_t preferedCodePadding)
Definition: fcml_renderer.hpp:85
fcml_uint16_t prefered_code_padding
Preferred code padding in HEX bytes (2 characters on one byte.).
Definition: fcml_renderer.h:99
void setRenderFlags(fcml_uint32_t renderFlags)
Definition: fcml_renderer.hpp:105
Definition: fcml_assembler.hpp:39
void setThrowExceptionOnError(bool throwExceptionOnError)
Sets the way how the error handling is done.
Definition: fcml_renderer.hpp:127
Inherit from this class in order to get access to the native FCML dialect structure.
Definition: fcml_dialect.hpp:98
Base exception for all exceptions exposed by FCML library.
Definition: fcml_common.hpp:187
Renderer configuration.
Definition: fcml_renderer.h:93
bool isThrowExceptionOnError() const
Returns true if exception should be thrown when disassembling fails.
Definition: fcml_renderer.hpp:116
Reusable disassembler result holder.
Definition: fcml_disassembler.h:267
#define FCML_REND_DEFAULT_CODE_PADDING
Default number of characters used as code padding.
Definition: fcml_renderer.h:86
Structures and functions declarations related to FCML renderers.
fcml_uint16_t prefered_mnemonic_padding
Preferred mnemonic padding in characters.
Definition: fcml_renderer.h:97
Renderer configuration.
Definition: fcml_renderer.hpp:52
LIB_EXPORT void LIB_CALL fcml_fn_disassembler_result_prepare(fcml_st_disassembler_result *result)
Prepares reusable result holder for disassembler.
fcml_ceh_error render(const RenderConfig &renderConfig, DisassemblerResult &assemblerResult, fcml_cstring &result)
Renders a disassembled instruction.
Definition: fcml_renderer.hpp:185
Disassembler result.
Definition: fcml_disassembler.hpp:1877
Component can not be initialized correctly.
Definition: fcml_renderer.hpp:39
Operation succeed.
Definition: fcml_errors.h:42
LIB_EXPORT fcml_ceh_error LIB_CALL fcml_fn_render(const fcml_st_dialect *dialect, const fcml_st_render_config *config, fcml_char *buffer, fcml_usize buffer_len, const fcml_st_disassembler_result *result)
Renders the disassembled instruction into its textual representation.
#define FCML_REND_DEFAULT_MNEMONIC_PADDING
Default number of characters used as mnemonic padding.
Definition: fcml_renderer.h:88
An abstract dialect.
Definition: fcml_dialect.hpp:41
Renderer wrapper.
Definition: fcml_renderer.hpp:163
fcml_uint32_t render_flags
Flags which allows to control rendering process.
Definition: fcml_renderer.h:95
fcml_uint32_t getRenderFlags() const
Definition: fcml_renderer.hpp:100
void setPreferedMnemonicPadding(fcml_uint16_t preferedMnemonicPadding)
Definition: fcml_renderer.hpp:95
fcml_uint16_t getPreferedCodePadding() const
Definition: fcml_renderer.hpp:80
fcml_uint16_t fcml_ceh_error
All error codes should be held in variables of this type.
Definition: fcml_errors.h:156
Renderer(Dialect &dialect)
Creates a renderer instance for the given dialect.
Definition: fcml_renderer.hpp:172