slang::OS class

A collection of various OS-specific utility functions.

Contents

Public static functions

static auto fileSupportsColors(int fd) -> bool
static auto fileSupportsColors(FILE* file) -> bool
static void setColorsEnabled(bool enabled)
template<typename... Args>
static void print(string_view format, const Args&... args)
Prints formatted text to stdout, handling Unicode conversions where necessary.
template<typename... Args>
static void print(const fmt::text_style& style, string_view format, const Args&... args)
Prints colored formatted text to stdout, handling Unicode conversions where necessary.

Function documentation

static bool slang::OS::fileSupportsColors(int fd)

Returns true if the given file descriptor supports color text output.

static bool slang::OS::fileSupportsColors(FILE* file)

Returns true if the given FILE supports color text output.

static void slang::OS::setColorsEnabled(bool enabled)

Sets whether color output should be enabled for the print() functions. This is off by default.