All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BinarySerialization.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include <ostream>
7 
8 namespace Eegeo
9 {
10  namespace Io
11  {
12  namespace BinarySerialization
13  {
14  template <class T>
15  size_t Write(const T& value, std::ostream& writer)
16  {
17  writer.write(reinterpret_cast<const char*>(&value), sizeof(T));
18  return sizeof(T);
19  }
20 
21  void WriteFourCC(const std::string& s, std::ostream& writer);
22  size_t WriteShortString(const std::string& s, std::ostream& writer);
23  void WriteTimeT_u32(time_t v, std::ostream& writer);
24  void WriteSizeT_u32(size_t v, std::ostream& writer);
25  }
26  }
27 }