3#include <Foundation/Basics.h>
4#include <Foundation/Math/Math.h>
5#include <Foundation/Utilities/CommandLineUtils.h>
6#include <Foundation/Utilities/EnumerableClass.h>
109 virtual void GetParamShortDesc(
plStringBuilder& ref_sOut)
const override;
111 virtual void GetParamDefaultValueDesc(
plStringBuilder& ref_sOut)
const override;
122 bool ShouldLog(LogMode mode,
bool bWasSpecified)
const;
129 bool m_bCaseSensitive =
false;
130 mutable bool m_bLoggedOnce =
false;
149 m_bDefaultValue = value;
159 bool m_bDefaultValue =
false;
175 virtual void GetParamDefaultValueDesc(
plStringBuilder& ref_sOut)
const override;
177 virtual void GetParamShortDesc(
plStringBuilder& ref_sOut)
const override;
185 m_iDefaultValue = value;
201 plInt32 m_iDefaultValue = 0;
202 plInt32 m_iMinValue = 0;
203 plInt32 m_iMaxValue = 0;
219 virtual void GetParamDefaultValueDesc(
plStringBuilder& ref_sOut)
const override;
221 virtual void GetParamShortDesc(
plStringBuilder& ref_sOut)
const override;
229 m_fDefaultValue = value;
245 float m_fDefaultValue = 0;
246 float m_fMinValue = 0;
247 float m_fMaxValue = 0;
266 m_sDefaultValue = sValue;
295 m_sDefaultValue = sValue;
329 virtual void GetParamShortDesc(
plStringBuilder& ref_sOut)
const override;
331 virtual void GetParamDefaultValueDesc(
plStringBuilder& ref_sOut)
const override;
336 plInt32 m_iValue = 0;
345 m_iDefaultValue = value;
355 plInt32 m_iDefaultValue = 0;
This command line option exposes simple on/off switches.
Definition CommandLineOptions.h:139
bool GetDefaultValue() const
Returns the default value.
Definition CommandLineOptions.h:153
void SetDefaultValue(bool value)
Modifies the default value.
Definition CommandLineOptions.h:147
virtual plStringView GetType() override
Returns "Bool".
Definition CommandLineOptions.h:156
plCommandLineOptionDoc can be used to document a command line option whose logic might be more comple...
Definition CommandLineOptions.h:103
virtual plStringView GetType() override
Returns "Doc".
Definition CommandLineOptions.h:116
An 'enum' option is a string option that only allows certain phrases ('keys').
Definition CommandLineOptions.h:322
plInt32 GetDefaultValue() const
Returns the default value.
Definition CommandLineOptions.h:349
void SetDefaultValue(plInt32 value)
Modifies the default value.
Definition CommandLineOptions.h:343
virtual plStringView GetType() override
Returns "Enum".
Definition CommandLineOptions.h:352
This command line option exposes float values, optionally with a min/max range.
Definition CommandLineOptions.h:215
void SetDefaultValue(float value)
Modifies the default value.
Definition CommandLineOptions.h:227
virtual plStringView GetType() override
Returns "Float".
Definition CommandLineOptions.h:233
float GetDefaultValue() const
Returns the default value.
Definition CommandLineOptions.h:242
float GetMinValue() const
Returns the minimum value.
Definition CommandLineOptions.h:236
float GetMaxValue() const
Returns the maximum value.
Definition CommandLineOptions.h:239
plCommandLineOption (and derived types) are used to define options that the application supports.
Definition CommandLineOptions.h:21
virtual void GetLongDesc(plStringBuilder &ref_sOut) const =0
Returns a proper description of the option.
virtual void GetParamDefaultValueDesc(plStringBuilder &ref_sOut) const =0
Returns a very short string for the options default value. For example "0" or "auto".
virtual void GetParamShortDesc(plStringBuilder &ref_sOut) const =0
Returns a very short description of the option (type). For example "<int>" or "<enum>".
LogAvailableModes
Definition CommandLineOptions.h:26
virtual plStringView GetType()=0
Returns a string indicating the exact implementation type.
plCommandLineOption(plStringView sSortingGroup)
Definition CommandLineOptions.h:63
virtual void GetOptions(plStringBuilder &ref_sOut) const =0
Writes all the supported options (e.g. '-arg') to 'out'. If more than one option is allowed,...
LogMode
Describes whether the value of an option (and whether something went wrong), should be printed to plL...
Definition CommandLineOptions.h:33
This command line option exposes integer values, optionally with a min/max range.
Definition CommandLineOptions.h:171
plInt32 GetMaxValue() const
Returns the maximum value.
Definition CommandLineOptions.h:195
plInt32 GetDefaultValue() const
Returns the default value.
Definition CommandLineOptions.h:198
void SetDefaultValue(plInt32 value)
Modifies the default value.
Definition CommandLineOptions.h:183
virtual plStringView GetType() override
Returns "Int".
Definition CommandLineOptions.h:189
plInt32 GetMinValue() const
Returns the minimum value.
Definition CommandLineOptions.h:192
This command line option exposes absolute paths. If the user provides a relative path,...
Definition CommandLineOptions.h:285
void SetDefaultValue(plStringView sValue)
Modifies the default value.
Definition CommandLineOptions.h:293
plStringView GetDefaultValue() const
Returns the default value.
Definition CommandLineOptions.h:299
virtual plStringView GetType() override
Returns "Path".
Definition CommandLineOptions.h:302
This command line option exposes simple string values.
Definition CommandLineOptions.h:256
virtual plStringView GetType() override
Returns "String".
Definition CommandLineOptions.h:273
void SetDefaultValue(plStringView sValue)
Modifies the default value.
Definition CommandLineOptions.h:264
plStringView GetDefaultValue() const
Returns the default value.
Definition CommandLineOptions.h:270
This is a helper class to parse command lines.
Definition CommandLineUtils.h:13
static plCommandLineUtils * GetGlobalInstance()
Returns one global instance of plCommandLineUtils.
Definition CommandLineUtils.cpp:14
Definition DynamicArray.h:81
Base class to add the ability to another class to enumerate all active instance of it,...
Definition EnumerableClass.h:28
Base class for all logging classes.
Definition Log.h:77
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
constexpr TYPE MaxValue()
Returns the largest possible positive value (that is not infinity).
constexpr TYPE MinValue()
Returns the smallest possible value (that is not -infinity). Usually zero or -MaxValue()....
Definition CommandLineOptions.h:334
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54