Boost.UI
User Interface Boost library
string.hpp
Go to the documentation of this file.
1 // Copyright (c) 2017 Kolya Kosenko
2 
3 // Distributed under the Boost Software License, Version 1.0.
4 // See http://www.boost.org/LICENSE_1_0.txt
5 
7 
8 #ifndef BOOST_UI_STRING_HPP
9 #define BOOST_UI_STRING_HPP
10 
11 #include <boost/ui/config.hpp>
12 
13 #ifdef BOOST_HAS_PRAGMA_ONCE
14 #pragma once
15 #endif
16 
17 #include <string>
18 
19 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
20 #include <initializer_list>
21 #endif
22 
23 #ifndef BOOST_UI_NO_STD_HASH
24 #include <functional>
25 #endif
26 
27 #ifdef DOXYGEN
28 
33 
34 #define BOOST_UI_NO_STRING_DESTRUCTIVE
35 
39 #define BOOST_UI_NO_CAST_FROM_ASCII
40 
41 #endif // DOXYGEN
42 
43 namespace boost {
44 namespace ui {
45 
48 
49 class BOOST_UI_DECL uistring
50 {
51 public:
53  typedef std::size_t size_type;
54 
55  uistring();
56 
58  uistring(const uistring& other);
59 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
60  uistring(uistring&& other)
61  {
62  init();
63  swap(other);
64  }
65 #endif
66 
68 #ifndef BOOST_UI_NO_CAST_FROM_ASCII
69  uistring(const char* str);
71  uistring(const std::string& str);
72 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
73  uistring(std::initializer_list<char> list)
74  {
75  init();
76  append(list);
77  }
78 #endif
79 #endif
81 
83  uistring(const wchar_t* str);
84  uistring(const std::wstring& str);
85 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
86  uistring(std::initializer_list<wchar_t> list)
87  {
88  init();
89  append(list);
90  }
91 #endif
92 
95 #ifndef BOOST_NO_CXX11_CHAR16_T
96  uistring(const char16_t* str) { init(std::u16string(str)); }
97  uistring(const std::u16string& str) { init(str); }
98 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
99  uistring(std::initializer_list<char16_t> list)
100  {
101  init();
102  append(list);
103  }
104 #endif
105 #endif
106 
109 #ifndef BOOST_NO_CXX11_CHAR32_T
110  uistring(const char32_t* str) { init(std::u32string(str)); }
111  uistring(const std::u32string& str) { init(str); }
112 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
113  uistring(std::initializer_list<char32_t> list)
114  {
115  init();
116  append(list);
117  }
118 #endif
119 #endif
120 
122  ~uistring();
123 
125  uistring& assign(const uistring& other);
126  uistring& operator=(const uistring& other) { return assign(other); }
127 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
129  {
130  swap(other);
131  return *this;
132  }
134  {
135  // return assign(other); // not works
136  swap(other);
137  return *this;
138  }
139 #endif
140 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
141 #ifndef BOOST_UI_NO_CAST_FROM_ASCII
142  uistring& assign(std::initializer_list<char> list)
143  {
144  clear();
145  return append(list);
146  }
147  uistring& operator=(std::initializer_list<char> list) { return assign(list); }
148 #endif
149  uistring& assign(std::initializer_list<wchar_t> list)
150  {
151  clear();
152  return append(list);
153  }
154  uistring& operator=(std::initializer_list<wchar_t> list) { return assign(list); }
155 #endif
156 
159  uistring& append(const uistring& str);
160  uistring& operator+=(const uistring& str) { return append(str); }
161 #ifndef BOOST_UI_NO_CAST_FROM_ASCII
162  uistring& append(size_type count, char ch);
163 #endif
164  uistring& append(size_type count, wchar_t ch);
165 #ifndef BOOST_NO_CXX11_CHAR16_T
166  uistring& append(size_type count, char16_t ch)
167  { return append(count, static_cast<wchar_t>(ch)); }
168 #endif
169 #ifndef BOOST_NO_CXX11_CHAR32_T
170  uistring& append(size_type count, char32_t ch)
171  { return append(count, static_cast<wchar_t>(ch)); }
172 #endif
173 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
174 #ifndef BOOST_UI_NO_CAST_FROM_ASCII
175  uistring& append(std::initializer_list<char> list)
176  {
177  for ( std::initializer_list<char>::const_iterator i = list.begin();
178  i != list.end(); ++i )
179  push_back(*i);
180 
181  return *this;
182  }
183  uistring& operator+=(std::initializer_list<char> list) { return append(list); }
184 #endif
185  uistring& append(std::initializer_list<wchar_t> list)
186  {
187  for ( std::initializer_list<wchar_t>::const_iterator i = list.begin();
188  i != list.end(); ++i )
189  push_back(*i);
190 
191  return *this;
192  }
193  uistring& operator+=(std::initializer_list<wchar_t> list) { return append(list); }
194 #ifndef BOOST_NO_CXX11_CHAR16_T
195  uistring& append(std::initializer_list<char16_t> list)
196  {
197  for ( std::initializer_list<char16_t>::const_iterator i = list.begin();
198  i != list.end(); ++i )
199  push_back(*i);
200 
201  return *this;
202  }
203  uistring& operator+=(std::initializer_list<char16_t> list) { return append(list); }
204 #endif
205 #ifndef BOOST_NO_CXX11_CHAR32_T
206  uistring& append(std::initializer_list<char32_t> list)
207  {
208  for ( std::initializer_list<char32_t>::const_iterator i = list.begin();
209  i != list.end(); ++i )
210  push_back(*i);
211 
212  return *this;
213  }
214  uistring& operator+=(std::initializer_list<char32_t> list) { return append(list); }
215 #endif
216 #endif
217 
220 #ifndef BOOST_UI_NO_CAST_FROM_ASCII
221  void push_back(char ch);
222  uistring& operator+=(char ch) { push_back(ch); return *this; }
223 #endif
224  void push_back(wchar_t ch);
225  uistring& operator+=(wchar_t ch) { push_back(ch); return *this; }
226 #ifndef BOOST_NO_CXX11_CHAR16_T
227  void push_back(char16_t ch) { push_back(static_cast<wchar_t>(ch)); }
228  uistring& operator+=(char16_t ch) { push_back(ch); return *this; }
229 #endif
230 #ifndef BOOST_NO_CXX11_CHAR32_T
231  void push_back(char32_t ch) { push_back(static_cast<wchar_t>(ch)); }
232  uistring& operator+=(char32_t ch) { push_back(ch); return *this; }
233 #endif
234 
237  int compare(const uistring& other) const BOOST_NOEXCEPT;
238  bool operator==(const uistring& other) const BOOST_NOEXCEPT
239  { return compare(other) == 0; }
240  bool operator!=(const uistring& other) const BOOST_NOEXCEPT
241  { return compare(other) != 0; }
242  bool operator<(const uistring& other) const BOOST_NOEXCEPT
243  { return compare(other) < 0; }
244  bool operator<=(const uistring& other) const BOOST_NOEXCEPT
245  { return compare(other) <= 0; }
246  bool operator>(const uistring& other) const BOOST_NOEXCEPT
247  { return compare(other) > 0; }
248  bool operator>=(const uistring& other) const BOOST_NOEXCEPT
249  { return compare(other) >= 0; }
251 
253  void swap(const uistring& other);
254 
256  bool empty() const BOOST_NOEXCEPT;
257 
259  void clear() BOOST_NOEXCEPT;
260 
262  void shrink_to_fit();
263 
269  template <class charT>
270  std::basic_string<charT> utf() const;
271 
273  template <class charT>
274  std::basic_string<charT> basic_string() const;
275 
277  std::string u8string() const;
278 
279 #ifndef BOOST_UI_NO_STRING_DESTRUCTIVE
280  std::string asciistring() const;
283 
285  std::string string() const;
286 #endif
287 
289  std::wstring wstring() const;
290 
291 #ifndef BOOST_NO_CXX11_CHAR16_T
292  std::u16string u16string() const
294  { return xstring<std::u16string>(); }
295 #endif
296 
297 #ifndef BOOST_NO_CXX11_CHAR32_T
298  std::u32string u32string() const
300  { return xstring<std::u32string>(); }
302 #endif
303 
305  typedef void* native_handle_type;
306 
308  native_handle_type native_handle() { return m_impl; }
309  const native_handle_type native_handle() const { return m_impl; }
311 
312 private:
313  void init();
314  void init(const std::wstring& str);
315 
316  static uistring make_from_utf8(const char* str);
317  static uistring make_from_ascii(const char* str);
318 
319  template <class String>
320  void init(const String& str)
321  {
322  std::wstring wstr;
323  wstr.reserve(str.size());
324  for ( typename String::const_iterator iter = str.begin();
325  iter != str.end(); ++iter )
326  wstr.push_back(static_cast<wchar_t>(*iter));
327  init(wstr);
328  }
329 
330  template <class String>
331  String xstring() const
332  {
333  const std::wstring wstr = wstring();
334  String result;
335  result.reserve(wstr.size());
336  for ( std::wstring::const_iterator iter = wstr.begin();
337  iter != wstr.end(); ++iter )
338  result.push_back(*iter);
339  return result;
340  }
341 
342  class impl;
343  impl* m_impl;
344 
345 #ifndef DOXYGEN
346  friend class native_helper;
347  friend uistring u8uistring(const char* str);
348  friend uistring asciiuistring(const char* str);
349 #endif
350 };
351 
353 template <>
354 inline std::basic_string<char> uistring::utf() const { return u8string(); }
355 
356 #ifndef BOOST_UI_NO_STRING_DESTRUCTIVE
357 template <>
359 inline std::string uistring::basic_string() const { return string(); }
360 #endif
361 
363 template <>
364 inline std::basic_string<wchar_t> uistring::utf() const { return wstring(); }
365 
367 template <>
368 inline std::wstring uistring::basic_string() const { return wstring(); }
369 
370 #ifndef BOOST_NO_CXX11_CHAR16_T
371 template <>
373 inline std::basic_string<char16_t> uistring::utf() const { return u16string(); }
374 
376 template <>
377 inline std::u16string uistring::basic_string() const { return u16string(); }
378 #endif
379 
380 #ifndef BOOST_NO_CXX11_CHAR32_T
381 template <>
383 inline std::basic_string<char32_t> uistring::utf() const { return u32string(); }
384 
386 template <>
387 inline std::u32string uistring::basic_string() const { return u32string(); }
388 #endif
389 
392 inline uistring u8uistring(const char* str) { return uistring::make_from_utf8(str); }
393 inline uistring u8uistring(const std::string& str) { return u8uistring(str.c_str()); }
394 inline uistring utf8(const char* str) { return u8uistring(str); }
395 inline uistring utf8(const std::string& str) { return u8uistring(str.c_str()); }
397 
400 inline uistring asciiuistring(const char* str) { return uistring::make_from_ascii(str); }
401 inline uistring asciiuistring(const std::string& str) { return asciiuistring(str.c_str()); }
402 inline uistring ascii(const char* str) { return asciiuistring(str); }
403 inline uistring ascii(const std::string& str) { return asciiuistring(str.c_str()); }
405 
408 inline uistring operator+(const uistring& lhs, const uistring& rhs)
409 {
410  uistring result(lhs);
411  result.append(rhs);
412  return result;
413 }
414 
415 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
416 inline uistring operator+(uistring&& lhs, const uistring& rhs)
417 {
418  return std::move(lhs.append(rhs));
419 }
420 inline uistring operator+(const uistring& lhs, uistring&& rhs)
421 {
422  uistring result(lhs);
423  result.append(std::move(rhs));
424  rhs.clear(); // TODO: Remove
425  return result;
426 }
427 inline uistring operator+(uistring&& lhs, uistring&& rhs)
428 {
429  return std::move(lhs.append(rhs));
430 }
431 #endif
432 
433 #ifndef BOOST_UI_NO_CAST_FROM_ASCII
434 inline uistring operator+(const uistring& lhs, char rhs)
435 {
436  uistring result(lhs);
437  result.push_back(rhs);
438  return result;
439 }
440 inline uistring operator+(const uistring& lhs, const char* rhs)
441 {
442  uistring result(lhs);
443  result.append(rhs);
444  return result;
445 }
446 inline uistring operator+(char lhs, const uistring& rhs)
447 {
448  uistring result;
449  result.push_back(lhs);
450  result.append(rhs);
451  return result;
452 }
453 inline uistring operator+(const char* lhs, const uistring& rhs)
454 {
455  uistring result;
456  result.append(lhs);
457  result.append(rhs);
458  return result;
459 }
460 #endif
461 inline uistring operator+(const uistring& lhs, wchar_t rhs)
462 {
463  uistring result(lhs);
464  result.push_back(rhs);
465  return result;
466 }
467 inline uistring operator+(const uistring& lhs, const wchar_t* rhs)
468 {
469  uistring result(lhs);
470  result.append(rhs);
471  return result;
472 }
473 inline uistring operator+(wchar_t lhs, const uistring& rhs)
474 {
475  uistring result;
476  result.push_back(lhs);
477  result.append(rhs);
478  return result;
479 }
480 inline uistring operator+(const wchar_t* lhs, const uistring& rhs)
481 {
482  uistring result;
483  result.append(lhs);
484  result.append(rhs);
485  return result;
486 }
487 #ifndef BOOST_NO_CXX11_CHAR16_T
488 inline uistring operator+(const uistring& lhs, char16_t rhs)
489 {
490  uistring result(lhs);
491  result.push_back(rhs);
492  return result;
493 }
494 inline uistring operator+(const uistring& lhs, const char16_t* rhs)
495 {
496  uistring result(lhs);
497  result.append(rhs);
498  return result;
499 }
500 inline uistring operator+(char16_t lhs, const uistring& rhs)
501 {
502  uistring result;
503  result.push_back(lhs);
504  result.append(rhs);
505  return result;
506 }
507 inline uistring operator+(const char16_t* lhs, const uistring& rhs)
508 {
509  uistring result;
510  result.append(lhs);
511  result.append(rhs);
512  return result;
513 }
514 #endif
515 #ifndef BOOST_NO_CXX11_CHAR32_T
516 inline uistring operator+(const uistring& lhs, char32_t rhs)
517 {
518  uistring result(lhs);
519  result.push_back(rhs);
520  return result;
521 }
522 inline uistring operator+(const uistring& lhs, const char32_t* rhs)
523 {
524  uistring result(lhs);
525  result.append(rhs);
526  return result;
527 }
528 inline uistring operator+(char32_t lhs, const uistring& rhs)
529 {
530  uistring result;
531  result.push_back(lhs);
532  result.append(rhs);
533  return result;
534 }
535 inline uistring operator+(const char32_t* lhs, const uistring& rhs)
536 {
537  uistring result;
538  result.append(lhs);
539  result.append(rhs);
540  return result;
541 }
542 #endif
543 
544 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
545 #ifndef BOOST_UI_NO_CAST_FROM_ASCII
546 inline uistring operator+(uistring&& lhs, char rhs)
547 {
548  return std::move(lhs.append(1, rhs));
549 }
550 inline uistring operator+(uistring&& lhs, const char* rhs)
551 {
552  return std::move(lhs.append(rhs));
553 }
554 #endif
555 inline uistring operator+(uistring&& lhs, wchar_t rhs)
556 {
557  return std::move(lhs.append(1, rhs));
558 }
559 inline uistring operator+(uistring&& lhs, const wchar_t* rhs)
560 {
561  return std::move(lhs.append(rhs));
562 }
563 #ifndef BOOST_NO_CXX11_CHAR16_T
564 inline uistring operator+(uistring&& lhs, char16_t rhs)
565 {
566  return std::move(lhs.append(1, rhs));
567 }
568 inline uistring operator+(uistring&& lhs, const char16_t* rhs)
569 {
570  return std::move(lhs.append(rhs));
571 }
572 #endif
573 #ifndef BOOST_NO_CXX11_CHAR32_T
574 inline uistring operator+(uistring&& lhs, char32_t rhs)
575 {
576  return std::move(lhs.append(1, rhs));
577 }
578 inline uistring operator+(uistring&& lhs, const char32_t* rhs)
579 {
580  return std::move(lhs.append(rhs));
581 }
582 #endif
583 #endif // BOOST_NO_CXX11_RVALUE_REFERENCES
584 
586 
589 BOOST_UI_DECL uistring to_uistring(int value);
590 BOOST_UI_DECL uistring to_uistring(unsigned int value);
591 BOOST_UI_DECL uistring to_uistring(long value);
592 BOOST_UI_DECL uistring to_uistring(unsigned long value);
593 BOOST_UI_DECL uistring to_uistring(long long value);
594 BOOST_UI_DECL uistring to_uistring(unsigned long long value);
595 BOOST_UI_DECL uistring to_uistring(float value);
596 BOOST_UI_DECL uistring to_uistring(double value);
597 BOOST_UI_DECL uistring to_uistring(long double value);
599 
602 BOOST_UI_DECL std::size_t hash_value(const uistring& value);
603 
604 } // namespace ui
605 } // namespace boost
606 
608 namespace std {
609 
612 inline void swap(boost::ui::uistring& a, boost::ui::uistring& b) { a.swap(b); }
613 
614 #ifndef BOOST_UI_NO_STD_HASH
615 
617 template<>
618 struct hash<boost::ui::uistring>
619  : public std::unary_function<boost::ui::uistring, std::size_t>
620 {
622  std::size_t operator()(const boost::ui::uistring& key) const
623  {
624  return std::hash<std::wstring>()(key.wstring());
625  }
626 };
627 
628 #endif
629 
630 } // namespace std
631 
632 #endif // BOOST_UI_STRING_HPP
boost::ui::uistring
Helper class to convert string between UI and application logic only.
Definition: string.hpp:49
boost::ui::uistring::size_type
std::size_t size_type
Unsigned integral type.
Definition: string.hpp:53
boost::ui::uistring::operator+=
uistring & operator+=(char32_t ch)
Appends character to the end of string.
Definition: string.hpp:232
boost::ui::uistring::operator<=
bool operator<=(const uistring &other) const noexcept
Lexicographically compares two strings.
Definition: string.hpp:244
boost::ui::uistring::operator=
uistring & operator=(uistring &&other)
Assigns other string to this string.
Definition: string.hpp:133
config.hpp
Configuration options.
std::hash< boost::ui::uistring >::operator()
std::size_t operator()(const boost::ui::uistring &key) const
Calculates the hash of the boost::ui::uistring.
Definition: string.hpp:622
boost::ui::uistring::u32string
std::u32string u32string() const
Returns UTF-32 std::u32string.
Definition: string.hpp:299
boost::ui::uistring::operator+=
uistring & operator+=(char16_t ch)
Appends character to the end of string.
Definition: string.hpp:228
boost::ui::uistring::append
uistring & append(size_type count, char32_t ch)
Appends characters to the end of string.
Definition: string.hpp:170
boost::ui::uistring::uistring
uistring(const char16_t *str)
Constructs uistring from UTF-16 string.
Definition: string.hpp:96
boost::ui::uistring::u8string
std::string u8string() const
Returns UTF-8 encoded string.
boost::ui::uistring::basic_string
std::basic_string< charT > basic_string() const
Returns std::basic_string<charT>
boost
Boost C++ libraries namespace.
Definition: window.hpp:19
boost::ui::uistring::push_back
void push_back(char32_t ch)
Appends character to the end of string.
Definition: string.hpp:231
boost::ui::uistring::operator>
bool operator>(const uistring &other) const noexcept
Lexicographically compares two strings.
Definition: string.hpp:246
boost::ui::uistring::push_back
void push_back(wchar_t ch)
Appends character to the end of string.
boost::ui::uistring::clear
void clear() noexcept
Clears the contents.
boost::ui::uistring::append
uistring & append(std::initializer_list< wchar_t > list)
Appends characters to the end of string.
Definition: string.hpp:185
boost::ui::uistring::push_back
void push_back(char16_t ch)
Appends character to the end of string.
Definition: string.hpp:227
boost::ui::uistring::operator<
bool operator<(const uistring &other) const noexcept
Lexicographically compares two strings.
Definition: string.hpp:242
boost::ui::uistring::uistring
uistring(const std::u16string &str)
Constructs uistring from UTF-16 string.
Definition: string.hpp:97
boost::ui::uistring::operator=
uistring & operator=(std::initializer_list< wchar_t > list)
Assigns other string to this string.
Definition: string.hpp:154
boost::ui::hash_value
std::size_t hash_value(const uistring &value)
Returns hash of uistring for boost::hash.
boost::ui::uistring::assign
uistring & assign(uistring &&other)
Assigns other string to this string.
Definition: string.hpp:128
boost::ui::uistring::append
uistring & append(std::initializer_list< char16_t > list)
Appends characters to the end of string.
Definition: string.hpp:195
boost::ui::uistring::operator==
bool operator==(const uistring &other) const noexcept
Lexicographically compares two strings.
Definition: string.hpp:238
boost::ui::uistring::operator+=
uistring & operator+=(std::initializer_list< char32_t > list)
Appends characters to the end of string.
Definition: string.hpp:214
boost::ui::uistring::operator>=
bool operator>=(const uistring &other) const noexcept
Lexicographically compares two strings.
Definition: string.hpp:248
boost::ui::operator+
uistring operator+(const uistring &lhs, const uistring &rhs)
Concatenates two strings or the string and the character.
Definition: string.hpp:408
boost::ui::uistring::uistring
uistring(uistring &&other)
Constructs uistring from other uistring.
Definition: string.hpp:60
boost::ui::uistring::append
uistring & append(std::initializer_list< char32_t > list)
Appends characters to the end of string.
Definition: string.hpp:206
boost::ui::uistring::uistring
uistring(const std::u32string &str)
Constructs uistring from UTF-32 string.
Definition: string.hpp:111
boost::ui::uistring::native_handle
native_handle_type native_handle()
Returns the implementation-defined underlying string handle.
Definition: string.hpp:308
boost::ui::ascii
uistring ascii(const char *str)
Constructs uistring from 7-bit ASCII encoded string.
Definition: string.hpp:402
boost::ui::uistring::uistring
uistring(std::initializer_list< wchar_t > list)
Constructs uistring from Unicode wide char string.
Definition: string.hpp:86
boost::ui::uistring::wstring
std::wstring wstring() const
Returns Unicode wide std::wstring.
boost::ui::u8uistring
uistring u8uistring(const char *str)
Constructs uistring from UTF-8 encoded string.
Definition: string.hpp:392
boost::ui::uistring::uistring
uistring(std::initializer_list< char32_t > list)
Constructs uistring from UTF-32 string.
Definition: string.hpp:113
boost::ui::uistring::operator=
uistring & operator=(const uistring &other)
Assigns other string to this string.
Definition: string.hpp:126
boost::ui::uistring::u16string
std::u16string u16string() const
Returns UTF-16 std::u16string.
Definition: string.hpp:293
boost::ui::uistring::assign
uistring & assign(std::initializer_list< wchar_t > list)
Assigns other string to this string.
Definition: string.hpp:149
boost::ui::uistring::utf
std::basic_string< charT > utf() const
Returns UTF-8/16/32 encoded string Returns UTF-8 encoded string if charT is char, returns UTF-16 enco...
boost::ui::to_uistring
uistring to_uistring(int value)
Converts numeric value to uistring.
std
Standard C++ namespace.
Definition: string_io.hpp:117
boost::ui::asciiuistring
uistring asciiuistring(const char *str)
Constructs uistring from 7-bit ASCII encoded string.
Definition: string.hpp:400
boost::ui::uistring::append
uistring & append(const uistring &str)
Appends characters to the end of string.
boost::ui::uistring::append
uistring & append(size_type count, char16_t ch)
Appends characters to the end of string.
Definition: string.hpp:166
boost::ui::uistring::operator+=
uistring & operator+=(std::initializer_list< char16_t > list)
Appends characters to the end of string.
Definition: string.hpp:203
boost::ui::uistring::swap
void swap(const uistring &other)
Exchanges the contents of strings.
boost::ui::uistring::operator+=
uistring & operator+=(const uistring &str)
Appends characters to the end of string.
Definition: string.hpp:160
boost::ui::uistring::uistring
uistring(const char32_t *str)
Constructs uistring from UTF-32 string.
Definition: string.hpp:110
boost::ui::uistring::uistring
uistring(std::initializer_list< char16_t > list)
Constructs uistring from UTF-16 string.
Definition: string.hpp:99
std::swap
void swap(boost::ui::uistring &a, boost::ui::uistring &b)
Specializes the std::swap algorithm.
Definition: string.hpp:612
boost::ui::uistring::operator+=
uistring & operator+=(wchar_t ch)
Appends character to the end of string.
Definition: string.hpp:225
boost::ui::utf8
uistring utf8(const char *str)
Constructs uistring from UTF-8 encoded string.
Definition: string.hpp:394
boost::ui::uistring::native_handle_type
void * native_handle_type
Implementation-defined string type.
Definition: string.hpp:305
boost::ui::uistring::operator+=
uistring & operator+=(std::initializer_list< wchar_t > list)
Appends characters to the end of string.
Definition: string.hpp:193
boost::ui::uistring::operator!=
bool operator!=(const uistring &other) const noexcept
Lexicographically compares two strings.
Definition: string.hpp:240
boost::ui::uistring::native_handle
const native_handle_type native_handle() const
Returns the implementation-defined underlying string handle.
Definition: string.hpp:309