Do not make the Manager responsible to create the Library.

The `Manager` manage a library already existing.
This avoid the Library clone stuff.
This commit is contained in:
Matthieu Gautier
2018-09-03 15:40:51 +02:00
parent bba3c252e4
commit efae3e0d2f
4 changed files with 17 additions and 13 deletions

View File

@ -48,7 +48,7 @@ enum supportedListSortBy { TITLE, SIZE, DATE, CREATOR, PUBLISHER };
class Manager
{
public:
Manager();
Manager(Library* library);
~Manager();
/**
@ -214,7 +214,7 @@ class Manager
vector<std::string> bookIdList;
protected:
kiwix::Library library;
kiwix::Library* library;
bool readBookFromPath(const string path, Book* book = NULL);
bool parseXmlDom(const pugi::xml_document& doc,

View File

@ -45,7 +45,7 @@ class OPDSDumper
{
public:
OPDSDumper() = default;
OPDSDumper(Library library);
OPDSDumper(Library* library);
~OPDSDumper();
/**
@ -89,10 +89,10 @@ class OPDSDumper
*
* @param library The library to dump.
*/
void setLibrary(Library library) { this->library = library; }
void setLibrary(Library* library) { this->library = library; }
protected:
kiwix::Library library;
kiwix::Library* library;
std::string id;
std::string title;
std::string date;