mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 01:39:18 +02:00
Merge 1a1d201d3f
into e83aec9f94
This commit is contained in:
commit
125b22d89d
4 changed files with 12 additions and 0 deletions
|
@ -294,6 +294,7 @@ void XHTMLTagLinkAction::doAtStart(XHTMLReader &reader, const char **xmlattribut
|
|||
std::string cssFilePath = reader.myPathPrefix + MiscUtil::decodeHtmlURL(href);
|
||||
//ZLLogger::Instance().registerClass("CSS");
|
||||
ZLLogger::Instance().println("CSS", "style file: " + cssFilePath);
|
||||
cssFilePath = ZLStringUtil::replace(cssFilePath, ":", "/");
|
||||
const ZLFile cssFile(cssFilePath);
|
||||
cssFilePath = cssFile.path();
|
||||
shared_ptr<StyleSheetParserWithCache> parser = reader.myFileParsers[cssFilePath];
|
||||
|
|
|
@ -37,6 +37,7 @@ ZLFile::ZLFile() : myMimeTypeIsUpToDate(true), myInfoIsFilled(true) {
|
|||
}
|
||||
|
||||
ZLFile::ZLFile(const std::string &path, const std::string &mimeType) : myPath(path), myMimeType(mimeType), myMimeTypeIsUpToDate(!mimeType.empty()), myInfoIsFilled(false) {
|
||||
myPath = ZLStringUtil::replace(myPath, ":./", ":");
|
||||
ZLFSManager::Instance().normalize(myPath);
|
||||
{
|
||||
std::size_t index = ZLFSManager::Instance().findLastFileNameDelimiter(myPath);
|
||||
|
|
|
@ -80,6 +80,14 @@ void ZLStringUtil::append(std::string &str, const std::vector<std::string> &text
|
|||
}
|
||||
}
|
||||
|
||||
std::string ZLStringUtil::replace(std::string &str, const std::string &strSrc, const std::string &strDst){
|
||||
std::string::size_type position= str.find(strSrc);
|
||||
if (position != std::string::npos){
|
||||
str.replace(position,strSrc.length(),strDst);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
void ZLStringUtil::stripWhiteSpaces(std::string &str) {
|
||||
std::size_t counter = 0;
|
||||
std::size_t length = str.length();
|
||||
|
|
|
@ -48,6 +48,8 @@ public:
|
|||
static unsigned long parseHex(const std::string &str, int defaultValue);
|
||||
|
||||
static void asciiToLowerInline(std::string &asciiString);
|
||||
|
||||
static std::string replace(std::string &str, const std::string &strSrc, const std::string &strDst);
|
||||
};
|
||||
|
||||
#endif /* __ZLSTRINGUTIL_H__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue