top | up | prev | next

MemoryWriter Class

Definition at line 14 of MemoryWriter.hpp

Constructors

MemoryWriter(uint8_t* ptr_, int64_t count_)

Member Functions

void Write(const DateTime& dt)
void Write(int16_t x)
void Write(int32_t x)
void Write(int64_t x)
void Write(int8_t x)
void Write(uint16_t x)
void Write(uint32_t x)
void Write(uint64_t x)
void Write(uint8_t x)

Member Variables

int64_t count
uint8_t* pos
uint8_t* ptr

Constructor Details

MemoryWriter Constructor

soulng::util::MemoryWriter::MemoryWriter(uint8_t* ptr_, int64_t count_)

Definition at line 11 of MemoryWriter.cpp :
11 : ptr(ptr_)pos(ptr)count(count_)
12 {
13 }


Declaration at line 17 of MemoryWriter.hpp


Member Function Details

Write Member Function

void soulng::util::MemoryWriter::Write(const DateTime & dt)

Definition at line 84 of MemoryWriter.cpp :
85 {
86     Date date = dt.GetDate();
87     Write(date.Year());
88     Write(static_cast<int8_t>(date.GetMonth()));
89     Write(date.Day());
90     Write(dt.Seconds());
91 }


Declaration at line 26 of MemoryWriter.hpp

Calls: soulng::util::Date::Day , soulng::util::Date::GetMonth , soulng::util::Date::Year , soulng::util::DateTime::GetDate , soulng::util::DateTime::Seconds , soulng::util::MemoryWriter::Write , soulng::util::MemoryWriter::Write , soulng::util::MemoryWriter::Write


Write Member Function

void soulng::util::MemoryWriter::Write(int16_t x)

Definition at line 37 of MemoryWriter.cpp :
38 {
39     Write(static_cast<uint16_t>(x));
40 }


Declaration at line 21 of MemoryWriter.hpp

Called by: soulng::util::MemoryWriter::Write


Write Member Function

void soulng::util::MemoryWriter::Write(int32_t x)

Definition at line 54 of MemoryWriter.cpp :
55 {
56     Write(static_cast<uint32_t>(x));
57 }


Declaration at line 23 of MemoryWriter.hpp

Called by: soulng::util::MemoryWriter::Write


Write Member Function

void soulng::util::MemoryWriter::Write(int64_t x)

Definition at line 79 of MemoryWriter.cpp :
80 {
81     Write(static_cast<uint64_t>(x));
82 }


Declaration at line 25 of MemoryWriter.hpp


Write Member Function

void soulng::util::MemoryWriter::Write(int8_t x)

Definition at line 24 of MemoryWriter.cpp :
25 {
26     Write(static_cast<uint8_t>(x));
27 }


Declaration at line 19 of MemoryWriter.hpp

Called by: soulng::util::MemoryWriter::Write


Write Member Function

void soulng::util::MemoryWriter::Write(uint16_t x)

Definition at line 29 of MemoryWriter.cpp :
30 {
31     uint8_t b0 = static_cast<uint8_t>(x >> 8u);
32     uint8_t b1 = static_cast<uint8_t>(x);
33     Write(b0);
34     Write(b1);
35 }


Declaration at line 20 of MemoryWriter.hpp

Calls: soulng::util::MemoryWriter::Write


Write Member Function

void soulng::util::MemoryWriter::Write(uint32_t x)

Definition at line 42 of MemoryWriter.cpp :
43 {
44     uint8_t b0 = static_cast<uint8_t>(x >> 24u);
45     uint8_t b1 = static_cast<uint8_t>(x >> 16u);
46     uint8_t b2 = static_cast<uint8_t>(x >> 8u);
47     uint8_t b3 = static_cast<uint8_t>(x);
48     Write(b0);
49     Write(b1);
50     Write(b2);
51     Write(b3);
52 }


Declaration at line 22 of MemoryWriter.hpp

Calls: soulng::util::MemoryWriter::Write


Write Member Function

void soulng::util::MemoryWriter::Write(uint64_t x)

Definition at line 59 of MemoryWriter.cpp
Declaration at line 24 of MemoryWriter.hpp

Calls: soulng::util::MemoryWriter::Write


Write Member Function

void soulng::util::MemoryWriter::Write(uint8_t x)

Definition at line 15 of MemoryWriter.cpp :
16 {
17     if (pos - ptr >= count)
18     {
19         throw std::runtime_error("memory writer: end of space");
20     }
21     *pos++ = x;
22 }


Declaration at line 18 of MemoryWriter.hpp

Called by: soulng::util::MemoryWriter::Write , soulng::util::MemoryWriter::Write , soulng::util::MemoryWriter::Write


top | up | prev | next