1
2
3
4
5
6 #ifndef SOULNG_UTIL_MEMORY_WRITER_INCLUDED
7 #define SOULNG_UTIL_MEMORY_WRITER_INCLUDED
8 #include <soulng/util/Time.hpp>
9 #include <soulng/util/UtilApi.hpp>
10 #include <stdint.h>
11
12 namespace soulng { namespace util {
13
14 class MemoryWriter
15 {
16 public:
17 MemoryWriter(uint8_t* ptr_, int64_t count_);
18 void Write(uint8_t x);
19 void Write(int8_t x);
20 void Write(uint16_t x);
21 void Write(int16_t x);
22 void Write(uint32_t x);
23 void Write(int32_t x);
24 void Write(uint64_t x);
25 void Write(int64_t x);
26 void Write(const DateTime& dt);
27 private:
28 uint8_t* ptr;
29 uint8_t* pos;
30 int64_t count;
31 };
32
33 } }
34
35 #endif // SOULNG_UTIL_MEMORY_WRITER_INCLUDED