summaryrefslogtreecommitdiff
path: root/le/le_entry_table.cpp
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-06-23 18:07:42 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-06-23 18:07:42 +0200
commita7bcede17b4c10e172c7877fc2ce89862dc454af (patch)
treed89b8ff274d18d67d695c5f320a1d079e1bb26b6 /le/le_entry_table.cpp
parent0f2d7c9ed9dfa3716840fc112bd53e5ec6b6315b (diff)
downloadopenwar-a7bcede17b4c10e172c7877fc2ce89862dc454af.tar.gz
openwar-a7bcede17b4c10e172c7877fc2ce89862dc454af.tar.bz2
openwar-a7bcede17b4c10e172c7877fc2ce89862dc454af.zip
adds alot more binary parsing.
Diffstat (limited to 'le/le_entry_table.cpp')
-rw-r--r--le/le_entry_table.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/le/le_entry_table.cpp b/le/le_entry_table.cpp
new file mode 100644
index 0000000..28f901d
--- /dev/null
+++ b/le/le_entry_table.cpp
@@ -0,0 +1,27 @@
+#include "le_entry_table.hpp"
+
+#include "output.hpp"
+
+namespace le {
+
+EntryTable parse_entry_table(std::istream& is, binparse::Offset32 offset)
+{
+ is.seekg(0, std::ios::beg);
+ is.ignore(offset);
+
+ EntryTable table;
+
+ uint32_t i = 1;
+ while(is.peek()) {
+ table.entries.emplace(i++, parse_entry_table_entry(is));
+ }
+
+ return table;
+}
+
+std::ostream&operator<<(std::ostream& os, const EntryTable& table)
+{
+ return binparse::operator<<(os, table.entries);
+}
+
+} \ No newline at end of file