|
@ -47,9 +47,9 @@ public: |
|
|
void generate(const char32_t c, OutIter& out); |
|
|
void generate(const char32_t c, OutIter& out); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// returns the NFC class of a single character
|
|
|
/// returns whether the sequence starts with IsNFC==Yes char
|
|
|
static |
|
|
static |
|
|
IsNFC isNFC(CharT c); |
|
|
bool is_safe_NFC_start(std::basic_string_view<CharT> s); |
|
|
|
|
|
|
|
|
/// returns No or Maybe, if at least one character with NFC_Quickcheck class is "No" or "Maybe"
|
|
|
/// returns No or Maybe, if at least one character with NFC_Quickcheck class is "No" or "Maybe"
|
|
|
/// might throw illegal_utf exception
|
|
|
/// might throw illegal_utf exception
|
|
@ -205,6 +205,10 @@ public: |
|
|
return s.find( std::forward<Args>(args)... ); |
|
|
return s.find( std::forward<Args>(args)... ); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// might throw illegal_utf, if a multi-char sequence is clipped.
|
|
|
|
|
|
nfc_string substr(std::size_t pos=0, std::size_t count=npos) const; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
std::basic_string<CharT> s; |
|
|
std::basic_string<CharT> s; |
|
@ -214,6 +218,39 @@ public: |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/// can be more efficient than the operator+() below.
|
|
|
|
|
|
template<class CharT> |
|
|
|
|
|
typename |
|
|
|
|
|
UTF<CharT>::nfc_string operator+( |
|
|
|
|
|
typename UTF<CharT>::nfc_string left, |
|
|
|
|
|
const typename UTF<CharT>::nfc_string& right); |
|
|
|
|
|
|
|
|
|
|
|
template<class CharT, class T> |
|
|
|
|
|
inline |
|
|
|
|
|
typename |
|
|
|
|
|
UTF<CharT>::nfc_string operator+(typename UTF<CharT>::nfc_string left, const T& right) |
|
|
|
|
|
{ |
|
|
|
|
|
return left+=right; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template<class CharT, class T> |
|
|
|
|
|
inline |
|
|
|
|
|
typename |
|
|
|
|
|
UTF<CharT>::nfc_string operator+(typename UTF<CharT>::nfc_string&& left, const T& right) |
|
|
|
|
|
{ |
|
|
|
|
|
return left+=right; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class CharT, class T> |
|
|
|
|
|
inline |
|
|
|
|
|
typename |
|
|
|
|
|
UTF<CharT>::nfc_string operator+(const T& left, const typename UTF<CharT>::nfc_string& right) |
|
|
|
|
|
{ |
|
|
|
|
|
UTF<CharT> left_s{left}; |
|
|
|
|
|
return left_s+=right; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// convenient alias names:
|
|
|
/// convenient alias names:
|
|
|
using UTF8 = UTF<char>; |
|
|
using UTF8 = UTF<char>; |
|
|
using UTF16 = UTF<char16_t>; |
|
|
using UTF16 = UTF<char16_t>; |
|
|