UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FInteractiveProcess Class Reference

#include <InteractiveProcess.h>

+ Inheritance diagram for FInteractiveProcess:

Public Member Functions

CORE_API FInteractiveProcess (const FString &InURL, const FString &InParams, bool InHidden, bool LongTime=false)
 
CORE_API FInteractiveProcess (const FString &InURL, const FString &InParams, const FString &InWorkingDir, bool InHidden, bool LongTime=false)
 
CORE_API ~FInteractiveProcess ()
 
CORE_API FTimespan GetDuration () const
 
FProcHandle GetProcessHandle () const
 
bool IsRunning () const
 
CORE_API bool Launch ()
 
FSimpleDelegateOnCanceled ()
 
FOnInteractiveProcessCompletedOnCompleted ()
 
FOnInteractiveProcessOutputOnOutput ()
 
CORE_API void SendWhenReady (const FString &Message)
 
CORE_API void SendWhenReady (const TArray< uint8 > &Data)
 
int GetReturnCode () const
 
void Cancel (bool InKillTree=false)
 
virtual bool Init () override
 
virtual CORE_API uint32 Run () override
 
virtual void Stop () override
 
virtual void Exit () override
 
- Public Member Functions inherited from FRunnable
virtual class FSingleThreadRunnableGetSingleThreadInterface ()
 
virtual ~FRunnable ()
 

Protected Member Functions

CORE_API void ProcessOutput (const FString &Output)
 
CORE_API void SendMessageToProcessIf ()
 

Detailed Description

Implements an external process that can be interacted.

Constructor & Destructor Documentation

◆ FInteractiveProcess() [1/2]

FInteractiveProcess::FInteractiveProcess ( const FString &  InURL,
const FString &  InParams,
bool  InHidden,
bool  LongTime = false 
)

Creates a new interactive process.

Parameters
InURLThe URL of the executable to launch.
InParamsThe command line parameters.
InHiddenWhether the window of the process should be hidden.

◆ FInteractiveProcess() [2/2]

FInteractiveProcess::FInteractiveProcess ( const FString &  InURL,
const FString &  InParams,
const FString &  InWorkingDir,
bool  InHidden,
bool  LongTime = false 
)

Creates a new interactive process.

Parameters
InURLThe URL of the executable to launch.
InParamsThe command line parameters.
InWorkingDirThe URL of the working dir where the executable should launch.
InHiddenWhether the window of the process should be hidden.

< 10 milliseconds sleep

◆ ~FInteractiveProcess()

FInteractiveProcess::~FInteractiveProcess ( )

Destructor.

Member Function Documentation

◆ Cancel()

void FInteractiveProcess::Cancel ( bool  InKillTree = false)
inline

Cancels the process.

Parameters
InKillTreeWhether to kill the entire process tree when canceling this process.

◆ Exit()

virtual void FInteractiveProcess::Exit ( void  )
inlineoverridevirtual

Exits the runnable object.

Called in the context of the aggregating thread to perform any cleanup.

See also
Init, Run, Stop

Reimplemented from FRunnable.

◆ GetDuration()

FTimespan FInteractiveProcess::GetDuration ( ) const

Gets the duration of time that the task has been running.

Returns
Time duration.

◆ GetProcessHandle()

FProcHandle FInteractiveProcess::GetProcessHandle ( ) const
inline

Gets the Process Handle. The instance can be invalid if the process was not created.

Returns
The Process Handle

◆ GetReturnCode()

int FInteractiveProcess::GetReturnCode ( ) const
inline

Returns the return code from the exited process

Returns
Process return code

◆ Init()

virtual bool FInteractiveProcess::Init ( void  )
inlineoverridevirtual

Initializes the runnable object.

This method is called in the context of the thread object that aggregates this, not the thread that passes this runnable to a new thread.

Returns
True if initialization was successful, false otherwise
See also
Run, Stop, Exit

Reimplemented from FRunnable.

◆ IsRunning()

bool FInteractiveProcess::IsRunning ( ) const
inline

Checks whether the process is still running.

Returns
true if the process is running, false otherwise.

◆ Launch()

bool FInteractiveProcess::Launch ( )

Launches the process

Returns
True if succeed

◆ OnCanceled()

FSimpleDelegate & FInteractiveProcess::OnCanceled ( )
inline

Returns a delegate that is executed when the process has been canceled.

Returns
The delegate.

◆ OnCompleted()

FOnInteractiveProcessCompleted & FInteractiveProcess::OnCompleted ( )
inline

Returns a delegate that is executed when the interactive process completed. Delegate won't be executed if process terminated without user wanting

Returns
The delegate.

◆ OnOutput()

FOnInteractiveProcessOutput & FInteractiveProcess::OnOutput ( )
inline

Returns a delegate that is executed when a interactive process produces output.

Returns
The delegate.

◆ ProcessOutput()

void FInteractiveProcess::ProcessOutput ( const FString &  Output)
protected

Processes the given output string.

Parameters
OutputThe output string to process.

◆ Run()

uint32 FInteractiveProcess::Run ( )
overridevirtual

Runs the runnable object.

This is where all per object thread work is done. This is only called if the initialization was successful.

Returns
The exit code of the runnable object
See also
Init, Stop, Exit

Implements FRunnable.

◆ SendMessageToProcessIf()

void FInteractiveProcess::SendMessageToProcessIf ( )
protected

Takes the first message to be sent from MessagesToProcess, if there is one, and sends it to process

◆ SendWhenReady() [1/2]

void FInteractiveProcess::SendWhenReady ( const FString &  Message)

Sends the string message when process is ready

Parameters
Messageto be sent

◆ SendWhenReady() [2/2]

void FInteractiveProcess::SendWhenReady ( const TArray< uint8 > &  Data)

Sends the data message when process is ready

Parameters
Datato be sent

◆ Stop()

virtual void FInteractiveProcess::Stop ( void  )
inlineoverridevirtual

Stops the runnable object.

This is called if a thread is requested to terminate early.

See also
Init, Run, Exit

Reimplemented from FRunnable.


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