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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!readOnly)
|
||||
this->writableLibraryPath = path;
|
||||
|
||||
if (!readOnly) {
|
||||
this->writableLibraryPath = path;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -235,6 +235,19 @@ namespace kiwix {
|
|||
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) {
|
||||
this->bookIdList.clear();
|
||||
std::vector<kiwix::Book>::iterator itr;
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace kiwix {
|
|||
bool removeBookByIndex(const unsigned int bookIndex);
|
||||
bool removeBookById(const string id);
|
||||
bool setCurrentBookId(const string id);
|
||||
bool setBookIndex(const string id, const string path, const supportedIndexType type);
|
||||
string getCurrentBookId();
|
||||
bool addBookFromPath(const string path, const string url = "");
|
||||
Library cloneLibrary();
|
||||
|
|
Loading…
Reference in New Issue