class

FCommandLine

Module
Core
Header
#include "Core/FCommandLine.h"
Namespace
Mowo

Public functions

ReturnsNameDescription
voidSetSubsequent calls overwrite.
const std::string&GetProgramNameEmpty before Set() runs.
const std::string&GetFullCommandLine
boolHasSwitchTrue when --name (or -n for single-char) appears anywhere in argv.
std::stringGetValueLast value wins if --name appears multiple times.
intGetIntValue
floatGetFloatValue
const std::vector<std::string>&GetAll
std::vector<std::string>RestrictToPlayerArgumentsDrops every argument a shipped game has no business honouring and logs what it dropped.
const std::vector<FPlayerArgument>&PlayerArgumentTable
const std::vector<std::string>&PlayerArgumentAllowlistThe names alone, for the filter and for a host that wants to print them.
boolIsRestrictedTrue once RestrictToPlayerArguments has run, for a host that wants to state the policy in its log.

Function details

Set

C++
static void Set(int argc, const char* const* argv)

Subsequent calls overwrite. Argv[0] is captured as GetProgramName() but skipped from switch / value parsing.

GetProgramName

C++
static const std::string& GetProgramName()

Empty before Set() runs.

GetFullCommandLine

C++
static const std::string& GetFullCommandLine()

HasSwitch

C++
static bool HasSwitch(std::string_view name)

True when --name (or -n for single-char) appears anywhere in argv.

GetValue

C++
static std::string GetValue(std::string_view name, std::string_view defaultValue = "")

Last value wins if --name appears multiple times. Returns defaultValue if missing or value-less.

GetIntValue

C++
static int GetIntValue(std::string_view name, int defaultValue = 0)

GetFloatValue

C++
static float GetFloatValue(std::string_view name, float defaultValue = 0.0f)

GetAll

C++
static const std::vector<std::string>& GetAll()

RestrictToPlayerArguments

C++
static std::vector<std::string> RestrictToPlayerArguments(const std::vector<std::string>& allowExtra = {})

Drops every argument a shipped game has no business honouring and logs what it dropped. Called once by the game host right after Set(); the editor, the tests and the server never call it. A packaged game's command line is user-editable — a shortcut, a Steam launch option, a batch file someone found online — and everything in the engine reads from here: --cvar= reaches every console variable, --scene loads any file on disk, the self-test and profiling switches start machinery a player should never be inside. Keeping the parse and filtering the RESULT (rather than teaching each reader to re-check) is what makes the guarantee hold for code that has not been written yet. What survives is the player-facing set: the graphics backend shorthands, window/display, audio, language, the multiplayer join arguments and the save slot. allowExtra lets a game module widen it with its own switches (no leading dashes, no values). Returns what it dropped, in argv order, for the caller to log — Core sits below Logging.

PlayerArgumentTable

C++
static const std::vector<FPlayerArgument>& PlayerArgumentTable()

PlayerArgumentAllowlist

C++
static const std::vector<std::string>& PlayerArgumentAllowlist()

The names alone, for the filter and for a host that wants to print them.

IsRestricted

C++
static bool IsRestricted()

True once RestrictToPlayerArguments has run, for a host that wants to state the policy in its log.

Generated from Core/FCommandLine.h via core.json · Nov 5, 2026Version 1.0.0