31#ifndef ETL_CHAR_TRAITS_INCLUDED
32#define ETL_CHAR_TRAITS_INCLUDED
52 typedef char char_type;
54 typedef long long off_type;
55 typedef size_t pos_type;
56 typedef char state_type;
61 typedef signed char char_type;
63 typedef long long off_type;
64 typedef size_t pos_type;
65 typedef signed char state_type;
70 typedef unsigned char char_type;
72 typedef long long off_type;
73 typedef size_t pos_type;
74 typedef unsigned char state_type;
79 typedef wchar_t char_type;
81 typedef long long off_type;
82 typedef size_t pos_type;
83 typedef char state_type;
89 typedef char8_t char_type;
90 typedef unsigned int int_type;
91 typedef long long off_type;
92 typedef size_t pos_type;
93 typedef char state_type;
99 typedef char16_t char_type;
101 typedef long long off_type;
102 typedef size_t pos_type;
103 typedef char state_type;
108 typedef char32_t char_type;
110 typedef long long off_type;
111 typedef size_t pos_type;
112 typedef char state_type;
128 static ETL_CONSTEXPR
bool eq(char_type a, char_type
b)
134 static ETL_CONSTEXPR
bool lt(char_type a, char_type
b)
140 static ETL_CONSTEXPR14
size_t length(
const char_type*
begin)
142 if (
begin == ETL_NULLPTR)
158 static ETL_CONSTEXPR14
size_t length(
const char_type* str,
size_t max_length)
174 static ETL_CONSTEXPR14
void assign(char_type&
r,
const char_type&
c)
180 static ETL_CONSTEXPR14 char_type* assign(char_type* p,
size_t n, char_type
c)
182 if (p != ETL_NULLPTR)
184 etl::fill_n(p,
n,
c);
191 static ETL_CONSTEXPR14 char_type* move(char_type*
dst,
const char_type*
src,
size_t count)
195 etl::copy_n(
src, count,
dst);
199 etl::copy_n(ETL_OR_STD::reverse_iterator<const char_type*>(
src + count),
201 ETL_OR_STD::reverse_iterator<char_type*>(
dst + count));
208 static ETL_CONSTEXPR14 char_type* copy(char_type*
dst,
const char_type*
src,
size_t count)
210 etl::copy_n(
src, count,
dst);
216 static ETL_CONSTEXPR14
int compare(
const char_type*
s1,
const char_type*
s2,
size_t count)
218 for (
size_t i = 0
UL; i < count; ++i)
220 const char_type
c1 = *
s1++;
221 const char_type
c2 = *
s2++;
237 static ETL_CONSTEXPR14
const char_type* find(
const char_type* p,
size_t count,
const char_type&
ch)
239 for (
size_t i = 0
UL; i < count; ++i)
253 static ETL_CONSTEXPR char_type to_char_type(int_type
c)
255 return static_cast<char_type
>(
c);
259 static ETL_CONSTEXPR int_type to_int_type(char_type
c)
261 return static_cast<int_type
>(
c);
265 static ETL_CONSTEXPR
bool eq_int_type(int_type
c1, int_type
c2)
271 static ETL_CONSTEXPR int_type eof()
277 static ETL_CONSTEXPR int_type not_eof(int_type e)
279 return (e == eof()) ? eof() - 1 : e;
286 template <
typename T>
295 template <
typename T>
304 template <
typename T>
307 while ((*
t1 != 0) || (*
t2 != 0))
329 template <
typename T>
332 while (((*
t1 != 0) || (*
t2 != 0)) && (
n != 0))
354 template <
typename T>
372 template <
typename T>
377 while ((*
src != 0) && (
n != 0))
bitset_ext
Definition absolute.h:38
ETL_CONSTEXPR14 int strncmp(const T *t1, const T *t2, size_t n)
Alternative strncmp for all character types.
Definition char_traits.h:330
ETL_CONSTEXPR14 size_t strlen(const T *t)
Alternative strlen for all character types.
Definition char_traits.h:287
ETL_CONSTEXPR TContainer::iterator begin(TContainer &container)
Definition iterator.h:962
ETL_CONSTEXPR14 T * strncpy(T *dst, const T *src, size_t n)
Alternative strncpy for all character types.
Definition char_traits.h:373
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:314
ETL_CONSTEXPR14 int strcmp(const T *t1, const T *t2)
Alternative strcmp for all character types.
Definition char_traits.h:305
ETL_CONSTEXPR14 T * strcpy(T *dst, const T *src)
Alternative strcpy for all character types.
Definition char_traits.h:355
ETL_CONSTEXPR TContainer::iterator end(TContainer &container)
Definition iterator.h:992
Definition char_traits.h:48
Character traits for any character type.
Definition char_traits.h:120