MCPcopy Create free account
hub / github.com/csyonghe/Spire / ToWString

Method ToWString

Source/CoreLib/LibString.cpp:109–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107 }
108
109 const wchar_t * String::ToWString(int * len) const
110 {
111 if (!buffer)
112 {
113 if (len)
114 *len = 0;
115 return L"";
116 }
117 else
118 {
119 if (wcharBuffer)
120 {
121 if (len)
122 *len = (int)wcslen(wcharBuffer);
123 return wcharBuffer;
124 }
125 List<char> buf;
126 CoreLib::IO::Encoding::UTF16->GetBytes(buf, *this);
127 if (len)
128 *len = buf.Count() / sizeof(wchar_t);
129 buf.Add(0);
130 buf.Add(0);
131 const_cast<String*>(this)->wcharBuffer = (wchar_t*)buf.Buffer();
132 buf.ReleaseBuffer();
133 return wcharBuffer;
134 }
135 }
136
137 String String::PadLeft(char ch, int pLen)
138 {

Callers 11

runTestImplFunction · 0.80
runTestFunction · 0.80
wmainFunction · 0.80
ExistsMethod · 0.80
CreateDirMethod · 0.80
InitMethod · 0.80
PrintILShaderFunction · 0.80
PrintDiagnosticsMethod · 0.80
DebugPrintMethod · 0.80

Calls 5

ReleaseBufferMethod · 0.80
GetBytesMethod · 0.45
CountMethod · 0.45
AddMethod · 0.45
BufferMethod · 0.45

Tested by

no test coverage detected