1#ifndef APPLICATION_UTILITIES_COMMANDLINEUTILS_H
2#define APPLICATION_UTILITIES_COMMANDLINEUTILS_H
24#ifdef PLATFORM_WINDOWS
27CPP_UTILITIES_EXPORT std::pair<std::vector<std::unique_ptr<char[]>>, std::vector<char *>> convertArgsToUtf8();
28#define CMD_UTILS_START_CONSOLE ::CppUtilities::startConsole();
29#define CMD_UTILS_CONVERT_ARGS_TO_UTF8 \
30 auto utf8Args = ::CppUtilities::convertArgsToUtf8(); \
31 argv = utf8Args.second.data(); \
32 argc = static_cast<int>(utf8Args.second.size());
33#define CMD_UTILS_HANDLE_VIRTUAL_TERMINAL_PROCESSING ::CppUtilities::handleVirtualTerminalProcessing();
35#define CMD_UTILS_START_CONSOLE
36#define CMD_UTILS_CONVERT_ARGS_TO_UTF8
37#define CMD_UTILS_HANDLE_VIRTUAL_TERMINAL_PROCESSING
75 , character(character)
90 for (
unsigned char i = 0;
i < indentation.
level; ++
i) {
The Indentation class allows printing indentation conveniently, eg.
Indentation(unsigned char level=4, char character=' ')
Indentation operator+(unsigned char level)
#define CPP_UTILITIES_EXPORT
Marks the symbol to be exported by the c++utilities library.
Contains all utilities provides by the c++utilities library.
CPP_UTILITIES_EXPORT TerminalSize determineTerminalSize()
Returns the current size of the terminal.
CPP_UTILITIES_EXPORT std::ostream & operator<<(std::ostream &out, Indentation indentation)
Response
The Response enum is used to specify the default response for the confirmPrompt() method.
CPP_UTILITIES_EXPORT bool confirmPrompt(const char *message, Response defaultResponse=Response::None)
Prompts for confirmation displaying the specified message.
CPP_UTILITIES_EXPORT std::optional< bool > isEnvVariableSet(const char *variableName)
Returns whether the specified env variable is set to a non-zero and non-white-space-only value.
The TerminalSize struct describes a terminal size.
unsigned short width
width in pixel
unsigned short height
height in pixel
TerminalSize(unsigned short rows=0, unsigned short columns=0, unsigned short width=0, unsigned short height=0)
unsigned short columns
number of columns
unsigned short rows
number of rows