mirror of https://github.com/kiwix/libkiwix.git
+ content mgmt last imp. : we have now something working as good as before but with C++ code
This commit is contained in:
parent
e05dd65111
commit
526aec41d5
|
@ -68,10 +68,10 @@ namespace kiwix {
|
||||||
library.addBook(book);
|
library.addBook(book);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!readOnly)
|
if (!readOnly) {
|
||||||
this->writableLibraryPath = path;
|
this->writableLibraryPath = path;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -235,6 +235,19 @@ namespace kiwix {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Manager::setBookIndex(const string id, const string path, const supportedIndexType type) {
|
||||||
|
std::vector<kiwix::Book>::iterator itr;
|
||||||
|
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||||
|
if ( itr->id == id) {
|
||||||
|
itr->indexPath = path;
|
||||||
|
itr->indexType = type;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool Manager::listBooks(const supportedListMode mode) {
|
bool Manager::listBooks(const supportedListMode mode) {
|
||||||
this->bookIdList.clear();
|
this->bookIdList.clear();
|
||||||
std::vector<kiwix::Book>::iterator itr;
|
std::vector<kiwix::Book>::iterator itr;
|
||||||
|
|
|
@ -44,6 +44,7 @@ namespace kiwix {
|
||||||
bool removeBookByIndex(const unsigned int bookIndex);
|
bool removeBookByIndex(const unsigned int bookIndex);
|
||||||
bool removeBookById(const string id);
|
bool removeBookById(const string id);
|
||||||
bool setCurrentBookId(const string id);
|
bool setCurrentBookId(const string id);
|
||||||
|
bool setBookIndex(const string id, const string path, const supportedIndexType type);
|
||||||
string getCurrentBookId();
|
string getCurrentBookId();
|
||||||
bool addBookFromPath(const string path, const string url = "");
|
bool addBookFromPath(const string path, const string url = "");
|
||||||
Library cloneLibrary();
|
Library cloneLibrary();
|
||||||
|
|
Loading…
Reference in New Issue