Audacity 3.2.0
CodeConversions.h
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file CodeConversions.h
6 @brief Declare functions to perform UTF-8 to std::wstring conversions.
7
8 Dmitry Vedenko
9 **********************************************************************/
10
11#pragma once
12
13#include <string>
14#include <string_view>
15#include <wx/string.h>
16
17namespace audacity
18{
19
20STRING_UTILS_API std::string ToUTF8 (const std::wstring& wstr);
21STRING_UTILS_API std::string ToUTF8 (const wchar_t* wstr);
22STRING_UTILS_API std::string ToUTF8 (const wxString& wstr);
23
24// std::wstring is UTF16 on windows and UTF32 elsewhere.
25STRING_UTILS_API std::wstring ToWString (const std::string& str);
26STRING_UTILS_API std::wstring ToWString (std::string_view str);
27STRING_UTILS_API std::wstring ToWString (const char* str);
28STRING_UTILS_API std::wstring ToWString (const wxString& str);
29
30STRING_UTILS_API wxString ToWXString (const std::string& str);
31STRING_UTILS_API wxString ToWXString (std::string_view str);
32STRING_UTILS_API wxString ToWXString (const char* str);
33STRING_UTILS_API wxString ToWXString (const std::wstring& str);
34STRING_UTILS_API wxString ToWXString (std::wstring_view str);
35STRING_UTILS_API wxString ToWXString (const wchar_t* str);
36
37
38}
#define str(a)
std::string ToUTF8(const std::wstring &wstr)
std::wstring ToWString(const std::string &str)
wxString ToWXString(const std::string &str)