10#ifdef PLATFORM_WINDOWS
42 cout <<
"Please enter [y] or [n]: ";
76#ifndef PLATFORM_WINDOWS
93#ifdef PLATFORM_WINDOWS
99 static const auto mintty = [] {
100 const char *
const msyscon = std::getenv(
"MSYSCON");
101 const char *
const termprog = std::getenv(
"TERM_PROGRAM");
140 if (
const char *
const term = std::getenv(
"TERM");
term && std::strstr(
term,
"xterm")) {
190 auto pos = std::fpos_t();
263 ios::sync_with_stdio(
true);
276 if (
const auto e =
isEnvVariableSet(
"ENABLE_HANDLING_VIRTUAL_TERMINAL_PROCESSING"); !
e.has_value() ||
e.value()) {
287 pair<vector<unique_ptr<char[]>>, vector<char *>>
res;
295 res.first.reserve(
static_cast<size_t>(
argc));
296 res.second.reserve(
static_cast<size_t>(
argc));
309 res.second.emplace_back(argv.get());
310 res.first.emplace_back(std::move(argv));
CPP_UTILITIES_EXPORT bool enabled
Controls whether the functions inside the EscapeCodes namespace actually make use of escape codes.
Contains all utilities provides by the c++utilities library.
CPP_UTILITIES_EXPORT TerminalSize determineTerminalSize()
Returns the current size of the terminal.
IntegralType stringToNumber(const StringType &string, BaseType base=10)
Converts the given string to an unsigned/signed number assuming string uses the specified base.
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.