windows.wchar.h.xml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <chapter xml:id="windows.wchar.h">
  2. <title><tt>__vic/windows/wchar.h</tt></title>
  3. <p>UTF-8 &lt;-> UTF-16 interconversion tools.</p>
  4. <chapter xml:id="windows--wstring">
  5. <title><tt>windows::wstring</tt></title>
  6. <code-block lang="C++">
  7. class windows::wstring : public std::wstring
  8. {
  9. public:
  10. wstring() = default;
  11. explicit wstring(size_type n) { reserve(n); }
  12. wstring(const wchar_t *st);
  13. wstring(std::wstring st);
  14. operator const wchar_t *() const { return c_str(); }
  15. };
  16. </code-block>
  17. <p><tt>std::wstring</tt> with automatic conversion to <tt>const wchar_t *</tt>.</p>
  18. </chapter>
  19. <chapter xml:id="windows--utf8to16">
  20. <title><tt>windows::utf8to16()</tt></title>
  21. <code-block lang="C++">
  22. windows::wstring windows::utf8to16(const char *s, size_t len);
  23. windows::wstring windows::utf8to16(const char *s);
  24. </code-block>
  25. <p>UTF-8 to UTF-16 converter.</p>
  26. </chapter>
  27. <chapter xml:id="windows--utf16to8">
  28. <title><tt>windows::utf16to8()</tt></title>
  29. <code-block lang="C++">
  30. std::string windows::utf16to8(const wchar_t *s, size_t len);
  31. std::string windows::utf16to8(const wchar_t *s);
  32. </code-block>
  33. <p>UTF-16 to UTF-8 converter.</p>
  34. </chapter>
  35. </chapter>