Skip to content

Struct FScriptArgBuilder

Struct FScriptArgBuilder

  • Defined in File ArgBuilder.h
struct FScriptArgBuilder

Source: Source/Schola/Training/Public/TrainingUtils/ArgBuilder.h A class to build arguments and flags for a CLI script.


Public Functions

SymbolDetails
AddStringArgAdd a string argument to the command line.
AddFloatArgAdd a float argument to the command line.
AddIntArgAdd an integer argument to the command line.
AddFlagAdd a flag to the command line.
AddConditionalStringArgAdd a string argument to the command line if a condition is met.
AddIntArrayArgAdd an integer array argument to the command line.
AddPositionalArgumentAdd a positional argument (i.e.
BuildConstruct the command line string from the added arguments.

AddStringArg

FScriptArgBuilder &AddStringArg(FString ArgName, FString ArgValue)

Add a string argument to the command line.

Parameters

  • ArgName – [in] The name of the argument

  • ArgValue – [in] The value of the argument

#DirectionNameTypeDescription
1ArgNameFStringThe name of the argument
2ArgValueFStringThe value of the argument

Source: Source/Schola/Training/Public/TrainingUtils/ArgBuilder.h

Implementation: Source/Schola/Training/Private/TrainingUtils/ArgBuilder.cpp

AddFloatArg

FScriptArgBuilder &AddFloatArg(FString ArgName, float ArgValue)

Add a float argument to the command line.

Parameters

  • ArgName – [in] The name of the argument

  • ArgValue – [in] The value of the argument. Will be converted to a string

#DirectionNameTypeDescription
1ArgNameFStringThe name of the argument
2ArgValuefloatThe value of the argument. Will be converted to a string

Source: Source/Schola/Training/Public/TrainingUtils/ArgBuilder.h

Implementation: Source/Schola/Training/Private/TrainingUtils/ArgBuilder.cpp

AddIntArg

FScriptArgBuilder &AddIntArg(FString ArgName, int ArgValue)

Add an integer argument to the command line.

Parameters

  • ArgName – [in] The name of the argument

  • ArgValue – [in] The value of the argument. Will be converted to a string

#DirectionNameTypeDescription
1ArgNameFStringThe name of the argument
2ArgValueintThe value of the argument. Will be converted to a string

Source: Source/Schola/Training/Public/TrainingUtils/ArgBuilder.h

Implementation: Source/Schola/Training/Private/TrainingUtils/ArgBuilder.cpp

AddFlag

FScriptArgBuilder &AddFlag(FString FlagName, bool bCondition = true)

Add a flag to the command line.

Parameters

  • FlagName – [in] The name of the flag

  • bCondition – [in] Whether the flag should be added. Useful programmatically setting conditional flags.

#DirectionNameTypeDescription
1FlagNameFStringThe name of the flag
2bConditionboolWhether the flag should be added. Useful programmatically setting conditional flags. (default: true)

Source: Source/Schola/Training/Public/TrainingUtils/ArgBuilder.h

Implementation: Source/Schola/Training/Private/TrainingUtils/ArgBuilder.cpp

AddConditionalStringArg

FScriptArgBuilder &AddConditionalStringArg(FString ArgName, FString ArgValue,
bool bCondition)

Add a string argument to the command line if a condition is met.

Parameters

  • ArgName – [in] The name of the argument

  • ArgValue – [in] The value of the argument

  • bCondition – [in] Whether the argument should be added. Useful programmatically setting conditional arguments.

#DirectionNameTypeDescription
1ArgNameFStringThe name of the argument
2ArgValueFStringThe value of the argument
3bConditionboolWhether the argument should be added. Useful programmatically setting conditional arguments.

Source: Source/Schola/Training/Public/TrainingUtils/ArgBuilder.h

Implementation: Source/Schola/Training/Private/TrainingUtils/ArgBuilder.cpp

AddIntArrayArg

FScriptArgBuilder &AddIntArrayArg(FString ArgName, const TArray<int> &ArgValue)

Add an integer array argument to the command line.

Parameters

  • ArgName – [in] The name of the argument

  • ArgValue – [in] The value of the argument

#DirectionNameTypeDescription
1ArgNameFStringThe name of the argument
2ArgValueconst TArray< int > &The value of the argument

Source: Source/Schola/Training/Public/TrainingUtils/ArgBuilder.h

Implementation: Source/Schola/Training/Private/TrainingUtils/ArgBuilder.cpp

AddPositionalArgument

FScriptArgBuilder &AddPositionalArgument(FString Arg)

Add a positional argument (i.e.

does not append - infront of the name)

Parameters

Arg – [in] The argument to add

#DirectionNameTypeDescription
1ArgFStringThe argument to add

Source: Source/Schola/Training/Public/TrainingUtils/ArgBuilder.h

Implementation: Source/Schola/Training/Private/TrainingUtils/ArgBuilder.cpp

Build

FString Build()

Construct the command line string from the added arguments.

Returns:

The command line string

Source: Source/Schola/Training/Public/TrainingUtils/ArgBuilder.h

Implementation: Source/Schola/Training/Private/TrainingUtils/ArgBuilder.cpp


Public Members

SymbolDetails
ArgsThe arguments to be passed to the commnand line script.

Args

TArray<FString> Args

The arguments to be passed to the commnand line script.