You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
This mainly covers the new Pixel Streaming plugin version along with minor changes to other parts of the engine: * removed multiple copies of FThread as it's now a part of Core * changes to SlateUser required to fix user input in Pixel Streaming This wasn't formally reviewed due to the size of Pixel Streaming changes, but was skimmed over by Zack Letters before integration #rb zack.letters [CL 9486237 by Andriy Tylychko in Main branch]
75 lines
1.7 KiB
C++
75 lines
1.7 KiB
C++
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "SessionMonitorCommon.h"
|
|
|
|
|
|
/**
|
|
* Utility class to parse command line parameters.
|
|
*
|
|
* Arguments need to be prefixed with '-' and can have the following formats:
|
|
* -SomeArg
|
|
* -SomeOtherArg=Value
|
|
*/
|
|
class FCmdLine
|
|
{
|
|
public:
|
|
struct FParam
|
|
{
|
|
template <class T1, class T2>
|
|
FParam(T1&& Name, T2&& Value)
|
|
: Name(std::forward<T1>(Name))
|
|
, Value(std::forward<T2>(Value))
|
|
{
|
|
}
|
|
std::string Name;
|
|
std::string Value;
|
|
};
|
|
|
|
FCmdLine()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Parse all the supplied parameters, as received in "main"
|
|
*/
|
|
bool Parse(int Argc, char* Argv[], bool CaseSensitive=false);
|
|
|
|
/**
|
|
* Checks if the specified parameter is present, in any acceptable form, such
|
|
* ash "-arg" or "-arg=value"
|
|
*/
|
|
bool Has(const char* Name) const;
|
|
|
|
/**
|
|
* Gets the value of the specified parameter.
|
|
* @return Value of the parameter or an empty string if the parameter doesn't
|
|
* exist or doesn't is not in the "-arg=value" form
|
|
* Use "Has" method first, to check if a parameter exists.
|
|
*/
|
|
const std::string& Get(const char* Name) const;
|
|
|
|
/**
|
|
* Gets the value of the specified parameter, as an integer
|
|
*
|
|
* @param Name Parameter name
|
|
* @param DefaultValue If the parameter doesn't exist or is not in the "-arg=value" form, it will default to this
|
|
* @return
|
|
* Pair where "first" is true if the parameter exists, false if not. "second" is the parameter's value or DefaultValue
|
|
*/
|
|
std::pair<bool, int> GetAsInt(const char* Name, int DefaultValue = 0) const;
|
|
|
|
/**
|
|
* @return The number of parameters
|
|
*/
|
|
int GetCount() const;
|
|
|
|
private:
|
|
bool Equals(const std::string& A, const char* B) const;
|
|
|
|
std::vector<FParam> Params;
|
|
static std::string Empty;
|
|
bool CaseSensitive = true;
|
|
};
|