Operating System Simulator Plugin  3.5.1
Unreal Engine plugin that simulates an Operating System Environment
Loading...
Searching...
No Matches
UOperatingSystemTerminalHistory Class Reference

#include "OperatingSystemTerminalHistory.h"

Inheritance diagram for UOperatingSystemTerminalHistory:
[legend]
Collaboration diagram for UOperatingSystemTerminalHistory:
[legend]

Public Member Functions

 UOperatingSystemTerminalHistory ()
 
void AddToHistory (const FString &NewCommand)
 Adds a new command to the command history. The command is specified as a FString parameter named NewCommand. The index of the command history is reset to INDEX_NONE, indicating that there is no current command selected.
 
void ClearHistory ()
 Clears the command history by resetting the command history index to INDEX_NONE and emptying the command history array.
 
bool GetNextCommand (FString &OutCommand)
 Retrieves the next command from the command history by incrementing the command history index and retrieving the command at the new index. If the command history is empty or the index exceeds the command history size, the method returns false and does not modify the OutCommand parameter. Otherwise, it returns true and assigns the retrieved command to the OutCommand parameter.
 
bool GetPreviousCommand (FString &OutCommand)
 Retrieves the command that was entered before the current command in the command history. It decrements the CommandHistoryIndex to move to the previous command. If the CommandHistoryIndex becomes invalid (i.e., less than zero or greater than or equal to the size of the command history array), it is set to zero, which represents the first command in the history.
 
- Public Member Functions inherited from UOperatingSystemProgramData
 UOperatingSystemProgramData ()
 
- Public Member Functions inherited from UOperatingSystemDataObject
template<class T >
TGetParentObject () const
 
OPERATINGSYSTEMSIMULATOR_API void SetTickEnabled (const bool bEnable)
 
OPERATINGSYSTEMSIMULATOR_API bool IsTickEnabled () const
 

Protected Member Functions

virtual bool ShouldCreate () const override
 
virtual void OnCreate () override
 
- Protected Member Functions inherited from UOperatingSystemDataObject
virtual OPERATINGSYSTEMSIMULATOR_API void Tick (const float &DeltaSeconds)
 The Tick method receives the time elapsed since the last frame update and performs any necessary updates or computations.
 
virtual OPERATINGSYSTEMSIMULATOR_API void OnValidate (FGenericError &OutError)
 This method is called to validate the data object.
 
void K2_OnCreate ()
 K2_OnCreate.
 
void K2_Tick (const float &DeltaSeconds)
 K2_Tick method is an event meant to be overridden in Blueprint subclasses of OperatingSystemDataObject. It allows subclasses to define custom behavior that should be executed every tick.
 
bool K2_ShouldCreate () const
 Indicates whether the operating system data object should be created.
 

Additional Inherited Members

- Static Public Member Functions inherited from UOperatingSystemDataObject
static OPERATINGSYSTEMSIMULATOR_API UOperatingSystemDataObjectCreateDataObj (UObject *OwningObject, const TSoftClassPtr< UOperatingSystemDataObject > &DataClassPtr)
 
template<class T >
static OPERATINGSYSTEMSIMULATOR_API T * CreateDataObj (UObject *OwningObject, TSoftClassPtr< UOperatingSystemDataObject > DataClassPtr)
 This method creates a new instance of a data object of type T.
 
- Protected Attributes inherited from UOperatingSystemProgramData
TWeakObjectPtr< UOperatingSystemBaseProgramParentProgram
 
- Protected Attributes inherited from UOperatingSystemDataObject
TWeakObjectPtr< UObject > ParentObject
 
uint8 bStartWithTickEnabled: 1
 

Detailed Description

This class represents the history of commands entered in an operating system terminal. It stores the command history and provides methods to add to the history, clear the history, and retrieve previous and next commands.

Constructor & Destructor Documentation

◆ UOperatingSystemTerminalHistory()

UOperatingSystemTerminalHistory::UOperatingSystemTerminalHistory ( )

Member Function Documentation

◆ AddToHistory()

void UOperatingSystemTerminalHistory::AddToHistory ( const FString & NewCommand)

Adds a new command to the command history. The command is specified as a FString parameter named NewCommand. The index of the command history is reset to INDEX_NONE, indicating that there is no current command selected.

Parameters
NewCommandThe new command to be added to the history.
See also
CommandHistoryIndex
CommandHistory
Here is the call graph for this function:

◆ ClearHistory()

void UOperatingSystemTerminalHistory::ClearHistory ( )

Clears the command history by resetting the command history index to INDEX_NONE and emptying the command history array.

See also
CommandHistoryIndex
CommandHistory
Here is the call graph for this function:

◆ GetNextCommand()

bool UOperatingSystemTerminalHistory::GetNextCommand ( FString & OutCommand)

Retrieves the next command from the command history by incrementing the command history index and retrieving the command at the new index. If the command history is empty or the index exceeds the command history size, the method returns false and does not modify the OutCommand parameter. Otherwise, it returns true and assigns the retrieved command to the OutCommand parameter.

Parameters
OutCommandThe variable where the next command will be stored if it exists.
Returns
True if the next command was retrieved successfully, false otherwise.
See also
CommandHistory
CommandHistoryIndex
Here is the call graph for this function:

◆ GetPreviousCommand()

bool UOperatingSystemTerminalHistory::GetPreviousCommand ( FString & OutCommand)

Retrieves the command that was entered before the current command in the command history. It decrements the CommandHistoryIndex to move to the previous command. If the CommandHistoryIndex becomes invalid (i.e., less than zero or greater than or equal to the size of the command history array), it is set to zero, which represents the first command in the history.

If the command history is empty, the method returns false, indicating that there is no previous command. Otherwise, it returns true and assigns the retrieved command to the OutCommand parameter.

Parameters
OutCommandThe variable where the previous command will be stored if it exists.
Returns
True if the previous command was retrieved successfully, false otherwise.
See also
CommandHistory
CommandHistoryIndex
Here is the call graph for this function:

◆ OnCreate()

void UOperatingSystemTerminalHistory::OnCreate ( )
overrideprotectedvirtual

Determines whether the operating system terminal history should be created.

The OnCreate method is invoked when the UOperatingSystemTerminalHistory instance is created. It is responsible for initializing the command history, setting the parent terminal, and performing any other necessary setup.

Note
This method is called automatically and should not be called directly by the user.

Reimplemented from UOperatingSystemProgramData.

Here is the call graph for this function:

◆ ShouldCreate()

bool UOperatingSystemTerminalHistory::ShouldCreate ( ) const
overrideprotectedvirtual

Determines whether the operating system terminal history should be created.

Returns
Whether the operating system terminal history should be created.

Reimplemented from UOperatingSystemDataObject.


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