diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-07-05 17:51:21 +0200 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-07-05 17:51:21 +0200 |
| commit | 06336eaddcc6a8f9cc578d8f059117c3aa535c9f (patch) | |
| tree | 4884cc68161df06112a49a04007fa6d03775d507 /binparse/output.cpp | |
| parent | b80a82fcc9edc73057796005cede4eea8380e193 (diff) | |
| download | openwar-06336eaddcc6a8f9cc578d8f059117c3aa535c9f.tar.gz openwar-06336eaddcc6a8f9cc578d8f059117c3aa535c9f.tar.bz2 openwar-06336eaddcc6a8f9cc578d8f059117c3aa535c9f.zip | |
Made the interface somewhat more consistant.
Diffstat (limited to 'binparse/output.cpp')
| -rw-r--r-- | binparse/output.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/binparse/output.cpp b/binparse/output.cpp index 16447a7..de9db29 100644 --- a/binparse/output.cpp +++ b/binparse/output.cpp @@ -35,6 +35,13 @@ std::ostream& operator<<(std::ostream& os, Offset16 o) { return os << std::hex << std::setw(sizeof(o) * 2) << std::setfill('0') << static_cast<uint16_t>(o); } +std::ostream&operator<<(std::ostream& os, Value24 v) +{ + std::array<uint8_t, 3> va = v; + uint32_t tv = (va[2] << 16 | va[1] << 8 | va[0] << 0); + return os << std::dec << tv; +} + std::ostream& operator<<(std::ostream& os, Value32 v) { return os << std::dec << static_cast<uint32_t>(v); } @@ -63,4 +70,5 @@ std::ostream&operator<<(std::ostream& os, std::vector<uint8_t> vec) return os; } + } |
