MCPcopy Create free account
hub / github.com/OGRECave/ogre / to_wpath

Function to_wpath

OgreMain/src/OgreFileSystem.cpp:168–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 //-----------------------------------------------------------------------
167#ifdef _OGRE_FILESYSTEM_ARCHIVE_UNICODE
168 static std::wstring to_wpath(const String& text, unsigned codepage = CP_UTF8)
169 {
170 const int utf16Length = ::MultiByteToWideChar(codepage, 0, text.c_str(), (int)text.size(), NULL, 0);
171 if(utf16Length > 0)
172 {
173 std::wstring wt;
174 wt.resize(utf16Length);
175 if(0 != ::MultiByteToWideChar(codepage, 0, text.c_str(), (int)text.size(), &wt[0], (int)wt.size()))
176 return wt;
177 }
178 return L"";
179 }
180 static String from_wpath(const std::wstring& text, unsigned codepage = CP_UTF8)
181 {
182 const int length = ::WideCharToMultiByte(codepage, 0, text.c_str(), (int)text.size(), NULL, 0, NULL, NULL);

Callers 6

findFilesMethod · 0.85
_openFileStreamFunction · 0.85
createMethod · 0.85
removeMethod · 0.85
existsMethod · 0.85
getModifiedTimeMethod · 0.85

Calls 2

sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected