diff options
author | Chris Wilson <chris+github@qwirx.com> | 2009-11-11 19:22:52 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2009-11-11 19:22:52 +0000 |
commit | 561da2cf4ec18a0208811fe505901a03c6c09d90 (patch) | |
tree | f408585cf99fa7ebbc9864cd90191fa6237cf84d /lib/common/Archive.h | |
parent | f27e1a11c35ceeccdc9399fdf2ec8eb03df1b36e (diff) |
Add methods to read and write exact 32-bit and 64-bit types.
Diffstat (limited to 'lib/common/Archive.h')
-rw-r--r-- | lib/common/Archive.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/common/Archive.h b/lib/common/Archive.h index b70f12c4..f2e5bd83 100644 --- a/lib/common/Archive.h +++ b/lib/common/Archive.h @@ -45,6 +45,7 @@ public: { Write((int) Item); } + void WriteExact(uint32_t Item) { Write((int)Item); } void Write(int Item) { int32_t privItem = htonl(Item); @@ -55,6 +56,7 @@ public: int64_t privItem = box_hton64(Item); mrStream.Write(&privItem, sizeof(privItem)); } + void WriteExact(uint64_t Item) { Write(Item); } void Write(uint64_t Item) { uint64_t privItem = box_hton64(Item); @@ -88,6 +90,7 @@ public: rItemOut = false; } } + void ReadExact(uint32_t &rItemOut) { Read((int&)rItemOut); } void Read(int &rItemOut) { int32_t privItem; @@ -106,6 +109,7 @@ public: } rItemOut = box_ntoh64(privItem); } + void ReadExact(uint64_t &rItemOut) { Read(rItemOut); } void Read(uint64_t &rItemOut) { uint64_t privItem; |