| 54 | } |
| 55 | |
| 56 | wchar_t *convertCharArrayToLPCWSTR(const char *charArray) { |
| 57 | size_t length = std::mbstowcs(nullptr, charArray, 0); |
| 58 | if (length == static_cast<size_t>(-1)) { |
| 59 | wchar_t *fallback = new wchar_t[1]; |
| 60 | fallback[0] = L'\0'; |
| 61 | return fallback; |
| 62 | } |
| 63 | |
| 64 | wchar_t *wString = new wchar_t[length + 1]; |
| 65 | std::mbstowcs(wString, charArray, length + 1); |
| 66 | return wString; |
| 67 | } |
| 68 | |
| 69 | static bool fileExists(const std::string &path) { |
| 70 | std::ifstream file(path.c_str(), std::ios::binary); |
nothing calls this directly
no outgoing calls
no test coverage detected