mirror of https://github.com/kiwix/libkiwix.git
Speedup mimetype detection in kiwix-serve
This commit is contained in:
parent
f585bed1cb
commit
baf8e37b4f
|
@ -208,6 +208,18 @@ std::string kiwix::ucFirst (const std::string &word) {
|
|||
return result;
|
||||
}
|
||||
|
||||
std::string kiwix::ucAll (const std::string &word) {
|
||||
if (word.empty())
|
||||
return "";
|
||||
|
||||
std::string result;
|
||||
|
||||
UnicodeString unicodeWord(word.c_str());
|
||||
unicodeWord.toUpper().toUTF8String(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string kiwix::lcFirst (const std::string &word) {
|
||||
if (word.empty())
|
||||
return "";
|
||||
|
@ -222,6 +234,17 @@ std::string kiwix::lcFirst (const std::string &word) {
|
|||
return result;
|
||||
}
|
||||
|
||||
std::string kiwix::lcAll (const std::string &word) {
|
||||
if (word.empty())
|
||||
return "";
|
||||
|
||||
std::string result;
|
||||
|
||||
UnicodeString unicodeWord(word.c_str());
|
||||
unicodeWord.toLower().toUTF8String(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string kiwix::toTitle (const std::string &word) {
|
||||
if (word.empty())
|
||||
|
|
|
@ -59,6 +59,8 @@ namespace kiwix {
|
|||
std::vector<std::string> split(const std::string&, const char*);
|
||||
std::vector<std::string> split(const char*, const std::string&);
|
||||
|
||||
std::string ucAll(const std::string &word);
|
||||
std::string lcAll(const std::string &word);
|
||||
std::string ucFirst(const std::string &word);
|
||||
std::string lcFirst(const std::string &word);
|
||||
std::string toTitle(const std::string &word);
|
||||
|
|
Loading…
Reference in New Issue