retdec-cpp
Public Types | Public Member Functions | List of all members
retdec::Decompilation Class Reference

Representation of a decompilation. More...

#include <decompilation.h>

Public Types

enum  OnError { OnError::Throw, OnError::NoThrow }
 What should the waiting member functions do when a decompilation fails? More...
 
using Callback = std::function< void(const Decompilation &decompilation)>
 Type of a callback for waitUntilFinished(). More...
 

Public Member Functions

 ~Decompilation ()
 Destructs the decompilation. More...
 
Querying
std::string getId () const
 Returns the ID of the decompilation. More...
 
bool hasFinished ()
 Has the decompilation finished? More...
 
bool hasFinished () const noexcept
 Has the decompilation finished? More...
 
bool hasSucceeded ()
 Has the decompilation succeeded? More...
 
bool hasSucceeded () const noexcept
 Has the decompilation succeeded? More...
 
bool hasFailed ()
 Has the decompilation failed? More...
 
bool hasFailed () const noexcept
 Has the decompilation failed? More...
 
int getCompletion ()
 Returns the completion status (in percentages, 0-100). More...
 
int getCompletion () const noexcept
 Returns the completion status (in percentages, 0-100). More...
 
std::string getError ()
 Returns the error message (if any). More...
 
std::string getError () const
 Returns the error message (if any). More...
 
Waiting For Decompilation To Finish
void waitUntilFinished (OnError onError=OnError::Throw)
 Waits until the decompilation is finished. More...
 
void waitUntilFinished (const Callback &callback, OnError onError=OnError::Throw)
 Waits and reports changes until the decompilation is finished. More...
 
Getting Outputs
std::shared_ptr< FilegetOutputHllFile ()
 Returns the output HLL file (C, Python'). More...
 
std::string getOutputHll ()
 Returns the content of the output HLL file (C, Python'). More...
 
Disabled
 Decompilation (const Decompilation &)=delete
 
 Decompilation (Decompilation &&)=delete
 
Decompilationoperator= (const Decompilation &)=delete
 
Decompilationoperator= (Decompilation &&)=delete
 

Detailed Description

Representation of a decompilation.

Member Typedef Documentation

using retdec::Decompilation::Callback = std::function<void (const Decompilation &decompilation)>

Type of a callback for waitUntilFinished().

Member Enumeration Documentation

What should the waiting member functions do when a decompilation fails?

Enumerator
Throw 

Throw DecompilationError when a decompilation fails.

NoThrow 

Do not throw DecompilationError when a decompilation fails.

Constructor & Destructor Documentation

retdec::Decompilation::~Decompilation ( )
default

Destructs the decompilation.

retdec::Decompilation::Decompilation ( const Decompilation )
delete
retdec::Decompilation::Decompilation ( Decompilation &&  )
delete

Member Function Documentation

int retdec::Decompilation::getCompletion ( )

Returns the completion status (in percentages, 0-100).

May access the API.

int retdec::Decompilation::getCompletion ( ) const
noexcept

Returns the completion status (in percentages, 0-100).

Does not access the API.

std::string retdec::Decompilation::getError ( )

Returns the error message (if any).

The output from this function is meaningful only if hasFinished() returns true and hasFailed() returns true.

May access the API.

std::string retdec::Decompilation::getError ( ) const

Returns the error message (if any).

The output from this function is meaningful only if hasFinished() returns true and hasFailed() returns true.

Does not access the API.

std::string retdec::Decompilation::getId ( ) const

Returns the ID of the decompilation.

Does not access the API.

std::string retdec::Decompilation::getOutputHll ( )

Returns the content of the output HLL file (C, Python').

This function should be called only after the decompilation has finished, i.e. hasFinished() returns true.

May access the API.

std::shared_ptr< File > retdec::Decompilation::getOutputHllFile ( )

Returns the output HLL file (C, Python').

This function should be called only after the decompilation has finished, i.e. hasFinished() returns true.

May access the API.

bool retdec::Decompilation::hasFailed ( )

Has the decompilation failed?

The output from this function is meaningful only if hasFinished() returns true.

May access the API.

bool retdec::Decompilation::hasFailed ( ) const
noexcept

Has the decompilation failed?

The output from this function is meaningful only if hasFinished() returns true.

Does not access the API.

bool retdec::Decompilation::hasFinished ( )

Has the decompilation finished?

May access the API.

bool retdec::Decompilation::hasFinished ( ) const
noexcept

Has the decompilation finished?

Does not access the API.

bool retdec::Decompilation::hasSucceeded ( )

Has the decompilation succeeded?

The output from this function is meaningful only if hasFinished() returns true.

May access the API.

bool retdec::Decompilation::hasSucceeded ( ) const
noexcept

Has the decompilation succeeded?

The output from this function is meaningful only if hasFinished() returns true.

Does not access the API.

Decompilation& retdec::Decompilation::operator= ( const Decompilation )
delete
Decompilation& retdec::Decompilation::operator= ( Decompilation &&  )
delete
void retdec::Decompilation::waitUntilFinished ( OnError  onError = OnError::Throw)

Waits until the decompilation is finished.

Parameters
[in]onErrorShould DecompilationError be thrown when the decompilation fails?

May access the API.

void retdec::Decompilation::waitUntilFinished ( const Callback callback,
OnError  onError = OnError::Throw 
)

Waits and reports changes until the decompilation is finished.

Parameters
[in]callbackFunction to be called when the decompilation status changes.
[in]onErrorShould DecompilationError be thrown when the decompilation fails?

May access the API.


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