That Terminal
A terminal emulator designed for video making purposes.
ctype.hh File Reference

Functions for identifying and converting unicode characters and representation forms. More...

#include <string>
Include dependency graph for ctype.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool isupper (char32_t c)
 
bool islower (char32_t c)
 
bool isalpha (char32_t c)
 
bool isalnum (char32_t c)
 
bool isalnum_ (char32_t c)
 
bool isdigit (char32_t c)
 
bool isxdigit (char32_t c)
 
bool ispunct (char32_t c)
 
bool isspace (char32_t c)
 
bool isspace_punct (char32_t c)
 
bool isblank (char32_t c)
 
bool isctrl (char32_t c)
 
bool isprint (char32_t c)
 
bool isgraph (char32_t c)
 
bool isnotword (char32_t c)
 
bool isdouble (char32_t c)
 
char32_t tolower (char32_t c)
 
char32_t toupper (char32_t c)
 
char32_t totitle (char32_t c)
 
std::u32string FromUTF8 (std::string_view s)
 
std::u32string FromCP437 (std::string_view s)
 
std::string ToUTF8 (std::u32string_view s)
 
std::string ToUTF8 (std::u16string_view s)
 
std::size_t CountIndent (std::u32string_view s, std::size_t begin=0)
 

Detailed Description

Functions for identifying and converting unicode characters and representation forms.

Function Documentation

◆ CountIndent()

std::size_t CountIndent ( std::u32string_view  s,
std::size_t  begin = 0 
)

Calculates and returns the number of spaces in the beginning of the given string.

Parameters
sThe string to be searched.
beginAn optional beginning index from which to count the spaces.

◆ FromCP437()

std::u32string FromCP437 ( std::string_view  s)

Converts given text, assumed to be CP437 encoded, into a sequence of unicode codepoints

◆ FromUTF8()

std::u32string FromUTF8 ( std::string_view  s)

Converts given text, assumed to be UTF-8 encoded, into a sequence of unicode codepoints

This function is optimized for performance. A simple (but incomplete) implementation is shown in if-0. Surrogate pairs are detected and parsed properly, if they appear within a single string.

◆ isalnum()

bool isalnum ( char32_t  c)
Returns
true if given code index represents an alphabet or a numeric digit

◆ isalnum_()

bool isalnum_ ( char32_t  c)
Returns
true if given code index represents an alphabet or a numeric digit or the underscore

◆ isalpha()

bool isalpha ( char32_t  c)
Returns
true if given code index represents an alphabet

◆ isblank()

bool isblank ( char32_t  c)
Returns
true if given code index represents whitespace

◆ isctrl()

bool isctrl ( char32_t  c)
Returns
true if given code index represents a control character

◆ isdigit()

bool isdigit ( char32_t  c)
Returns
true if given code index represents a numeric digit

◆ isdouble()

bool isdouble ( char32_t  c)
Returns
true if given code index is double-wide

◆ isgraph()

bool isgraph ( char32_t  c)
Returns
true if given code index is graphics symbol

◆ islower()

bool islower ( char32_t  c)
Returns
true if given code index is lowercase

◆ isnotword()

bool isnotword ( char32_t  c)
Returns
true if given code index is graphics symbol

◆ isprint()

bool isprint ( char32_t  c)
Returns
true if given code index is printable

◆ ispunct()

bool ispunct ( char32_t  c)
Returns
true if given code index represents punctuation

◆ isspace()

bool isspace ( char32_t  c)
Returns
true if given code index represents whitespace

◆ isspace_punct()

bool isspace_punct ( char32_t  c)
Returns
true if given code index represents whitespace or punctuation

◆ isupper()

bool isupper ( char32_t  c)
Returns
true if given code index is uppercase

◆ isxdigit()

bool isxdigit ( char32_t  c)
Returns
true if given code index represents a hexadecimal digit

◆ tolower()

char32_t tolower ( char32_t  c)

Converts the given code index to its corresponding lowercase version

◆ totitle()

char32_t totitle ( char32_t  c)

Converts the given code index to its corresponding titlecase version

◆ toupper()

char32_t toupper ( char32_t  c)

Converts the given code index to its corresponding uppercase version

◆ ToUTF8() [1/2]

std::string ToUTF8 ( std::u16string_view  s)

Converts given sequence of unicode code points into UTF-8 encoded string

◆ ToUTF8() [2/2]

std::string ToUTF8 ( std::u32string_view  s)

Converts given sequence of unicode code points into UTF-8 encoded string

This function is optimized for performance.