Updated Kiwix::Manager class to accept origID as the last optional parameter, so as not to break existing tools which use Kiwix::Manager

This commit is contained in:
Kiran Mathew Koshy 2013-09-20 02:52:29 +05:30
parent c22b5a1d4c
commit 2f89926616
2 changed files with 7 additions and 7 deletions

View File

@ -225,7 +225,7 @@ namespace kiwix {
/* Add a book to the library. Return empty string if failed, book id otherwise */ /* Add a book to the library. Return empty string if failed, book id otherwise */
string Manager::addBookFromPathAndGetId(const string pathToOpen, const string pathToSave, string Manager::addBookFromPathAndGetId(const string pathToOpen, const string pathToSave,
const string url, const string origId, const bool checkMetaData) { const string url, const bool checkMetaData, const string origId) {
kiwix::Book book; kiwix::Book book;
if (this->readBookFromPath(pathToOpen, &book)) { if (this->readBookFromPath(pathToOpen, &book)) {
@ -249,8 +249,8 @@ namespace kiwix {
} }
/* Wrapper over Manager::addBookFromPath which return a bool instead of a string */ /* Wrapper over Manager::addBookFromPath which return a bool instead of a string */
bool Manager::addBookFromPath(const string pathToOpen, const string pathToSave, const string url, const string origId, const bool checkMetaData) { bool Manager::addBookFromPath(const string pathToOpen, const string pathToSave, const string url, const bool checkMetaData, const string origId) {
return !(this->addBookFromPathAndGetId(pathToOpen, pathToSave, url, origId, checkMetaData).empty()); return !(this->addBookFromPathAndGetId(pathToOpen, pathToSave, url, checkMetaData, origId).empty());
} }
bool Manager::readBookFromPath(const string path, kiwix::Book *book) { bool Manager::readBookFromPath(const string path, kiwix::Book *book) {

View File

@ -55,10 +55,10 @@ namespace kiwix {
string getCurrentBookId(); string getCurrentBookId();
bool setBookIndex(const string id, const string path, const supportedIndexType type); bool setBookIndex(const string id, const string path, const supportedIndexType type);
bool setBookPath(const string id, const string path); bool setBookPath(const string id, const string path);
string addBookFromPathAndGetId(const string pathToOpen, const string pathToSave = "", const string url = "", const string origID="", string addBookFromPathAndGetId(const string pathToOpen, const string pathToSave = "", const string url = "",
const bool checkMetaData = false); const bool checkMetaData = false, const string origID="");
bool addBookFromPath(const string pathToOpen, const string pathToSave = "", const string url = "", const string origID="", bool addBookFromPath(const string pathToOpen, const string pathToSave = "", const string url = "",
const bool checkMetaData = false); const bool checkMetaData = false, const string origID="");
Library cloneLibrary(); Library cloneLibrary();
bool getBookById(const string id, Book &book); bool getBookById(const string id, Book &book);
bool getCurrentBook(Book &book); bool getCurrentBook(Book &book);