123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <chapter xml:id="ascii.h">
- <title><tt>__vic/ascii.h</tt></title>
- <p>Fast, compact and locale-independent tools for ASCII-characters
- processing. All the tools are located within <tt>__vic::ascii</tt>
- namespace.</p>
- <chapter xml:id="ascii--is-functions">
- <title><tt>ascii::is</tt>-functions</title>
- <code-block lang="C++">
- namespace ascii {
- constexpr bool isdigit(char c);
- constexpr bool isxdigit(char c);
- constexpr bool islower(char c);
- constexpr bool isupper(char c);
- constexpr bool isalpha(char c);
- constexpr bool isalnum(char c);
- constexpr bool isspace(char c);
- constexpr bool isblank(char c);
- constexpr bool isprint(char c);
- constexpr bool isgraph(char c);
- constexpr bool ispunct(char c);
- constexpr bool iscntrl(char c);
- constexpr bool isascii(char c);
- }
- </code-block>
- <p>Counterparts of the corresponding <tt><cctype></tt> functions.</p>
- </chapter>
- <chapter xml:id="ascii--todigit">
- <title><tt>ascii::todigit()</tt></title>
- <code-block lang="C++">
- constexpr char ascii::todigit(int d);
- </code-block>
- <p>Converts integer value from 0 to 9 to the decimal digit. The result is
- undefined if the input value goes beyond the range.</p>
- <precondition><tt><![CDATA[0 <= d && d <= 9]]></tt></precondition>
- </chapter>
- <chapter xml:id="ascii--toxdigit">
- <title><tt>ascii::toxdigit_upper()</tt>, <tt>ascii::toxdigit_lower()</tt></title>
- <code-block lang="C++">
- namespace ascii {
- constexpr char toxdigit_upper(int d);
- constexpr char toxdigit_lower(int d);
- }
- </code-block>
- <p>Converts integer value from 0 to 15 to the hexadecimal digit. The first one
- uses upper case for <tt>A</tt>-<tt>F</tt>, the latter - lower. The result
- is undefined if the input value goes beyond the range.</p>
- <precondition><tt><![CDATA[0 <= d && d <= 15]]></tt></precondition>
- </chapter>
- <chapter xml:id="ascii--digit_to_number">
- <title><tt>ascii::digit_to_number()</tt></title>
- <code-block lang="C++">
- constexpr int ascii::digit_to_number(char d);
- </code-block>
- <p>Converts the given decimal digit to the number if <tt>ascii::isdigit(d)</tt>.
- <tt>-1</tt> is returned otherwise.</p>
- </chapter>
- <chapter xml:id="ascii--xdigit_to_number">
- <title><tt>ascii::xdigit_to_number()</tt></title>
- <code-block lang="C++">
- constexpr int ascii::xdigit_to_number(char d);
- </code-block>
- <p>Converts the given hexadecimal digit to the number if
- <tt>ascii::isxdigit(d)</tt>. <tt>-1</tt> is returned otherwise.</p>
- </chapter>
- <chapter xml:id="ascii--tolower-char">
- <title><tt>ascii::tolower(char)</tt>, <tt>ascii::toupper(char)</tt></title>
- <code-block lang="C++">
- namespace ascii {
- constexpr char tolower(char c);
- constexpr char toupper(char c);
- constexpr char upper_to_lower(char upper);
- constexpr char lower_to_upper(char lower);
- }
- </code-block>
- <synopsis>
- <prototype>constexpr char tolower(char c)</prototype>
- <prototype>constexpr char toupper(char c)</prototype>
- <p>Counterparts of the corresponding <tt><cctype></tt> functions.</p>
- </synopsis>
- <synopsis>
- <prototype>constexpr char upper_to_lower(char upper)</prototype>
- <p>More restricted counterpart of <tt>tolower()</tt>. The result is undefined
- if the argument is not an ASCII capital letter.</p>
- <precondition><tt>ascii::isupper(upper)</tt></precondition>
- </synopsis>
- <synopsis>
- <prototype>constexpr char lower_to_upper(char lower)</prototype>
- <p>More restricted counterpart of <tt>toupper()</tt>. The result is undefined
- if the argument is not an ASCII small letter.</p>
- <precondition><tt>ascii::islower(lower)</tt></precondition>
- </synopsis>
- </chapter>
- <chapter xml:id="ascii--equal_icase-char">
- <title><tt>ascii::equal_icase(char,char)</tt></title>
- <code-block lang="C++">
- constexpr bool ascii::equal_icase(char ch1, char ch2);
- </code-block>
- <p>Checks equality of the two ASCII-characters ignoring the case.</p>
- </chapter>
- </chapter>
|