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

file aliases (for reference shortening), not used yet

This commit is contained in:
Nikolay Pultsin 2012-05-11 20:17:09 +01:00
parent 8169e5fac6
commit 7fae9ff250
3 changed files with 31 additions and 4 deletions

View file

@ -5,8 +5,9 @@ Larger icon on the site
litres: top/hot lists (what's happen?) litres: top/hot lists (what's happen?)
litres: author photos litres: author photos
* Empty pages at start of the SJ book (in emulator) * the SJ book:
* Hyperlinks in the SJ book ** empty pages at start (in emulator)
** hyperlinks (including button image)
* Network library initialization in ProcessHyperlinkAction :( * Network library initialization in ProcessHyperlinkAction :(
* "Use embedded fonts" option * "Use embedded fonts" option
* "Scan hidden directories" option * "Scan hidden directories" option
@ -61,10 +62,12 @@ DONE encodings list for native plugins
* Better file name for shared file * Better file name for shared file
* java fb2 plugin: use Base64InputStream technique * java fb2 plugin: use Base64InputStream technique
* - namespaceMapChangedHandler * - namespaceMapChangedHandler
* rtf: underline & strikethrough * rtf:
** underline & strikethrough
** cover?
** footnotes?
* zip: support unicode file names (both java & cpp) * zip: support unicode file names (both java & cpp)
* native code: send URL instead of ZLFileImage * native code: send URL instead of ZLFileImage
* rtf: cover?
* better brightness setting: no black screen, brightness "lower than system" (decrease color brightness) * better brightness setting: no black screen, brightness "lower than system" (decrease color brightness)
* author choose/edit dialog * author choose/edit dialog
* rtf: embedded fonts? * rtf: embedded fonts?

View file

@ -680,3 +680,23 @@ const std::vector<std::string> &XHTMLReader::externalDTDs() const {
bool XHTMLReader::processNamespaces() const { bool XHTMLReader::processNamespaces() const {
return true; return true;
} }
const std::string &XHTMLReader::fileAlias(const std::string &fileName) const {
std::map<std::string,std::string>::const_iterator it = myFileNumbers.find(fileName);
if (it != myFileNumbers.end()) {
return it->second;
}
const std::string correctedFileName =
ZLFileUtil::normalizeUnixPath(MiscUtil::decodeHtmlURL(fileName));
it = myFileNumbers.find(correctedFileName);
if (it != myFileNumbers.end()) {
return it->second;
}
std::string num;
ZLStringUtil::appendNumber(num, myFileNumbers.size());
myFileNumbers.insert(std::make_pair(correctedFileName, num));
it = myFileNumbers.find(correctedFileName);
return it->second;
}

View file

@ -63,6 +63,8 @@ public:
bool readFile(const ZLFile &file, const std::string &referenceName); bool readFile(const ZLFile &file, const std::string &referenceName);
private: private:
const std::string &fileAlias(const std::string &fileName) const;
void startElementHandler(const char *tag, const char **attributes); void startElementHandler(const char *tag, const char **attributes);
void endElementHandler(const char *tag); void endElementHandler(const char *tag);
void characterDataHandler(const char *text, size_t len); void characterDataHandler(const char *text, size_t len);
@ -76,6 +78,8 @@ private:
bool addStyleEntry(const std::string tag, const std::string aClass); bool addStyleEntry(const std::string tag, const std::string aClass);
private: private:
mutable std::map<std::string,std::string> myFileNumbers;
BookReader &myModelReader; BookReader &myModelReader;
std::string myPathPrefix; std::string myPathPrefix;
std::string myReferenceName; std::string myReferenceName;