mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Use a map to store the Library's books.
Having the books sorted is useless. We handle books by id not by index.
This commit is contained in:
@ -24,7 +24,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "common/regexTools.h"
|
||||
#include "common/stringTools.h"
|
||||
@ -88,7 +88,7 @@ class Book
|
||||
*/
|
||||
class Library
|
||||
{
|
||||
std::vector<kiwix::Book> books;
|
||||
std::map<std::string, kiwix::Book> books;
|
||||
public:
|
||||
Library();
|
||||
~Library();
|
||||
@ -108,7 +108,6 @@ class Library
|
||||
|
||||
Book& getBookById(const std::string& id);
|
||||
|
||||
bool removeBookByIndex(const unsigned int bookIndex);
|
||||
/**
|
||||
* Remove a book from the library.
|
||||
*
|
||||
|
@ -99,14 +99,6 @@ class Manager
|
||||
*/
|
||||
bool readOpds(const string& content, const std::string& urlHost);
|
||||
|
||||
/**
|
||||
* Remove a book from the library.
|
||||
*
|
||||
* @param bookIndex the index of the book to remove
|
||||
* @return True
|
||||
*/
|
||||
bool removeBookByIndex(const unsigned int bookIndex);
|
||||
|
||||
/**
|
||||
* Remove a book from the library.
|
||||
*
|
||||
|
Reference in New Issue
Block a user