5 FTokens(ParseTokens(ANumArguments, AArguments))
10 Result.reserve(ANumArguments);
13 for (
auto I(0U); I < ANumArguments; ++I) {
15 #ifdef TARGET_OS_WINDOWS
23 if (AsUTF.
CString()[0] ==
'-') {
25 TT = TokenType::EXTENDED_KEY;
29 TT = TokenType::SINGLE_LETTER_KEY;
33 else if (AsUTF.
CString()[0] ==
'/') {
34 TT = TokenType::SINGLE_LETTER_KEY;
38 TT = TokenType::NORMAL;
39 Result.emplace_back(
Token{ std::move(AsUTF), TT });
49 for (
auto I(FTokens.begin()); AMaxInvocations > 0 && I != FTokens.end(); ++I) {
50 if ((I->FType == TokenType::SINGLE_LETTER_KEY && I->FEntry == AShortFlag)
51 || (I->FType == TokenType::EXTENDED_KEY && I->FEntry == ALongFlag)) {
52 auto Remaining(ANumExpectedTokens);
55 for (; Remaining > 0 && J != FTokens.end() && J->FType == TokenType::NORMAL; ++J, --Remaining)
56 Work.emplace_back(&(J->FEntry));
59 Remaining = ANumOptionalTokens;
60 for (; Remaining > 0 && J != FTokens.end() && J->FType == TokenType::NORMAL; ++J, --Remaining)
61 Work.emplace_back(&(J->FEntry));
71 static_cast<void>(AFullNameKey);
72 static_cast<void>(ADescriptionKey);
void RunHandler(Callback ACallback, const int AFullNameKey, const int ADescriptionKey, const API::String::CStyle &AShortFlag, const API::String::CStyle &ALongFlag, const unsigned int ANumExpectedTokens, const unsigned int ANumOptionalTokens, unsigned long long AMaxInvocations) const finaloverride
Adds a command line flag handler.
API::Interop::Context & Context(void) noexcept
Get the API's Context.
TokenType
Recognized token variations.
std::add_pointer< bool(const API::Container::Deque< const API::String::Dynamic * > &AParameters)>::type Callback
Called to handle a valid command line parameters.
std::vector< AType, Interop::STLAllocator< AType >> Vector
std::vector algorithms using the CyberEngine's allocator
virtual void Log(const String::CStyle &AMessage, const Level ALevel)=0
Log a message. Will be written to a text file on the Path returned by CurrentLog. ...
int RawLength(void) const noexcept
Get the byte length of the contained CString.
CommandLine(const unsigned int ANumArguments, const oschar_t *const *const AArguments)
Parse the command line into tokens.
Dynamic SubString(const int AIndex, const int ALength) const
Get a substring of the contained string.
Used for string of allocated variable length.
static UTF8 ToUTF8(const wchar_t *AWString)
Create a new UTF8 string given a wide char array.
std::deque< AType, Interop::STLAllocator< AType >> Deque
std::deque algorithms using the CyberEngine's allocator
A basic char contained string.
Precompiled header for inter-engine operations.
static API::Container::Vector< Token > ParseTokens(const unsigned int ANumArguments, const oschar_t *const *const AArguments)
Parse the command line into tokens.
const char * CString(void) const noexcept
Get the contained const CString.
Logger & FLogger
The Logger.
A parsed command line token.