Mercurial > foo_out_sdl
diff foosdk/sdk/pfc/string-conv-lite.h @ 1:20d02a178406 default tip
*: check in everything else
yay
| author | Paper <paper@tflc.us> |
|---|---|
| date | Mon, 05 Jan 2026 02:15:46 -0500 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foosdk/sdk/pfc/string-conv-lite.h Mon Jan 05 02:15:46 2026 -0500 @@ -0,0 +1,22 @@ +#pragma once +#include "array.h" +#include "string_base.h" +namespace pfc { + + class wstringLite { + public: + const wchar_t* c_str() const noexcept { + return m_buffer.size() > 0 ? m_buffer.get_ptr() : L""; + } + operator const wchar_t* () const noexcept { return c_str(); } + size_t length() const noexcept { return wcslen(c_str()); } + + pfc::array_t<wchar_t> m_buffer; + }; + + wstringLite wideFromUTF8(const char* pUTF8, size_t inSize); + string8 utf8FromWide(const wchar_t* pWide, size_t inSize); + + wstringLite wideFromUTF8(const char* pUTF8); + string8 utf8FromWide(const wchar_t* pWide); +} \ No newline at end of file
