OMW  0.1.0
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 OMW_WINDOWS_STRING_H
8 #define 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  {
24  size_t utf8_to_wstr(const std::string& src, LPWSTR dest, size_t destSize);
25  size_t utf8_to_wstr(const std::string& src, LPWSTR dest, size_t destSize, omw::windows::ErrorCode& ec);
26  size_t wstr_to_utf8(LPCWCH src, char* dest, size_t destSize);
27  size_t wstr_to_utf8(LPCWCH src, char* dest, size_t destSize, omw::windows::ErrorCode& ec);
28  void wstr_to_utf8(LPCWCH src, std::string& dest);
29  void wstr_to_utf8(LPCWCH src, std::string& dest, omw::windows::ErrorCode& ec);
30  }
31 }
32 
33 #endif // OMW_PLAT_WIN
34 #endif // OMW_WINDOWS_STRING_H
std::string
C++ standard string. See std::basic_string for further detail.
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