Navigation
API > API/Runtime > API/Runtime/Engine
Utility for setting and restoring of a Console Variable (CVar).
Note that race conditions are possible when multiple [FTestConsoleVariable](API\Runtime\Engine\FTestConsoleVariable)_ objects refer to the same Console Variable and get restored/destroyed in an order different than they were set. Please use FScopedTestEnvironment to manage multiple `FTestConsoleVariable objects.
| Name | FTestConsoleVariable |
| Type | struct |
| Header File | /Engine/Source/Runtime/Engine/Public/Tests/AutomationCommon.h |
| Include Path | #include "Tests/AutomationCommon.h" |
Syntax
struct FTestConsoleVariable
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTestConsoleVariable
(
const FString& InConsoleVariableName |
Tests/AutomationCommon.h | ||
FTestConsoleVariable
(
FTestConsoleVariable&& Other |
Tests/AutomationCommon.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FTestConsoleVariable() |
Tests/AutomationCommon.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bModified | bool | Tests/AutomationCommon.h | ||
| ConsoleVariableName | FString | Tests/AutomationCommon.h | ||
| OriginalValue | FString | Tests/AutomationCommon.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FString Get() |
Returns the current value of the Console Variable | Tests/AutomationCommon.h | |
void Restore() |
Returns the Console Variable to the original value | Tests/AutomationCommon.h | |
| Sets a Console Variable to the specified value. | Tests/AutomationCommon.h |