summaryrefslogtreecommitdiff
path: root/le/le_resident_name_table.cpp
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-07-05 17:51:21 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-07-05 17:51:21 +0200
commit06336eaddcc6a8f9cc578d8f059117c3aa535c9f (patch)
tree4884cc68161df06112a49a04007fa6d03775d507 /le/le_resident_name_table.cpp
parentb80a82fcc9edc73057796005cede4eea8380e193 (diff)
downloadopenwar-06336eaddcc6a8f9cc578d8f059117c3aa535c9f.tar.gz
openwar-06336eaddcc6a8f9cc578d8f059117c3aa535c9f.tar.bz2
openwar-06336eaddcc6a8f9cc578d8f059117c3aa535c9f.zip
Made the interface somewhat more consistant.
Diffstat (limited to 'le/le_resident_name_table.cpp')
-rw-r--r--le/le_resident_name_table.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/le/le_resident_name_table.cpp b/le/le_resident_name_table.cpp
index bc34999..4633431 100644
--- a/le/le_resident_name_table.cpp
+++ b/le/le_resident_name_table.cpp
@@ -1,9 +1,28 @@
#include "le_resident_name_table.hpp"
+#include "parse.hpp"
#include "output.hpp"
+#include <boost/fusion/adapted/struct.hpp>
+
+BOOST_FUSION_ADAPT_STRUCT(
+ le::ResidentNameTable::Entry,
+ (binparse::PString8, string)
+ (binparse::Value16, index)
+)
+
namespace le {
+ResidentNameTable::Entry parse_resident_name_table_entry(std::istream& is)
+{
+ return binparse::parse<ResidentNameTable::Entry>(is);
+}
+
+std::ostream&operator<<(std::ostream& os, ResidentNameTable::Entry const& entry)
+{
+ return binparse::operator<<(os, entry);
+}
+
ResidentNameTable parse_resident_name_table(std::istream& is, binparse::Offset32 offset)
{
is.seekg(0, std::ios::beg);