chsvlib
chsv helper source code

◆ ucp_isgraph()

int Chusov::String::ucp_isgraph ( ucp_t  ch)
noexcept

Returns a flag that indicates whether a given Unicode character has a nonempty graphical representation, i.e. any printable character except for whitespace characters.

Parameters
chis the character to check.
Returns
A result of ucp_isgraph_ascii, if ch belongs to the ASCII code space. Otherwise, the function returns a nonzero value, only if ch belongs to either of "Letter", "Number", "Punctuation", "Mark" or "Symbol" general categories of Unicode. Otherwise, the function returns a zero value.

The function firstly checks if ch belongs to the ASCII code space. If it does, the function returns the result of a call to ucp_isgraph_ascii. Otherwise, if ch is not an ASCII character the function checks if ch belongs to any of the respective Unicode general categories.

The function does not take Unicode surrogate pairs into account and simply returns 0, if ch appertains the range \(\left[\textrm{0xd800}; \textrm{0xf8ff}\right]\). The function also returns 0, if ch does not belong to the range of valid Unicode code points.