~ubuntu-branches/ubuntu/vivid/fbreader/vivid-proposed

« back to all changes in this revision

Viewing changes to fbreader/src/collection/BookCollection.h

  • Committer: Bazaar Package Importer
  • Author(s): Eugene V. Lyubimkin
  • Date: 2008-06-17 23:01:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080617230153-a16c45tq69j8geru
Tags: 0.8.17-11
* debian/control:
  - Enhanced all ZLibrary descriptions, not the main one.
  - Done some renaming to use canonical names of libraries and toolkits in
    decriptions, as suggested by developers-reference:
    'qt' -> 'Qt', 'gtk' -> 'GTK+', 'zlibrary' -> 'ZLibrary'.
  - Bump 'Depends' on quilt to (>= 0.24).
* debian/rules:
  - Included quilt makefile instead of quilt makefile instead
    of copy&paste'ing it.
* debian/fbreader.links:
  - Added this file to relay on dh_link's work instead of using 'ln -sf'
    directly in the debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
typedef std::vector<BookDescriptionPtr> Books;
33
33
 
34
 
class DescriptionComparator {
35
 
 
36
 
public:
37
 
        DescriptionComparator();
38
 
        ~DescriptionComparator();
39
 
        bool operator() (const BookDescriptionPtr d1, const BookDescriptionPtr d2);
40
 
};
41
 
 
42
34
class BookCollection {
43
35
 
44
36
public:
50
42
        ~BookCollection();
51
43
 
52
44
        const std::vector<AuthorPtr> &authors() const;
53
 
        const Books &books(AuthorPtr author) const;
 
45
        const Books &books() const;
54
46
        bool isBookExternal(BookDescriptionPtr description) const;
55
47
 
56
48
        void rebuild(bool strong);
57
49
        bool synchronize() const;
 
50
 
 
51
        void collectSeriesNames(AuthorPtr author, std::set<std::string> &list) const;
 
52
        void removeTag(const std::string &tag, bool includeSubTags);
 
53
        void renameTag(const std::string &from, const std::string &to, bool includeSubTags);
 
54
        void cloneTag(const std::string &from, const std::string &to, bool includeSubTags);
 
55
        void addTagToAllBooks(const std::string &to);
 
56
        void addTagToBooksWithNoTags(const std::string &to);
 
57
        bool hasBooks(const std::string &tag) const;
 
58
        bool hasSubtags(const std::string &tag) const;
58
59
        
59
60
private:
60
 
 
61
61
        void collectDirNames(std::set<std::string> &names) const;
62
62
        void collectBookFileNames(std::set<std::string> &bookFileNames) const;
63
63
 
64
64
        void addDescription(BookDescriptionPtr description) const;
65
65
 
66
66
private:
 
67
        mutable Books myBooks;
67
68
        mutable std::vector<AuthorPtr> myAuthors;
68
 
        mutable std::map<AuthorPtr,Books> myCollection;
69
69
        mutable std::set<BookDescriptionPtr> myExternalBooks;
70
70
 
71
71
        mutable std::string myPath;
89
89
        Books myBooks;
90
90
};
91
91
 
92
 
inline DescriptionComparator::DescriptionComparator() {}
93
 
inline DescriptionComparator::~DescriptionComparator() {}
94
 
 
95
 
inline const std::vector<AuthorPtr > &BookCollection::authors() const {
96
 
        synchronize();
97
 
        return myAuthors;
98
 
}
99
 
 
100
 
inline const Books &BookCollection::books(AuthorPtr author) const {
101
 
        synchronize();
102
 
        return (*myCollection.find(author)).second;
 
92
inline const Books &BookCollection::books() const {
 
93
        synchronize();
 
94
        return myBooks;
103
95
}
104
96
 
105
97
inline bool BookCollection::isBookExternal(BookDescriptionPtr description) const {