mirror of https://github.com/kiwix/libkiwix.git
parent
3c3cf08a1a
commit
b259afa408
|
@ -233,12 +233,19 @@ class Library
|
||||||
unsigned int getBookCount(const bool localBooks, const bool remoteBooks) const;
|
unsigned int getBookCount(const bool localBooks, const bool remoteBooks) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all langagues of the books in the library.
|
* Get all languagues of the books in the library.
|
||||||
*
|
*
|
||||||
* @return A list of languages.
|
* @return A list of languages.
|
||||||
*/
|
*/
|
||||||
std::vector<std::string> getBooksLanguages() const;
|
std::vector<std::string> getBooksLanguages() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all categories of the books in the library.
|
||||||
|
*
|
||||||
|
* @return A list of categories.
|
||||||
|
*/
|
||||||
|
std::vector<std::string> getBooksCategories() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all book creators of the books in the library.
|
* Get all book creators of the books in the library.
|
||||||
*
|
*
|
||||||
|
|
|
@ -201,6 +201,21 @@ std::vector<std::string> Library::getBooksLanguages() const
|
||||||
return booksLanguages;
|
return booksLanguages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> Library::getBooksCategories() const
|
||||||
|
{
|
||||||
|
std::set<std::string> categories;
|
||||||
|
|
||||||
|
for (const auto& pair: m_books) {
|
||||||
|
const auto& book = pair.second;
|
||||||
|
const auto& c = book.getCategory();
|
||||||
|
if ( !c.empty() ) {
|
||||||
|
categories.insert(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::vector<std::string>(categories.begin(), categories.end());
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> Library::getBooksCreators() const
|
std::vector<std::string> Library::getBooksCreators() const
|
||||||
{
|
{
|
||||||
std::vector<std::string> booksCreators;
|
std::vector<std::string> booksCreators;
|
||||||
|
|
Loading…
Reference in New Issue