MCPcopy Create free account
hub / github.com/TheRealMJP/Shadows / SerializeWriteString

Function SerializeWriteString

Shadows/SampleFramework11/Serialization.h:36–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36template<typename T> void SerializeWriteString(HANDLE fileHandle, const std::basic_string<T>& str)
37{
38 DWORD bytesWritten = 0;
39 uint32 numChars = static_cast<uint32>(str.length());
40 uint32 strSize = numChars * sizeof(T);
41 Win32Call(WriteFile(fileHandle, &numChars, sizeof(uint32), &bytesWritten, NULL));
42 if(numChars > 0)
43 Win32Call(WriteFile(fileHandle, str.c_str(), strSize, &bytesWritten, NULL));
44
45}
46
47template<typename T> void SerializeRead(HANDLE fileHandle, T& val)
48{

Callers 1

WriteToFileMethod · 0.85

Calls 1

Win32CallFunction · 0.85

Tested by

no test coverage detected