Ensure the correct order of files and the TOC.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b53e99306c
commit
d0738891c2
@ -58,7 +58,7 @@ book read(const fs::path filepath, const bool raw)
|
|||||||
{
|
{
|
||||||
doc.text_raw = zip::read_file(filepath, entry);
|
doc.text_raw = zip::read_file(filepath, entry);
|
||||||
}
|
}
|
||||||
current_book.files.insert({entry, doc});
|
current_book.files.emplace_back(entry, doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return current_book;
|
return current_book;
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace epubgrep::book
|
namespace epubgrep::book
|
||||||
{
|
{
|
||||||
@ -41,9 +43,9 @@ struct document
|
|||||||
//! EPUB file.
|
//! EPUB file.
|
||||||
struct book
|
struct book
|
||||||
{
|
{
|
||||||
std::map<string, document> files; //!< filename, file
|
std::vector<std::pair<string, document>> files; //!< filename, file
|
||||||
std::map<string, string> toc; //!< title, href
|
std::vector<std::pair<string, string>> toc; //!< title, href
|
||||||
string language; //!< Book language
|
string language; //!< Book language
|
||||||
} __attribute__((aligned(128)));
|
} __attribute__((aligned(128)));
|
||||||
|
|
||||||
//! Read and process book.
|
//! Read and process book.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user