1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 10:19:33 +02:00

FormatPlugin.readUids(Book &) method (dummy implementations)

This commit is contained in:
Nikolay Pultsin 2013-03-23 21:15:15 +04:00
parent 0b0a8cabf5
commit 72c85142dd
15 changed files with 36 additions and 1 deletions

View file

@ -58,6 +58,7 @@ public:
virtual const std::string &tryOpen(const ZLFile &file) const; virtual const std::string &tryOpen(const ZLFile &file) const;
virtual bool readMetaInfo(Book &book) const = 0; virtual bool readMetaInfo(Book &book) const = 0;
virtual bool readUids(Book &book) const = 0;
virtual bool readLanguageAndEncoding(Book &book) const = 0; virtual bool readLanguageAndEncoding(Book &book) const = 0;
virtual bool readModel(BookModel &model) const = 0; virtual bool readModel(BookModel &model) const = 0;
virtual shared_ptr<const ZLImage> coverImage(const ZLFile &file) const; virtual shared_ptr<const ZLImage> coverImage(const ZLFile &file) const;

View file

@ -62,6 +62,10 @@ bool DocPlugin::readMetaInfo(Book &book) const {
return true; return true;
} }
bool DocPlugin::readUids(Book &/*book*/) const {
return true;
}
bool DocPlugin::readLanguageAndEncoding(Book &/*book*/) const { bool DocPlugin::readLanguageAndEncoding(Book &/*book*/) const {
return true; return true;
} }

View file

@ -32,6 +32,7 @@ public:
const std::string supportedFileType() const; const std::string supportedFileType() const;
bool acceptsFile(const ZLFile &file) const; bool acceptsFile(const ZLFile &file) const;
bool readMetaInfo(Book &book) const; bool readMetaInfo(Book &book) const;
bool readUids(Book &book) const;
bool readLanguageAndEncoding(Book &book) const; bool readLanguageAndEncoding(Book &book) const;
bool readModel(BookModel &model) const; bool readModel(BookModel &model) const;
}; };

View file

@ -50,7 +50,9 @@ private:
READ_AUTHOR_NAME_1, READ_AUTHOR_NAME_1,
READ_AUTHOR_NAME_2, READ_AUTHOR_NAME_2,
READ_LANGUAGE, READ_LANGUAGE,
READ_GENRE READ_GENRE,
READ_DOCUMENT_INFO,
READ_ID
} myReadState; } myReadState;
std::string myAuthorNames[3]; std::string myAuthorNames[3];

View file

@ -33,6 +33,10 @@ bool FB2Plugin::readMetaInfo(Book &book) const {
return FB2MetaInfoReader(book).readMetaInfo(); return FB2MetaInfoReader(book).readMetaInfo();
} }
bool FB2Plugin::readUids(Book &/*book*/) const {
return true;
}
bool FB2Plugin::readModel(BookModel &model) const { bool FB2Plugin::readModel(BookModel &model) const {
return FB2BookReader(model).readBook(); return FB2BookReader(model).readBook();
} }

View file

@ -30,6 +30,7 @@ public:
bool providesMetaInfo() const; bool providesMetaInfo() const;
const std::string supportedFileType() const; const std::string supportedFileType() const;
bool readMetaInfo(Book &book) const; bool readMetaInfo(Book &book) const;
bool readUids(Book &book) const;
bool readLanguageAndEncoding(Book &book) const; bool readLanguageAndEncoding(Book &book) const;
bool readModel(BookModel &model) const; bool readModel(BookModel &model) const;
shared_ptr<const ZLImage> coverImage(const ZLFile &file) const; shared_ptr<const ZLImage> coverImage(const ZLFile &file) const;

View file

@ -81,6 +81,8 @@ public:
_COVERPAGE, _COVERPAGE,
_SEQUENCE, _SEQUENCE,
_GENRE, _GENRE,
_DOCUMENT_INFO,
_ID,
_UNKNOWN _UNKNOWN
}; };

View file

@ -50,6 +50,10 @@ bool HtmlPlugin::readMetaInfo(Book &book) const {
return true; return true;
} }
bool HtmlPlugin::readUids(Book &/*book*/) const {
return true;
}
bool HtmlPlugin::readModel(BookModel &model) const { bool HtmlPlugin::readModel(BookModel &model) const {
const Book& book = *model.book(); const Book& book = *model.book();
const ZLFile &file = book.file(); const ZLFile &file = book.file();

View file

@ -30,6 +30,7 @@ public:
bool providesMetaInfo() const; bool providesMetaInfo() const;
const std::string supportedFileType() const; const std::string supportedFileType() const;
bool readMetaInfo(Book &book) const; bool readMetaInfo(Book &book) const;
bool readUids(Book &book) const;
bool readLanguageAndEncoding(Book &book) const; bool readLanguageAndEncoding(Book &book) const;
bool readModel(BookModel &model) const; bool readModel(BookModel &model) const;
// FormatInfoPage *createInfoPage(ZLOptionsDialog &dialog, const ZLFile &file); // FormatInfoPage *createInfoPage(ZLOptionsDialog &dialog, const ZLFile &file);

View file

@ -123,6 +123,10 @@ bool OEBPlugin::readMetaInfo(Book &book) const {
return OEBMetaInfoReader(book).readMetaInfo(opfFile(file)); return OEBMetaInfoReader(book).readMetaInfo(opfFile(file));
} }
bool OEBPlugin::readUids(Book &/*book*/) const {
return true;
}
bool OEBPlugin::readModel(BookModel &model) const { bool OEBPlugin::readModel(BookModel &model) const {
const ZLFile &file = model.book()->file(); const ZLFile &file = model.book()->file();
return OEBBookReader(model).readBook(opfFile(file)); return OEBBookReader(model).readBook(opfFile(file));

View file

@ -32,6 +32,7 @@ public:
bool providesMetaInfo() const; bool providesMetaInfo() const;
const std::string supportedFileType() const; const std::string supportedFileType() const;
bool readMetaInfo(Book &book) const; bool readMetaInfo(Book &book) const;
bool readUids(Book &book) const;
bool readLanguageAndEncoding(Book &book) const; bool readLanguageAndEncoding(Book &book) const;
bool readModel(BookModel &model) const; bool readModel(BookModel &model) const;
shared_ptr<const ZLImage> coverImage(const ZLFile &file) const; shared_ptr<const ZLImage> coverImage(const ZLFile &file) const;

View file

@ -54,6 +54,10 @@ bool RtfPlugin::readMetaInfo(Book &book) const {
return true; return true;
} }
bool RtfPlugin::readUids(Book &/*book*/) const {
return true;
}
bool RtfPlugin::readModel(BookModel &model) const { bool RtfPlugin::readModel(BookModel &model) const {
const Book &book = *model.book(); const Book &book = *model.book();
return RtfBookReader(model, book.encoding()).readDocument(book.file()); return RtfBookReader(model, book.encoding()).readDocument(book.file());

View file

@ -28,6 +28,7 @@ public:
bool providesMetaInfo() const; bool providesMetaInfo() const;
const std::string supportedFileType() const; const std::string supportedFileType() const;
bool readMetaInfo(Book &book) const; bool readMetaInfo(Book &book) const;
bool readUids(Book &book) const;
bool readLanguageAndEncoding(Book &book) const; bool readLanguageAndEncoding(Book &book) const;
bool readModel(BookModel &model) const; bool readModel(BookModel &model) const;
}; };

View file

@ -65,6 +65,10 @@ bool TxtPlugin::readModel(BookModel &model) const {
// return new PlainTextInfoPage(dialog, file, ZLResourceKey("Text"), true); // return new PlainTextInfoPage(dialog, file, ZLResourceKey("Text"), true);
//} //}
bool TxtPlugin::readUids(Book &/*book*/) const {
return true;
}
bool TxtPlugin::readLanguageAndEncoding(Book &book) const { bool TxtPlugin::readLanguageAndEncoding(Book &book) const {
shared_ptr<ZLInputStream> stream = book.file().inputStream(); shared_ptr<ZLInputStream> stream = book.file().inputStream();
if (stream.isNull()) { if (stream.isNull()) {

View file

@ -29,6 +29,7 @@ public:
bool providesMetaInfo() const; bool providesMetaInfo() const;
const std::string supportedFileType() const; const std::string supportedFileType() const;
bool readMetaInfo(Book &book) const; bool readMetaInfo(Book &book) const;
bool readUids(Book &book) const;
bool readLanguageAndEncoding(Book &book) const; bool readLanguageAndEncoding(Book &book) const;
bool readModel(BookModel &model) const; bool readModel(BookModel &model) const;
// FormatInfoPage *createInfoPage(ZLOptionsDialog &dialog, const ZLFile &file); // FormatInfoPage *createInfoPage(ZLOptionsDialog &dialog, const ZLFile &file);