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

Representation of a decompilation. More...

#include <decompilation.h>

Inheritance diagram for retdec::Decompilation:
retdec::Resource

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

virtual ~Decompilation () override
 
Querying
int getCompletion ()
 Returns the completion status (in percentages, 0-100). More...
 
int getCompletion () const noexcept
 Returns the completion status (in percentages, 0-100). 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...
 
Obtaining 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...
 
- Public Member Functions inherited from retdec::Resource
virtual ~Resource ()=0
 Destructs the resource. More...
 
std::string getId () const
 Returns the ID of the resource. More...
 
bool hasFinished ()
 Has the resource finished? More...
 
bool hasFinished () const noexcept
 Has the resource finished? More...
 
bool hasSucceeded ()
 Has the resource succeeded? More...
 
bool hasSucceeded () const noexcept
 Has the resource succeeded? More...
 
bool hasFailed ()
 Has the resource failed? More...
 
bool hasFailed () const noexcept
 Has the resource failed? More...
 
std::string getError ()
 Returns the error message (if any). More...
 
std::string getError () const
 Returns the error message (if any). More...
 
 Resource (const Resource &)=delete
 
 Resource (Resource &&)=delete
 
Resourceoperator= (const Resource &)=delete
 
Resourceoperator= (Resource &&)=delete
 

Additional Inherited Members

- Protected Attributes inherited from retdec::Resource
std::unique_ptr< internal::ResourceImpl > pimpl
 Private implementation. More...
 

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 ( )
overridevirtualdefault

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::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.

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: