|
@ -82,7 +82,8 @@ public: |
|
|
class nfc_string |
|
|
class nfc_string |
|
|
{ |
|
|
{ |
|
|
public: |
|
|
public: |
|
|
typedef std::basic_string<CharT> String; |
|
|
typedef std::basic_string<CharT> String; |
|
|
|
|
|
typedef std::basic_string_view<CharT> StringView; |
|
|
|
|
|
|
|
|
/// only const_reference is supported.
|
|
|
/// only const_reference is supported.
|
|
|
typedef typename String::const_reference const_reference; |
|
|
typedef typename String::const_reference const_reference; |
|
@ -92,13 +93,17 @@ public: |
|
|
typedef typename String::const_iterator const_iterator; |
|
|
typedef typename String::const_iterator const_iterator; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
explicit nfc_string(std::basic_string_view<CharT> src); |
|
|
explicit nfc_string(StringView src); |
|
|
explicit nfc_string(std::basic_string <CharT>&& src); |
|
|
explicit nfc_string(String && src); |
|
|
|
|
|
|
|
|
/// construct from a NUL-terminated src
|
|
|
/// construct from a NUL-terminated src
|
|
|
explicit nfc_string(const CharT* src); |
|
|
explicit nfc_string(const CharT* src) |
|
|
|
|
|
: nfc_string{ StringView{src} } |
|
|
|
|
|
{} |
|
|
|
|
|
|
|
|
nfc_string(const CharT* src, size_t length); |
|
|
nfc_string(const CharT* src, size_t length) |
|
|
|
|
|
: nfc_string{ StringView{src, length} } |
|
|
|
|
|
{} |
|
|
|
|
|
|
|
|
nfc_string(const nfc_string& src) = default; |
|
|
nfc_string(const nfc_string& src) = default; |
|
|
nfc_string( nfc_string&& src) = default; |
|
|
nfc_string( nfc_string&& src) = default; |
|
@ -106,8 +111,8 @@ public: |
|
|
nfc_string& operator=(const nfc_string& src) = default; |
|
|
nfc_string& operator=(const nfc_string& src) = default; |
|
|
nfc_string& operator=( nfc_string&& src) = default; |
|
|
nfc_string& operator=( nfc_string&& src) = default; |
|
|
|
|
|
|
|
|
nfc_string& assign(String&& src); |
|
|
nfc_string& assign(StringView src); |
|
|
nfc_string& assign(std::basic_string_view<CharT> src); |
|
|
nfc_string& assign(String && src); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// read-only: shares representation
|
|
|
/// read-only: shares representation
|
|
@ -121,6 +126,11 @@ public: |
|
|
std::size_t size() const noexcept { return s.size(); } |
|
|
std::size_t size() const noexcept { return s.size(); } |
|
|
bool empty() const noexcept { return s.empty(); } |
|
|
bool empty() const noexcept { return s.empty(); } |
|
|
|
|
|
|
|
|
|
|
|
const_iterator begin() const noexcept { return s.cbegin(); } |
|
|
|
|
|
const_iterator cbegin() const noexcept { return s.cbegin(); } /// r/o access only
|
|
|
|
|
|
const_iterator end() const noexcept { return s.cend(); } |
|
|
|
|
|
const_iterator cend() const noexcept { return s.cend(); } /// r/o access only
|
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
std::basic_string<CharT> s; |
|
|
std::basic_string<CharT> s; |
|
|
}; |
|
|
}; |
|
|