diff --git a/xml_converter/src/attribute/image.cpp b/xml_converter/src/attribute/image.cpp index ad136f66..8636db10 100644 --- a/xml_converter/src/attribute/image.cpp +++ b/xml_converter/src/attribute/image.cpp @@ -10,9 +10,13 @@ using namespace std; -Image::Image() :filepath("", "") {} +Image::Image() + : filepath("", "") { +} -Image::Image(std::string base, std::string relative_filepath) : filepath(base, relative_filepath) {} +Image::Image(std::string base, std::string relative_filepath) + : filepath(base, relative_filepath) { +} //////////////////////////////////////////////////////////////////////////////// // parse_image @@ -39,7 +43,6 @@ void image_to_xml_attribute( XMLWriterState* state, const Image* value, std::function setter) { - MarkerPackFile output_path = MarkerPackFile(state->marker_pack_root_directory, value->filepath.relative_filepath); copy_file(value->filepath, output_path); setter(value->filepath.relative_filepath); diff --git a/xml_converter/src/attribute/image.hpp b/xml_converter/src/attribute/image.hpp index 2d87a2a9..8db51ec2 100644 --- a/xml_converter/src/attribute/image.hpp +++ b/xml_converter/src/attribute/image.hpp @@ -4,13 +4,12 @@ #include #include +#include "../file_helper.hpp" #include "../rapidxml-1.13/rapidxml.hpp" #include "../state_structs/proto_reader_state.hpp" #include "../state_structs/proto_writer_state.hpp" #include "../state_structs/xml_reader_state.hpp" #include "../state_structs/xml_writer_state.hpp" -#include "../file_helper.hpp" - class XMLError; diff --git a/xml_converter/src/file_helper.cpp b/xml_converter/src/file_helper.cpp index 2fd3f9ea..728c03e1 100644 --- a/xml_converter/src/file_helper.cpp +++ b/xml_converter/src/file_helper.cpp @@ -18,7 +18,6 @@ using namespace std; - void copy_file(MarkerPackFile original_path, MarkerPackFile new_path) { if (original_path.tmp_get_path() == new_path.tmp_get_path()) { cerr << "File is being copied to itself" << original_path.tmp_get_path() << endl; @@ -36,8 +35,7 @@ void copy_file(MarkerPackFile original_path, MarkerPackFile new_path) { filesystem::copy_file( filesystem::path(original_path.tmp_get_path()), output_path, - filesystem::copy_options::overwrite_existing - ); + filesystem::copy_options::overwrite_existing); } // ZipFile to Directory else if (filesystem::is_regular_file(original_path.base) && filesystem::is_directory(new_path.base)) { @@ -52,7 +50,6 @@ void copy_file(MarkerPackFile original_path, MarkerPackFile new_path) { filesystem::create_directories(output_path.parent_path()); ofstream outfile(new_path.tmp_get_path(), ios::binary); outfile << original_file->rdbuf(); - } // Directory to ZipFile (Unsupported until writing to ZipFiles is implemnted) else if (filesystem::is_directory(original_path.base) && filesystem::is_regular_file(new_path.base)) {