+ new getCurrentBook() method

This commit is contained in:
kelson42 2012-01-24 12:45:22 +00:00
parent 19c355241c
commit 1fb5194906
2 changed files with 11 additions and 0 deletions

View File

@ -340,6 +340,16 @@ namespace kiwix {
return this->library;
}
bool Manager::getCurrentBook(Book &book) {
string currentBookId = getCurrentBookId();
if (currentBookId.empty()) {
return false;
} else {
getBookById(currentBookId, book);
return true;
}
}
bool Manager::getBookById(const string id, Book &book) {
std::vector<kiwix::Book>::iterator itr;
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {

View File

@ -60,6 +60,7 @@ namespace kiwix {
const bool checkMetaData = false);
Library cloneLibrary();
bool getBookById(const string id, Book &book);
bool getCurrentBook(Book &book);
unsigned int getBookCount(const bool localBooks, const bool remoteBooks);
bool updateBookLastOpenDateById(const string id);
void removeBookPaths();