UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Exec.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
7
8class FOutputDevice;
9class UWorld;
10
11#ifndef UE_ALLOW_EXEC_COMMANDS
12 #if UE_BUILD_SHIPPING && !WITH_EDITOR
13 #define UE_ALLOW_EXEC_COMMANDS UE_ALLOW_EXEC_COMMANDS_IN_SHIPPING
14 #else
15 #define UE_ALLOW_EXEC_COMMANDS 1
16 #endif
17#endif
18
19#ifndef UE_ALLOW_EXEC_DEV
20 #define UE_ALLOW_EXEC_DEV !UE_BUILD_SHIPPING && UE_ALLOW_EXEC_COMMANDS
21#endif
22
23#ifndef UE_ALLOW_EXEC_EDITOR
24 #define UE_ALLOW_EXEC_EDITOR WITH_EDITOR && UE_ALLOW_EXEC_COMMANDS
25#endif
26
27// Any object that is capable of taking commands.
28class FExec
29{
30public:
31 CORE_API virtual ~FExec();
32
33#if UE_ALLOW_EXEC_COMMANDS
34
44 CORE_API virtual bool Exec( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar );
45#else // UE_ALLOW_EXEC_COMMANDS
46
50 CORE_API virtual bool Exec( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar ) final;
51
55 CORE_API virtual bool Exec( UWorld* InWorld, const TCHAR* Cmd ) final;
56
57#endif // !UE_ALLOW_EXEC_COMMANDS
58
59protected:
61 virtual bool Exec_Runtime( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar ) { return false; }
62
64 virtual bool Exec_Dev( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar ) { return false; }
65
67 virtual bool Exec_Editor( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar ) { return false; }
68
69};
70
71
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition Exec.h:29
virtual bool Exec_Runtime(UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
Definition Exec.h:61
virtual CORE_API ~FExec()
Definition Exec.cpp:8
virtual bool Exec_Dev(UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
Definition Exec.h:64
virtual CORE_API bool Exec(UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
Definition Exec.cpp:30
virtual bool Exec_Editor(UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
Definition Exec.h:67
Definition OutputDevice.h:133
Definition World.h:918