Make the member of the book protected.

It is up to the book to manage its attribute.

Also remove the `absolutePath` (and `indexAbsolutePath`). The `Book::path` is always stored
absolute.
The fact that the path can be stored absolute or relative in the
`library.xml` is not relevant for the book.
This commit is contained in:
Matthieu Gautier
2018-09-03 15:35:22 +02:00
parent 57ac6f0305
commit bba3c252e4
4 changed files with 248 additions and 236 deletions

View File

@ -58,29 +58,72 @@ class Book
static bool sortByLanguage(const Book& a, const Book& b);
string getHumanReadableIdFromPath();
string id;
string path;
string pathAbsolute;
string last;
string indexPath;
string indexPathAbsolute;
supportedIndexType indexType;
string title;
string description;
string language;
string creator;
string publisher;
string date;
string url;
string name;
string tags;
string origId;
string articleCount;
string mediaCount;
bool readOnly;
string size;
string favicon;
string faviconMimeType;
bool readOnly() const { return m_readOnly; }
const string& id() const { return m_id; }
const string& path() const { return m_path; }
const string& last() const { return m_last; }
const string& indexPath() const { return m_indexPath; }
const supportedIndexType& indexType() const { return m_indexType; }
const string& title() const { return m_title; }
const string& description() const { return m_description; }
const string& language() const { return m_language; }
const string& creator() const { return m_creator; }
const string& publisher() const { return m_publisher; }
const string& date() const { return m_date; }
const string& url() const { return m_url; }
const string& name() const { return m_name; }
const string& tags() const { return m_tags; }
const string& origId() const { return m_origId; }
const uint64_t& articleCount() const { return m_articleCount; }
const uint64_t& mediaCount() const { return m_mediaCount; }
const uint64_t& size() const { return m_size; }
const string& favicon() const { return m_favicon; }
const string& faviconMimeType() const { return m_faviconMimeType; }
void setReadOnly(bool readOnly) { m_readOnly = readOnly; }
void setId(const std::string& id) { m_id = id; }
void setPath(const std::string& path);
void setLast(const std::string& last) { m_last = last; }
void setIndexPath(const std::string& indexPath);
void setIndexType(supportedIndexType indexType) { m_indexType = indexType;}
void setTitle(const std::string& title) { m_title = title; }
void setDescription(const std::string& description) { m_description = description; }
void setLanguage(const std::string& language) { m_language = language; }
void setCreator(const std::string& creator) { m_creator = creator; }
void setPublisher(const std::string& publisher) { m_publisher = publisher; }
void setDate(const std::string& date) { m_date = date; }
void setUrl(const std::string& url) { m_url = url; }
void setName(const std::string& name) { m_name = name; }
void setTags(const std::string& tags) { m_tags = tags; }
void setOrigId(const std::string& origId) { m_origId = origId; }
void setArticleCount(uint64_t articleCount) { m_articleCount = articleCount; }
void setMediaCount(uint64_t mediaCount) { m_mediaCount = mediaCount; }
void setSize(uint64_t size) { m_size = size; }
void setFavicon(const std::string& favicon) { m_favicon = favicon; }
void setFaviconMimeType(const std::string& faviconMimeType) { m_faviconMimeType = faviconMimeType; }
protected:
string m_id;
string m_path;
string m_last;
string m_indexPath;
supportedIndexType m_indexType;
string m_title;
string m_description;
string m_language;
string m_creator;
string m_publisher;
string m_date;
string m_url;
string m_name;
string m_tags;
string m_origId;
uint64_t m_articleCount;
uint64_t m_mediaCount;
bool m_readOnly;
uint64_t m_size;
string m_favicon;
string m_faviconMimeType;
};
/**