diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-06-22 00:15:08 +0200 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-06-22 00:16:28 +0200 |
| commit | 22231518b9c2c0b7f73c72a6ca834df659c63c7f (patch) | |
| tree | 12b1d20efd3303583649966ddfe135a81ae8109b /le/le_object_table.cpp | |
| parent | 46145fe7d5b1d9f0921121a088a3d61f968cc473 (diff) | |
| download | openwar-22231518b9c2c0b7f73c72a6ca834df659c63c7f.tar.gz openwar-22231518b9c2c0b7f73c72a6ca834df659c63c7f.tar.bz2 openwar-22231518b9c2c0b7f73c72a6ca834df659c63c7f.zip | |
Reduces the amount of boilerplate neccesary to parse the binary format.
Diffstat (limited to 'le/le_object_table.cpp')
| -rw-r--r-- | le/le_object_table.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/le/le_object_table.cpp b/le/le_object_table.cpp new file mode 100644 index 0000000..1155c35 --- /dev/null +++ b/le/le_object_table.cpp @@ -0,0 +1,23 @@ +#include "le_object_table.hpp" + +namespace le { + +ObjectTable parse_object_table(std::istream& is, Offset32 offset, Value32 nr_objects) +{ + is.seekg(0, std::ios::beg); + is.ignore(offset); + + ObjectTable table; + + for(Value32 i = Value32(0); i < nr_objects; i++) { + table.entries.emplace(i+1, parse_object_table_entry(is)); + } + return table; +} + +std::ostream& operator<<(std::ostream& os, const ObjectTable& table) +{ + return os; +} + +}
\ No newline at end of file |
