#include <cpp-terminal/terminfo.hpp>
|  | 
| enum class | ColorMode : std::uint8_t { Unset
, NoColor
, Bit3
, Bit4
,
 Bit8
, Bit24
 }
 | 
|  | 
| enum class | Bool : std::uint8_t { UTF8 = 0
, Legacy
, ControlSequences
 } | 
|  | 
| enum class | String : std::uint8_t { TermEnv
, TermName
, TermVersion
 } | 
|  | 
| enum class | Integer : std::uint8_t | 
|  | 
| using | Booleans = std::array<bool, BoolNumber> | 
|  | 
| using | Strings = std::array<std::string, StringNumber> | 
|  | 
| using | Integers = std::array<std::uint32_t, IntegerNumber> | 
|  | 
Definition at line 19 of file terminfo.hpp.
 
◆ Booleans
◆ Integers
◆ Strings
◆ Bool
| Enumerator | 
|---|
| UTF8 | terminal has UTF-8 activated.  | 
| Legacy | Terminal is in legacy mode (Windows only).  | 
| ControlSequences | Terminal support control sequences.  | 
Definition at line 38 of file terminfo.hpp.
   39  {
   40    UTF8 = 0,          
   41    Legacy,            
   42    ControlSequences,  
   43  };
 
 
◆ ColorMode
| Enumerator | 
|---|
| Unset |  | 
| NoColor |  | 
| Bit3 |  | 
| Bit4 |  | 
| Bit8 |  | 
| Bit24 |  | 
Definition at line 24 of file terminfo.hpp.
   25  {
   26    Unset,
   27    
   28    NoColor,
   29    
   30    Bit3,
   31    
   32    Bit4,
   33    
   34    Bit8,
   35    
   36    Bit24
   37  };
 
 
◆ Integer
◆ String
| Enumerator | 
|---|
| TermEnv | TERM environment variable value.  | 
| TermName | Name of the terminal program if available.  | 
| TermVersion | Terminal version.  | 
Definition at line 44 of file terminfo.hpp.
   45  {
   46    TermEnv,      
   47    TermName,     
   48    TermVersion,  
   49  };
 
 
◆ Terminfo()
      
        
          | Term::Terminfo::Terminfo | ( |  | ) |  | 
      
 
 
◆ check()
  
  | 
        
          | void Term::Terminfo::check | ( |  | ) |  |  | staticprivate | 
 
Definition at line 120 of file terminfo.cpp.
  121{
  122  static bool checked{false};
  123  if(!checked)
  124  {
  132    checked = true;
  133  }
  134}
static void checkTerminalName()
static void checkControlSequences()
static void checkLegacy()
static void checkColorMode()
static void checkTermEnv()
static void checkTerminalVersion()
 
 
◆ checkColorMode()
  
  | 
        
          | void Term::Terminfo::checkColorMode | ( |  | ) |  |  | staticprivate | 
 
Definition at line 144 of file terminfo.cpp.
  145{
  153#if defined(_WIN32)
  156#endif
  160}
@ Legacy
Terminal is in legacy mode (Windows only).
static ColorMode m_colorMode
@ TermName
Name of the terminal program if available.
@ TermEnv
TERM environment variable value.
static Booleans m_booleans
std::pair< bool, std::string > getenv(const std::string &env)
Value of an environment variables.
bool WindowsVersionGreater(const DWORD &major, const DWORD &minor, const DWORD &patch)
 
 
◆ checkControlSequences()
  
  | 
        
          | void Term::Terminfo::checkControlSequences | ( |  | ) |  |  | staticprivate | 
 
Definition at line 162 of file terminfo.cpp.
  163{
  164#ifdef _WIN32
  167#else
  169#endif
  170}
@ ControlSequences
Terminal support control sequences.
static void set(const Term::Terminfo::Bool &key, const bool &value)
 
 
◆ checkLegacy()
  
  | 
        
          | void Term::Terminfo::checkLegacy | ( |  | ) |  |  | staticprivate | 
 
Definition at line 84 of file terminfo.cpp.
   85{
   86#if defined(_WIN32)
   87  #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
   88    #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
   89  #endif
   91  else
   92  {
   93    DWORD dwOriginalOutMode{0};
   94    GetConsoleMode(
Private::out.handle(), &dwOriginalOutMode);
 
   96    else
   97    {
   98      SetConsoleMode(
Private::out.handle(), dwOriginalOutMode);
 
  100    }
  101  }
  102#else
  104#endif
  105}
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING
 
 
◆ checkTermEnv()
  
  | 
        
          | void Term::Terminfo::checkTermEnv | ( |  | ) |  |  | staticprivate | 
 
 
◆ checkTerminalName()
  
  | 
        
          | void Term::Terminfo::checkTerminalName | ( |  | ) |  |  | staticprivate | 
 
Definition at line 109 of file terminfo.cpp.
  110{
  111  std::string name;
  113  if(name.empty()) { name = 
Private::getenv(
"TERMINAL_EMULATOR").second; }
 
  116}
 
 
◆ checkTerminalVersion()
  
  | 
        
          | void Term::Terminfo::checkTerminalVersion | ( |  | ) |  |  | staticprivate | 
 
Definition at line 118 of file terminfo.cpp.
@ TermVersion
Terminal version.
 
 
 
◆ checkUTF8()
  
  | 
        
          | void Term::Terminfo::checkUTF8 | ( |  | ) |  |  | staticprivate | 
 
Definition at line 172 of file terminfo.cpp.
  173{
  174#if defined(_WIN32)
  176#else
  181  std::size_t  moved{cursor_after.column() - cursor_before.column()};
  185#endif
  186}
std::size_t write(const std::string &str) const
@ UTF8
terminal has UTF-8 activated.
Term::Cursor cursor_position()
 
 
◆ get() [1/3]
◆ get() [2/3]
Definition at line 36 of file terminfo.cpp.
   37{
   39  return m_integers[
static_cast<std::size_t
>(key)];
 
   40}
static Integers m_integers
 
 
◆ get() [3/3]
◆ getColorMode()
◆ set() [1/3]
◆ set() [2/3]
◆ set() [3/3]
◆ BoolNumber
  
  | 
        
          | const constexpr std::size_t Term::Terminfo::BoolNumber {3} |  | staticconstexprprivate | 
 
 
◆ IntegerNumber
  
  | 
        
          | const constexpr std::size_t Term::Terminfo::IntegerNumber {0} |  | staticconstexprprivate | 
 
 
◆ m_booleans
◆ m_colorMode
◆ m_integers
◆ m_strings
◆ StringNumber
  
  | 
        
          | const constexpr std::size_t Term::Terminfo::StringNumber {3} |  | staticconstexprprivate | 
 
 
The documentation for this class was generated from the following files: