VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
terminal_stream.h File Reference

Buffered, thread-safe stdout stream with TTY detection and ANSI support. More...

#include <atomic>
#include <cstdio>
#include <cstring>
#include <limits>
#include <mutex>
#include <string>
#include <string_view>
#include <type_traits>
#include <vector>
#include <termios.h>
#include <unistd.h>
Include dependency graph for terminal_stream.h:

Go to the source code of this file.

Classes

 Singleton buffered stdout writer with thread-safety and TTY detection. More...

Namespaces

Macros

#define VLINK_TERM_STDOUT_FILENO   STDOUT_FILENO
#define VLINK_TERM_WRITE   ::write
#define VLINK_TERM_ISATTY   ::isatty
#define VLINK_TERM_OUT   vlink::TerminalStream::get()

Detailed Description

Buffered, thread-safe stdout stream with TTY detection and ANSI support.

Provides TerminalStream, a singleton stream with a 1-MiB internal buffer that writes to stdout via direct POSIX write() / Win32 _write() calls, avoiding std::cout and stdio overhead.

The global convenience macro VLINK_TERM_OUT expands to vlink::TerminalStream::get().

Macro Definition Documentation

◆ VLINK_TERM_ISATTY

#define VLINK_TERM_ISATTY   ::isatty

◆ VLINK_TERM_OUT

#define VLINK_TERM_OUT   vlink::TerminalStream::get()

◆ VLINK_TERM_STDOUT_FILENO

#define VLINK_TERM_STDOUT_FILENO   STDOUT_FILENO

◆ VLINK_TERM_WRITE

#define VLINK_TERM_WRITE   ::write