| 34 | } |
| 35 | |
| 36 | template<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 | |
| 47 | template<typename T> void SerializeRead(HANDLE fileHandle, T& val) |
| 48 | { |
no test coverage detected