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 /le/le_entry_table_entry.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 'le/le_entry_table_entry.cpp')
| -rw-r--r-- | le/le_entry_table_entry.cpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/le/le_entry_table_entry.cpp b/le/le_entry_table_entry.cpp deleted file mode 100644 index 4894ec0..0000000 --- a/le/le_entry_table_entry.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "le_entry_table_entry.hpp" - -#include "parse.hpp" -#include "output.hpp" - -#include <boost/fusion/adapted/struct.hpp> - -typedef boost::variant<binparse::Offset16, binparse::Offset32> EntryT; - -BOOST_FUSION_ADAPT_STRUCT( - le::EntryPoint, - (binparse::Value8, flags) - (EntryT, entry) -) - -BOOST_FUSION_ADAPT_STRUCT( - le::EntryTableEntry, - (binparse::Value8, nr_entries) - (binparse::Value8, flags) - (binparse::Value16, object_index) - (std::vector<le::EntryPoint>, entries) -) - -namespace le { - -EntryTableEntry parse_entry_table_entry(std::istream& is) { - EntryTableEntry entry; - - entry.nr_entries = binparse::parse<binparse::Value8>(is, "nr_entries"); - entry.flags = binparse::parse<binparse::Value8>(is, "flags"); - entry.object_index = binparse::parse<binparse::Value16>(is, "object_index"); - - for(Value8 i = Value8(0); i < entry.nr_entries; i++) { - if(entry.flags & 2) { - entry.entries.push_back({ - binparse::parse<Value8>(is, "flags"), - binparse::parse<Offset32>(is, "entry") - }); - } else { - entry.entries.push_back({ - binparse::parse<Value8>(is, "flags"), - binparse::parse<Offset16>(is, "entry") - }); - } - } - - return entry; -} - -std::ostream&operator<<(std::ostream& os, const EntryTableEntry& entry) -{ - return binparse::operator<<(os, entry); -} - -}
\ No newline at end of file |
