scenario_simulator_v2 C++ API
Namespaces | Functions | Variables
openscenario_interpreter::console Namespace Reference

Namespaces

 background
 
 foreground
 

Functions

template<typename... Ts>
auto & escape_sequence (std::basic_ostream< Ts... > &os, const std::string &code)
 

Variables

auto reset = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[0m" ); }
 
auto bold = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[1m" ); }
 
auto faint = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[2m" ); }
 
auto italic = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[3m" ); }
 
auto underline = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[4m" ); }
 
auto slow_blink = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[5m" ); }
 
auto rapid_blink = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[6m" ); }
 
auto reverse = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[7m" ); }
 
auto conceal = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[8m" ); }
 
auto black = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[30m" ); }
 
auto red = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[31m" ); }
 
auto green = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[32m" ); }
 
auto yellow = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[33m" ); }
 
auto blue = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[34m" ); }
 
auto magenta = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[35m" ); }
 
auto cyan = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[36m" ); }
 
auto white = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[37m" ); }
 
auto is_console
 

Function Documentation

◆ escape_sequence()

template<typename... Ts>
auto& openscenario_interpreter::console::escape_sequence ( std::basic_ostream< Ts... > &  os,
const std::string &  code 
)

Variable Documentation

◆ bold

auto openscenario_interpreter::console::bold = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[1m" ); }
inline

◆ conceal

auto openscenario_interpreter::console::conceal = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[8m" ); }
inline

◆ faint

auto openscenario_interpreter::console::faint = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[2m" ); }
inline

◆ is_console

auto openscenario_interpreter::console::is_console
inline
Initial value:
= [](const auto & os) {
if (os.rdbuf() == std::cout.rdbuf()) {
static const auto result{static_cast<bool>(::isatty(STDOUT_FILENO))};
return result;
} else if (os.rdbuf() == std::cerr.rdbuf()) {
static const auto result{static_cast<bool>(::isatty(STDERR_FILENO))};
return result;
} else {
return false;
}
}

◆ italic

auto openscenario_interpreter::console::italic = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[3m" ); }
inline

◆ rapid_blink

auto openscenario_interpreter::console::rapid_blink = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[6m" ); }
inline

◆ reset

auto openscenario_interpreter::console::reset = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[0m" ); }
inline

◆ reverse

auto openscenario_interpreter::console::reverse = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[7m" ); }
inline

◆ slow_blink

auto openscenario_interpreter::console::slow_blink = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[5m" ); }
inline

◆ underline

auto openscenario_interpreter::console::underline = [](std::ostream & os) -> decltype(auto) { return escape_sequence(os, "[4m" ); }
inline