@@ -18,10 +18,10 @@ Document::Document(const FileType file_type, const DocumentType document_type,
1818 std::shared_ptr<abstract::ReadableFilesystem> filesystem)
1919 : common::TemplateDocument<Element>(file_type, document_type,
2020 std::move (filesystem)) {
21- m_content_xml = util::xml::parse (*m_filesystem, common::Path (" content.xml" ));
21+ m_content_xml = util::xml::parse (*m_filesystem, common::Path (" / content.xml" ));
2222
23- if (m_filesystem->exists (common::Path (" styles.xml" ))) {
24- m_styles_xml = util::xml::parse (*m_filesystem, common::Path (" styles.xml" ));
23+ if (m_filesystem->exists (common::Path (" / styles.xml" ))) {
24+ m_styles_xml = util::xml::parse (*m_filesystem, common::Path (" / styles.xml" ));
2525 }
2626
2727 m_root_element = parse_tree (
@@ -43,33 +43,33 @@ void Document::save(const common::Path &path) const {
4343 zip::ZipArchive archive;
4444
4545 // `mimetype` has to be the first file and uncompressed
46- if (m_filesystem->is_file (common::Path (" mimetype" ))) {
47- archive.insert_file (std::end (archive), common::Path (" mimetype" ),
48- m_filesystem->open (common::Path (" mimetype" )), 0 );
46+ if (m_filesystem->is_file (common::Path (" / mimetype" ))) {
47+ archive.insert_file (std::end (archive), common::Path (" / mimetype" ),
48+ m_filesystem->open (common::Path (" / mimetype" )), 0 );
4949 }
5050
51- for (auto walker = m_filesystem->file_walker (common::Path (" " ));
51+ for (auto walker = m_filesystem->file_walker (common::Path (" / " ));
5252 !walker->end (); walker->next ()) {
5353 auto p = walker->path ();
54- if (p == common::Path (" mimetype" )) {
54+ if (p == common::Path (" / mimetype" )) {
5555 continue ;
5656 }
5757 if (m_filesystem->is_directory (p)) {
5858 archive.insert_directory (std::end (archive), p);
5959 continue ;
6060 }
61- if (p == common::Path (" content.xml" )) {
61+ if (p == common::Path (" / content.xml" )) {
6262 // TODO stream
6363 std::stringstream out;
6464 m_content_xml.print (out, " " , pugi::format_raw);
6565 auto tmp = std::make_shared<common::MemoryFile>(out.str ());
6666 archive.insert_file (std::end (archive), p, tmp);
6767 continue ;
6868 }
69- if (p == common::Path (" META-INF/manifest.xml" )) {
69+ if (p == common::Path (" / META-INF/manifest.xml" )) {
7070 // TODO
7171 auto manifest = util::xml::parse (*m_filesystem,
72- common::Path (" META-INF/manifest.xml" ));
72+ common::Path (" / META-INF/manifest.xml" ));
7373
7474 for (auto &&node : manifest.select_nodes (" //manifest:encryption-data" )) {
7575 node.node ().parent ().remove_child (node.node ());
0 commit comments