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

Function to_wpath

OgreMain/src/OgreFileSystem.cpp:114–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 //-----------------------------------------------------------------------
113#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WINRT
114 std::wstring to_wpath( const String &text, unsigned codepage = CP_UTF8 )
115 {
116 const int utf16Length =
117 ::MultiByteToWideChar( codepage, 0, text.c_str(), (int)text.size(), NULL, 0 );
118 if( utf16Length > 0 )
119 {
120 std::wstring wt;
121 wt.resize( utf16Length );
122 if( 0 != ::MultiByteToWideChar( codepage, 0, text.c_str(), (int)text.size(), &wt[0],
123 (int)wt.size() ) )
124 {
125 return wt;
126 }
127 }
128 return L"";
129 }
130 String from_wpath( const std::wstring &text, unsigned codepage = CP_UTF8 )
131 {
132 const int length =

Callers 7

fileSystemPathFromStringFunction · 0.85
findFilesMethod · 0.85
openMethod · 0.85
createMethod · 0.85
removeMethod · 0.85
existsMethod · 0.85
getModifiedTimeMethod · 0.85

Calls 3

c_strMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected