Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Bond::Utf8ConsoleOutput Class Reference

Makes a Windows console display UTF-8 output for the lifetime of this object. More...

#include <bond/tools/commandline.h>

Public Member Functions

 Utf8ConsoleOutput ()
 Switches the console's output code page to UTF-8.
 ~Utf8ConsoleOutput ()
 Flushes stdout and stderr and restores the console's original output code page.
 Utf8ConsoleOutput (const Utf8ConsoleOutput &other)=delete
Utf8ConsoleOutput & operator= (const Utf8ConsoleOutput &other)=delete

Detailed Description

Makes a Windows console display UTF-8 output for the lifetime of this object.

The constructor switches the console's output code page to UTF-8. The destructor flushes stdout and stderr, then restores the original code page, since the code page belongs to the console and would otherwise persist after the program exits. Console input is not affected. On other platforms, this class does nothing.

This is intended for applications that own their console, such as the Bond tools. A library embedding Bond should leave the console configuration to its host application.

Constructor & Destructor Documentation

◆ Utf8ConsoleOutput() [1/2]

Bond::Utf8ConsoleOutput::Utf8ConsoleOutput ( )

Switches the console's output code page to UTF-8.

◆ ~Utf8ConsoleOutput()

Bond::Utf8ConsoleOutput::~Utf8ConsoleOutput ( )

Flushes stdout and stderr and restores the console's original output code page.

◆ Utf8ConsoleOutput() [2/2]

Bond::Utf8ConsoleOutput::Utf8ConsoleOutput ( const Utf8ConsoleOutput & other)
delete

Member Function Documentation

◆ operator=()

Utf8ConsoleOutput & Bond::Utf8ConsoleOutput::operator= ( const Utf8ConsoleOutput & other)
delete

The documentation for this class was generated from the following file:
  • include/bond/tools/commandline.h