CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CYBCommandLine.hpp
Go to the documentation of this file.
1 #pragma once
3 
4 namespace CYB {
5  namespace Engine {
6  namespace Helpers {
8  class CommandLine : public API::CommandLine {
9  ENABLE_TEST_HOOKS
10  private:
12  enum class TokenType : unsigned char {
13  NORMAL,
15  EXTENDED_KEY,
16  };
18  struct Token {
21  };
22  private:
24  private:
35  static API::Container::Vector<Token> ParseTokens(const unsigned int ANumArguments, const oschar_t* const* const AArguments);
36  public:
46  CommandLine(const unsigned int ANumArguments, const oschar_t* const* const AArguments);
47 
48  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 final override;
49  };
50  };
51  };
52 };
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.
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.
Definition: CommandLine.hpp:19
std::vector< AType, Interop::STLAllocator< AType >> Vector
std::vector algorithms using the CyberEngine's allocator
Definition: Containers.hpp:12
CommandLine(const unsigned int ANumArguments, const oschar_t *const *const AArguments)
Parse the command line into tokens.
Used for string of allocated variable length.
An interface for running callbacks based on command line parameters.
Definition: CommandLine.hpp:5
A basic char contained string.
Definition: CStyleString.hpp:7
static API::Container::Vector< Token > ParseTokens(const unsigned int ANumArguments, const oschar_t *const *const AArguments)
Parse the command line into tokens.
A parsed command line token.
API::String::Dynamic FEntry
The string.
API::Container::Vector< Token > FTokens
The ordered array of tokens.
TokenType FType
The type of prefix the string is if any.
Command line string parser and manager.