CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | List of all members
CYB::API::CommandLine Class Referenceabstract

An interface for running callbacks based on command line parameters. More...

#include <CommandLine.hpp>

Inheritance diagram for CYB::API::CommandLine:
Inheritance graph
[legend]

Public Types

using Callback = std::add_pointer< bool(const API::Container::Deque< const API::String::Dynamic * > &AParameters)>::type
 Called to handle a valid command line parameters. More...
 

Public Member Functions

virtual 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 =0
 Adds a command line flag handler. More...
 

Detailed Description

An interface for running callbacks based on command line parameters.

Definition at line 5 of file CommandLine.hpp.

Member Typedef Documentation

using CYB::API::CommandLine::Callback = std::add_pointer<bool(const API::Container::Deque<const API::String::Dynamic*>& AParameters)>::type

Called to handle a valid command line parameters.

Todo:
replace this with CYB::Function
AParameters
The expected parameters followed by any optional parameters
Return Value
true to continue execution, false to exit the process
Thread Safety
This will be called on the same thread it was added during the call that adds it
Exception Safety
Exceptions will be propagated to the function that added the handler

Definition at line 19 of file CommandLine.hpp.

Member Function Documentation

virtual void CYB::API::CommandLine::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
pure virtual

Adds a command line flag handler.

Todo:
Fix this definition once translation keys are added
Parameters
ACallbackA callback to run for each valid invocation of this flag
AFullNameKeyThe translation key of the functional name of the command
ADescriptionKeyThe translation key of a descriptive text for this command
AShortFlagThe short, case-sensitive flag to activate this command
ALongFlagThe long, case-sensitive flag to activate this command
ANumExpectedTokensThe number of expected required tokens
ANumOptionalTokensThe number of possible optional tokens after expected tokens
AMaxInvocationsThe number of times this command can be validly repeated
Thread Safety
This function requires no thread safety
Exceptions
CYB::Exception::SystemDataError code: CYB::Exception::SystemData::HEAP_ALLOCATION_FAILURE. Thrown if the current heap runs out of memory
Attention
Throws dependant on called Callback

Implemented in CYB::Engine::Helpers::CommandLine.


The documentation for this class was generated from the following file: