|
Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
|
Portals 0.2.0 preserves the small streaming API used by the original dxFeed MarketDepthModelSample. It is a migration boundary, separate from the recommended managed and declarative UI.
moveTo(line, column) returns an owning VT ESC[line;columnH string. VT coordinates are normally one-based, unlike the retained core's CellPoint. A zero argument is emitted unchanged, as in the old API; VT terminals treat it as one. There is no addition, clamping, or overflow caused by coordinate conversion.
hideCursor() and showCursor() return owning strings. They do not write or flush output. In the original sample, the returned cursor strings were ignored, so these calls had no visible effect. To correct that sample, insert the strings into the output stream and flush after each complete update. Serialize entire updates and cleanup with the sample's I/O mutex.
The installed <portals.hpp> header exposes only these compatibility names:
Link the installed portals::core target and use C++23. No separate runtime, renderer, scheduler, router, or reactive system is started. The umbrella header does not restore the entire 0.1.x library, bit utilities, colors, or unrelated escape helpers. New compatibility consumers should use <portals/legacy.hpp> and portals::legacy directly.
VirtualTerminal::enable() preserves its historical bool result. On Windows, it enables processed output and VT processing on the existing stdout handle, preserving other console mode bits. Redirected/non-console output fails. It neither opens a console nor changes stdin mode, so std::cin.get() remains cooked. tryEnable() provides the same operation with a typed TerminalError. An absent stdout returns INVALID_OPTIONS with native code zero; failed Windows API calls return SYSTEM with their original error code. On non-Windows platforms both forms succeed without changing modes; this is legacy behavior, not a terminal-capability check.
The helper is stateless and does not restore console mode or cursor state. The caller owns flushing, synchronization and exception-safe cleanup; in particular, showing the cursor only on the successful exit path is insufficient. Do not interleave these stream writes with an active Application: its terminal/frame writer owns output exclusively. For an interactive application with managed cleanup and themes, migrate to the regular UI API instead.
The Windows mode semantics follow SetConsoleMode; the emitted sequences follow Console virtual terminal sequences.