xtd 0.2.0
Loading...
Searching...
No Matches
box_char.h
Go to the documentation of this file.
1
4#pragma once
5#include "box_integer.h"
6
8namespace xtd {
35 template<typename type_t>
36 class box_char : public xtd::box_integer<type_t> {
37 public:
39 box_char() = default;
40 box_char(const type_t& value) : box_integer<type_t>(value) {}
41 box_char(const box_char&) = default;
42 box_char(box_char&&) = default;
43 box_char& operator =(const box_char&) = default;
45
47
52 static bool is_ascii(type_t c) noexcept {return c > 0 && c <= 0x7F;}
53
59 static bool is_ascii(const ustring& s, size_t index) {return is_ascii(s[index]);}
60
64 static bool is_control(type_t c) noexcept {return std::iscntrl(c) != 0;}
65
71 static bool is_control(const ustring& s, size_t index) {return is_control(s[index]);}
72
77 static bool is_digit(type_t c) noexcept {return std::isdigit(c) != 0;}
78
84 static bool is_digit(const ustring& s, size_t index) {return is_digit(s[index]);}
85
89 static bool is_letter(type_t c) noexcept {return std::isalpha(c) != 0;}
90
96 static bool is_letter(const ustring& s, size_t index) {return is_letter(s[index]);}
97
101 static bool is_letter_or_digit(type_t c) noexcept {return std::isalnum(c) != 0;}
102
108 static bool is_letter_or_digit(const ustring& s, size_t index) {return is_letter_or_digit(s[index]);}
109
113 static bool is_lower(type_t c) noexcept {return std::islower(c) != 0;}
114
120 static bool is_lower(const ustring& s, size_t index) {return is_lower(s[index]);}
121
125 static bool is_number(type_t c) noexcept {return std::isdigit(c) != 0;}
126
132 static bool is_number(const ustring& s, size_t index) {return is_number(s[index]);}
133
137 static bool is_punctuation(type_t c) noexcept {return std::ispunct(c) != 0;}
138
144 static bool is_punctuation(const ustring& s, size_t index) {return is_punctuation(s[index]);}
145
149 static bool is_separator(type_t c) noexcept {return std::isspace(c) != 0 || c == '\n';}
150
156 static bool is_separator(const ustring& s, size_t index) {return is_separator(s[index]);}
157
161 static bool is_symbol(type_t c) noexcept {return std::isgraph(c) != 0 || c == 0x9C;}
162
168 static bool is_symbol(const ustring& s, size_t index) {return is_symbol(s[index]);}
169
173 static bool is_upper(type_t c) noexcept {return std::isupper(c) != 0;}
174
180 static bool is_upper(const ustring& s, size_t index) {return is_upper(s[index]);}
181
185 static bool is_white_space(type_t c) noexcept {return std::isspace(c) != 0;}
186
192 static bool is_white_space(const ustring& s, size_t index) {return is_white_space(s[index]);}
193
197 static char to_lower(type_t c) noexcept {return static_cast<type_t>(std::tolower(c));}
198
202 static char to_upper(type_t c) noexcept {return static_cast<type_t>(std::toupper(c));}
204 };
205}
Contains xtd::box_integer class.
Represents a boxed char object.
Definition box_char.h:36
static bool is_symbol(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is categorized as a s...
Definition box_char.h:168
static bool is_punctuation(type_t c) noexcept
Indicates whether the specified Unicode character is categorized as a punctuation mark.
Definition box_char.h:137
static bool is_punctuation(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is categorized as a p...
Definition box_char.h:144
static bool is_upper(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is categorized as an ...
Definition box_char.h:180
static bool is_control(type_t c) noexcept
Indicates whether the specified Unicode character is categorized as a control character.
Definition box_char.h:64
static bool is_lower(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is categorized as a l...
Definition box_char.h:120
static bool is_upper(type_t c) noexcept
Indicates whether the specified Unicode character is categorized as an uppercase letter.
Definition box_char.h:173
static bool is_digit(type_t c) noexcept
Indicates whether the specified Unicode character is categorized as a decimal digit.
Definition box_char.h:77
static bool is_lower(type_t c) noexcept
ndicates whether the specified Unicode character is categorized as a lowercase letter.
Definition box_char.h:113
static bool is_symbol(type_t c) noexcept
Indicates whether the specified Unicode character is categorized as a symbol character.
Definition box_char.h:161
static bool is_white_space(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is categorized as whi...
Definition box_char.h:192
static bool is_letter(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is categorized as a U...
Definition box_char.h:96
static char to_upper(type_t c) noexcept
Converts the value of a Unicode character to its uppercase equivalent.
Definition box_char.h:202
static bool is_separator(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is categorized as a s...
Definition box_char.h:156
static char to_lower(type_t c) noexcept
Converts the value of a Unicode character to its lowercase equivalent.
Definition box_char.h:197
static bool is_letter_or_digit(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is categorized as a l...
Definition box_char.h:108
static bool is_digit(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is categorized as a d...
Definition box_char.h:84
static bool is_separator(type_t c) noexcept
Indicates whether the specified Unicode character is categorized as a separator character.
Definition box_char.h:149
static bool is_white_space(type_t c) noexcept
Indicates whether the specified Unicode character is categorized as white space.
Definition box_char.h:185
static bool is_letter_or_digit(type_t c) noexcept
Indicates whether a Unicode character is categorized as a letter or a decimal digit.
Definition box_char.h:101
static bool is_control(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is categorized as a c...
Definition box_char.h:71
static bool is_ascii(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is an ASCII character...
Definition box_char.h:59
static bool is_ascii(type_t c) noexcept
Returns true if c is an ASCII character ([ U+0000..U+007F ]).
Definition box_char.h:52
static bool is_number(const ustring &s, size_t index)
Indicates whether the character at the specified position in a specified string is categorized as a n...
Definition box_char.h:132
static bool is_number(type_t c) noexcept
Indicates whether a Unicode character is categorized as a number.
Definition box_char.h:125
static bool is_letter(type_t c) noexcept
Indicates whether the specified Unicode character is categorized as a Unicode letter.
Definition box_char.h:89
Represents a boxed integer object.
Definition box_integer.h:50
const type_t & value() const noexcept
Gets the underlying value.
Definition box.h:79
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
@ s
The S key.
@ c
The C key.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10