summaryrefslogtreecommitdiff
path: root/mz
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-06-19 22:05:32 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-06-19 22:05:32 +0200
commitde95ca22ec87cc8b79ceb7beba475301461713a6 (patch)
treedce723a717ac0ba583de992777d7d968c3be870b /mz
parentcea325b7451c1fb8dd22462ec2e7b5b88ea9b547 (diff)
downloadopenwar-de95ca22ec87cc8b79ceb7beba475301461713a6.tar.gz
openwar-de95ca22ec87cc8b79ceb7beba475301461713a6.tar.bz2
openwar-de95ca22ec87cc8b79ceb7beba475301461713a6.zip
adds an LE file parser and refactors some code.
Diffstat (limited to 'mz')
-rw-r--r--mz/mz_header.cpp6
-rw-r--r--mz/mz_header.hpp2
-rw-r--r--mz/mz_header_parser.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/mz/mz_header.cpp b/mz/mz_header.cpp
index 323c9cd..02241cf 100644
--- a/mz/mz_header.cpp
+++ b/mz/mz_header.cpp
@@ -36,17 +36,17 @@ NotAMZFileException::NotAMZFileException()
{}
template <int... Indices>
-MZHeader parse_file_impl(std::istream& is, indices<Indices...>) {
+MZHeader parse_header_impl(std::istream& is, indices<Indices...>) {
return {parse<typename std::decay<typename boost::fusion::result_of::at_c<MZHeader, Indices>::type>::type>(is, boost::fusion::extension::struct_member_name<MZHeader, Indices>::call())...};
}
-MZHeader parse_file(std::istream& is) {
+MZHeader parse_header(std::istream& is) {
typedef build_indices<boost::fusion::result_of::size<MZHeader>::value>::type indices;
- return parse_file_impl(is, indices{});
+ return parse_header_impl(is, indices{});
}
std::ostream& output_impl(std::ostream& os, MZHeader const&, indices<>) {
diff --git a/mz/mz_header.hpp b/mz/mz_header.hpp
index fd42b43..9bef928 100644
--- a/mz/mz_header.hpp
+++ b/mz/mz_header.hpp
@@ -39,7 +39,7 @@ struct MZHeader {
Value16 overlay_number;
};
-MZHeader parse_file(std::istream& is);
+MZHeader parse_header(std::istream& is);
std::ostream& operator<<(std::ostream& os, MZHeader const& header);
diff --git a/mz/mz_header_parser.cpp b/mz/mz_header_parser.cpp
index 66718d1..6010331 100644
--- a/mz/mz_header_parser.cpp
+++ b/mz/mz_header_parser.cpp
@@ -49,7 +49,7 @@ int main(int argc, char* argv[]) {
}
std::ifstream file(file_path.string());
- auto x = mz::parse_file(file);
+ auto x = mz::parse_header(file);
std::cout << x << std::endl;
return 0;