MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / string2wstring

Method string2wstring

cpp/5_Domain_Specific/simpleD3D12/DX12CudaSample.cpp:72–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70DX12CudaSample::~DX12CudaSample() {}
71
72std::wstring DX12CudaSample::string2wstring(const std::string &s)
73{
74 int len;
75 int slength = (int)s.length() + 1;
76 len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0);
77 wchar_t *buf = new wchar_t[len];
78 MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf, len);
79 std::wstring r(buf);
80 delete[] buf;
81 return r;
82}
83// Helper function for resolving the full path of assets.
84std::wstring DX12CudaSample::GetAssetFullPath(const char *assetName)
85{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected