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

readMetaInfo -> readMetainfo

This commit is contained in:
Nikolay Pultsin 2014-06-10 10:17:26 +01:00
parent 456a320625
commit aeb905a08d
29 changed files with 45 additions and 45 deletions

View file

@ -94,7 +94,7 @@ static void fillLanguageAndEncoding(JNIEnv* env, jobject javaBook, Book &book) {
}
extern "C"
JNIEXPORT jint JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPlugin_readMetaInfoNative(JNIEnv* env, jobject thiz, jobject javaBook) {
JNIEXPORT jint JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPlugin_readMetainfoNative(JNIEnv* env, jobject thiz, jobject javaBook) {
shared_ptr<FormatPlugin> plugin = findCppPlugin(thiz);
if (plugin.isNull()) {
return 1;
@ -102,7 +102,7 @@ JNIEXPORT jint JNICALL Java_org_geometerplus_fbreader_formats_NativeFormatPlugin
shared_ptr<Book> book = Book::loadFromJavaBook(env, javaBook);
if (!plugin->readMetaInfo(*book)) {
if (!plugin->readMetainfo(*book)) {
return 2;
}

View file

@ -58,7 +58,7 @@ public:
//virtual FormatInfoPage *createInfoPage(ZLOptionsDialog &dialog, const ZLFile &file);
virtual const std::string &tryOpen(const ZLFile &file) const;
virtual bool readMetaInfo(Book &book) const = 0;
virtual bool readMetainfo(Book &book) const = 0;
virtual std::vector<shared_ptr<FileEncryptionInfo> > readEncryptionInfos(Book &book) const;
virtual bool readUids(Book &book) const = 0;
virtual bool readLanguageAndEncoding(Book &book) const = 0;

View file

@ -30,7 +30,7 @@ DocMetaInfoReader::DocMetaInfoReader(Book &book) : myBook(book) {
myBook.removeAllTags();
}
bool DocMetaInfoReader::readMetaInfo() {
bool DocMetaInfoReader::readMetainfo() {
myBook.removeAllAuthors();
myBook.setTitle(myBook.file().name(true));
myBook.removeAllTags();

View file

@ -29,7 +29,7 @@ class DocMetaInfoReader {
public:
DocMetaInfoReader(Book &book);
~DocMetaInfoReader();
bool readMetaInfo();
bool readMetainfo();
/*
void startElementHandler(int tag, const char **attributes);

View file

@ -48,8 +48,8 @@ bool DocPlugin::acceptsFile(const ZLFile &file) const {
return file.extension() == "doc";
}
bool DocPlugin::readMetaInfo(Book &book) const {
if (!DocMetaInfoReader(book).readMetaInfo()) {
bool DocPlugin::readMetainfo(Book &book) const {
if (!DocMetaInfoReader(book).readMetainfo()) {
return false;
}

View file

@ -213,7 +213,7 @@ void FB2MetaInfoReader::endElementHandler(int tag) {
}
}
bool FB2MetaInfoReader::readMetaInfo() {
bool FB2MetaInfoReader::readMetainfo() {
myReadState = READ_NOTHING;
myBuffer.erase();
for (int i = 0; i < 3; ++i) {

View file

@ -30,7 +30,7 @@ class FB2MetaInfoReader : public FB2Reader {
public:
FB2MetaInfoReader(Book &book);
bool readMetaInfo();
bool readMetainfo();
void startElementHandler(int tag, const char **attributes);
void endElementHandler(int tag);

View file

@ -30,8 +30,8 @@ const std::string FB2Plugin::supportedFileType() const {
return "fb2";
}
bool FB2Plugin::readMetaInfo(Book &book) const {
return FB2MetaInfoReader(book).readMetaInfo();
bool FB2Plugin::readMetainfo(Book &book) const {
return FB2MetaInfoReader(book).readMetainfo();
}
bool FB2Plugin::readUids(Book &book) const {

View file

@ -29,7 +29,7 @@ public:
~FB2Plugin();
bool providesMetaInfo() 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 readModel(BookModel &model) const;

View file

@ -34,7 +34,7 @@ const std::string HtmlPlugin::supportedFileType() const {
return "HTML";
}
bool HtmlPlugin::readMetaInfo(Book &book) const {
bool HtmlPlugin::readMetainfo(Book &book) const {
shared_ptr<ZLInputStream> stream = book.file().inputStream();
if (stream.isNull()) {
return false;

View file

@ -29,7 +29,7 @@ public:
~HtmlPlugin();
bool providesMetaInfo() 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 readModel(BookModel &model) const;

View file

@ -154,7 +154,7 @@ void OEBMetaInfoReader::endElementHandler(const char *tag) {
myReadState = READ_METADATA;
}
bool OEBMetaInfoReader::readMetaInfo(const ZLFile &file) {
bool OEBMetaInfoReader::readMetainfo(const ZLFile &file) {
myReadState = READ_NONE;
if (!readDocument(file)) {
ZLLogger::Instance().println("epub", "Failure while reading info from " + file.path());

View file

@ -30,7 +30,7 @@ class OEBMetaInfoReader : public OPFReader {
public:
OEBMetaInfoReader(Book &book);
bool readMetaInfo(const ZLFile &file);
bool readMetainfo(const ZLFile &file);
void startElementHandler(const char *tag, const char **attributes);
void endElementHandler(const char *tag);

View file

@ -124,9 +124,9 @@ ZLFile OEBPlugin::opfFile(const ZLFile &oebFile) {
return ZLFile::NO_FILE;
}
bool OEBPlugin::readMetaInfo(Book &book) const {
bool OEBPlugin::readMetainfo(Book &book) const {
const ZLFile &file = book.file();
return OEBMetaInfoReader(book).readMetaInfo(opfFile(file));
return OEBMetaInfoReader(book).readMetainfo(opfFile(file));
}
std::vector<shared_ptr<FileEncryptionInfo> > OEBPlugin::readEncryptionInfos(Book &book) const {

View file

@ -32,7 +32,7 @@ public:
~OEBPlugin();
bool providesMetaInfo() const;
const std::string supportedFileType() const;
bool readMetaInfo(Book &book) const;
bool readMetainfo(Book &book) const;
virtual std::vector<shared_ptr<FileEncryptionInfo> > readEncryptionInfos(Book &book) const;
bool readUids(Book &book) const;
bool readLanguageAndEncoding(Book &book) const;

View file

@ -37,7 +37,7 @@ const std::string RtfPlugin::supportedFileType() const {
return "rtf";
}
bool RtfPlugin::readMetaInfo(Book &book) const {
bool RtfPlugin::readMetainfo(Book &book) const {
if (!RtfDescriptionReader(book).readDocument(book.file())) {
return false;
}

View file

@ -27,7 +27,7 @@ class RtfPlugin : public FormatPlugin {
public:
bool providesMetaInfo() 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 readModel(BookModel &model) const;

View file

@ -38,7 +38,7 @@ const std::string TxtPlugin::supportedFileType() const {
return "plain text";
}
bool TxtPlugin::readMetaInfo(Book &/*book*/) const {
bool TxtPlugin::readMetainfo(Book &/*book*/) const {
return true;
}

View file

@ -28,7 +28,7 @@ public:
~TxtPlugin();
bool providesMetaInfo() 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 readModel(BookModel &model) const;

View file

@ -65,7 +65,7 @@ shared_ptr<Book> Book::loadFromFile(const ZLFile &file) {
}
shared_ptr<Book> book = new Book(file, 0);
if (!plugin->readMetaInfo(*book)) {
if (!plugin->readMetainfo(*book)) {
return 0;
}

View file

@ -76,7 +76,7 @@ public class Book extends TitledEntity {
myId = -1;
final FormatPlugin plugin = getPlugin(file);
File = plugin.realBookFile(file);
readMetaInfo(plugin);
readMetainfo(plugin);
myIsSaved = false;
}
@ -157,7 +157,7 @@ public class Book extends TitledEntity {
public void reloadInfoFromFile() {
try {
readMetaInfo();
readMetainfo();
} catch (BookReadingException e) {
// ignore
}
@ -175,11 +175,11 @@ public class Book extends TitledEntity {
return getPlugin(File);
}
void readMetaInfo() throws BookReadingException {
readMetaInfo(getPlugin());
void readMetainfo() throws BookReadingException {
readMetainfo(getPlugin());
}
private void readMetaInfo(FormatPlugin plugin) throws BookReadingException {
private void readMetainfo(FormatPlugin plugin) throws BookReadingException {
myEncoding = null;
myLanguage = null;
setTitle(null);
@ -190,7 +190,7 @@ public class Book extends TitledEntity {
myIsSaved = false;
plugin.readMetaInfo(this);
plugin.readMetainfo(this);
if (myUids == null || myUids.isEmpty()) {
plugin.readUids(this);
}

View file

@ -109,7 +109,7 @@ public class BookCollection extends AbstractBookCollection {
if (book == null) {
book = new Book(bookFile);
} else {
book.readMetaInfo();
book.readMetainfo();
}
} catch (BookReadingException e) {
return null;
@ -151,7 +151,7 @@ public class BookCollection extends AbstractBookCollection {
fileInfos.save();
try {
book.readMetaInfo();
book.readMetainfo();
// loaded from db
addBook(book, false);
return book;
@ -508,7 +508,7 @@ public class BookCollection extends AbstractBookCollection {
}
if (!fileInfos.check(file, true)) {
try {
book.readMetaInfo();
book.readMetainfo();
saveBook(book);
} catch (BookReadingException e) {
doAdd = false;
@ -611,7 +611,7 @@ public class BookCollection extends AbstractBookCollection {
final Book book = orphanedBooksByFileId.get(fileId);
if (book != null) {
if (doReadMetaInfo) {
book.readMetaInfo();
book.readMetainfo();
}
newBooks.add(book);
return;

View file

@ -48,7 +48,7 @@ public abstract class FormatPlugin {
public List<FileEncryptionInfo> readEncryptionInfos(Book book) {
return Collections.emptyList();
}
public abstract void readMetaInfo(Book book) throws BookReadingException;
public abstract void readMetainfo(Book book) throws BookReadingException;
public abstract void readUids(Book book) throws BookReadingException;
public abstract void readModel(BookModel model) throws BookReadingException;
public abstract void detectLanguageAndEncoding(Book book) throws BookReadingException;

View file

@ -51,8 +51,8 @@ public class NativeFormatPlugin extends FormatPlugin {
}
@Override
synchronized public void readMetaInfo(Book book) throws BookReadingException {
final int code = readMetaInfoNative(book);
synchronized public void readMetainfo(Book book) throws BookReadingException {
final int code = readMetainfoNative(book);
if (code != 0) {
throw new BookReadingException(
"nativeCodeFailure",
@ -62,7 +62,7 @@ public class NativeFormatPlugin extends FormatPlugin {
}
}
private native int readMetaInfoNative(Book book);
private native int readMetainfoNative(Book book);
@Override
public List<FileEncryptionInfo> readEncryptionInfos(Book book) {

View file

@ -56,7 +56,7 @@ public class FB2MetaInfoReader extends ZLXMLReaderAdapter {
return true;
}
public void readMetaInfo() throws BookReadingException {
public void readMetainfo() throws BookReadingException {
myReadState = READ_NOTHING;
myAuthorNames[0] = "";
myAuthorNames[1] = "";

View file

@ -43,8 +43,8 @@ public class FB2Plugin extends JavaFormatPlugin {
}
@Override
public void readMetaInfo(Book book) throws BookReadingException {
new FB2MetaInfoReader(book).readMetaInfo();
public void readMetainfo(Book book) throws BookReadingException {
new FB2MetaInfoReader(book).readMetainfo();
}
@Override

View file

@ -44,7 +44,7 @@ class OEBMetaInfoReader extends ZLXMLReaderAdapter implements XMLNamespaces {
myBook.setLanguage(null);
}
void readMetaInfo(ZLFile file) throws BookReadingException {
void readMetainfo(ZLFile file) throws BookReadingException {
myReadState = ReadState.Nothing;
mySeriesTitle = "";
mySeriesIndex = null;

View file

@ -57,8 +57,8 @@ public class OEBPlugin extends JavaFormatPlugin {
}
@Override
public void readMetaInfo(Book book) throws BookReadingException {
new OEBMetaInfoReader(book).readMetaInfo(getOpfFile(book.File));
public void readMetainfo(Book book) throws BookReadingException {
new OEBMetaInfoReader(book).readMetainfo(getOpfFile(book.File));
}
@Override

View file

@ -40,7 +40,7 @@ public class MobipocketPlugin extends JavaFormatPlugin {
}
@Override
public void readMetaInfo(Book book) throws BookReadingException {
public void readMetainfo(Book book) throws BookReadingException {
InputStream stream = null;
try {
stream = book.File.getInputStream();