omw  0.1.1
windows/string.h
1 /*
2 author Oliver Blaser
3 date 09.06.2021
4 copyright MIT - Copyright (c) 2021 Oliver Blaser
5 */
6 
7 #ifndef IG_OMW_WINDOWS_STRING_H
8 #define IG_OMW_WINDOWS_STRING_H
9 
10 #include "../../omw/defs.h"
11 #ifdef OMW_PLAT_WIN
12 
13 #include <cstddef>
14 #include <string>
15 
16 #include "../../omw/windows/error.h"
17 
18 #include <Windows.h>
19 
20 namespace omw
21 {
22  namespace windows
23  {
26  size_t utf8_to_wstr(const std::string& src, LPWSTR dest, size_t destSize);
27  size_t utf8_to_wstr(const std::string& src, LPWSTR dest, size_t destSize, omw::windows::ErrorCode& ec);
28  size_t wstr_to_utf8(LPCWCH src, char* dest, size_t destSize);
29  size_t wstr_to_utf8(LPCWCH src, char* dest, size_t destSize, omw::windows::ErrorCode& ec);
30  void wstr_to_utf8(LPCWCH src, std::string& dest);
31  void wstr_to_utf8(LPCWCH src, std::string& dest, omw::windows::ErrorCode& ec);
33  }
34 }
35 
36 #endif // OMW_PLAT_WIN
37 #endif // IG_OMW_WINDOWS_STRING_H
std::string
C++ standard string. See std::basic_string for detailed information.
Definition: linkToStd.dox:15
omw::windows::utf8_to_wstr
size_t utf8_to_wstr(const std::string &src, LPWSTR dest, size_t destSize)
Converts an UTF-8 string to a Windows API compatible wide string.
Definition: windows/string.cpp:30
omw::windows::wstr_to_utf8
size_t wstr_to_utf8(LPCWCH src, char *dest, size_t destSize)
Converts a Windows API compatible wide string to an UTF-8 string.
Definition: windows/string.cpp:109
omw
Main namespace.
omw::windows::ErrorCode
Definition: error.h:38