summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/stringutils.cpp2
-rw-r--r--src/utils/stringutils.h2
-rw-r--r--src/utils/translation/poparser.cpp6
-rw-r--r--src/utils/translation/poparser.h8
4 files changed, 9 insertions, 9 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index f47f724a8..e7b850510 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -283,7 +283,7 @@ std::string removeSpriteIndex(std::string str)
return str;
}
-const char* getSafeUtf8String(std::string text)
+const char* getSafeUtf8String(const std::string &text)
{
const size_t sz = text.size();
const size_t size = sz + UTF8_MAX_SIZE;
diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h
index 7cf924d98..cd04006ef 100644
--- a/src/utils/stringutils.h
+++ b/src/utils/stringutils.h
@@ -149,7 +149,7 @@ std::string extractNameFromSprite(std::string str) A_WARN_UNUSED;
std::string removeSpriteIndex(std::string str) A_WARN_UNUSED;
-const char* getSafeUtf8String(std::string text) A_WARN_UNUSED;
+const char* getSafeUtf8String(const std::string &text) A_WARN_UNUSED;
void getSafeUtf8String(std::string text, char *const buf);
diff --git a/src/utils/translation/poparser.cpp b/src/utils/translation/poparser.cpp
index c105bf0da..bcb577f84 100644
--- a/src/utils/translation/poparser.cpp
+++ b/src/utils/translation/poparser.cpp
@@ -42,7 +42,7 @@ PoParser::PoParser() :
{
}
-void PoParser::openFile(std::string name)
+void PoParser::openFile(const std::string &name)
{
const ResourceManager *const resman = ResourceManager::getInstance();
if (!resman)
@@ -228,14 +228,14 @@ PoDict *PoParser::getEmptyDict()
return new PoDict("");
}
-bool PoParser::checkLang(std::string lang)
+bool PoParser::checkLang(const std::string &lang)
{
// check is po file exists
const ResourceManager *const resman = ResourceManager::getInstance();
return resman->exists(getFileName(lang));
}
-std::string PoParser::getFileName(std::string lang)
+std::string PoParser::getFileName(const std::string &lang)
{
// get po file name from lang name
// logger->log("getFileName: translations/%s.po", lang.c_str());
diff --git a/src/utils/translation/poparser.h b/src/utils/translation/poparser.h
index 41598442b..d57dde061 100644
--- a/src/utils/translation/poparser.h
+++ b/src/utils/translation/poparser.h
@@ -39,15 +39,15 @@ class PoParser final
const std::string &restrict fileName = "",
PoDict *restrict const dict = nullptr);
- static bool checkLang(std::string lang);
+ static bool checkLang(const std::string &lang);
static PoDict *getEmptyDict();
private:
- void setLang(std::string lang)
+ void setLang(const std::string &lang)
{ mLang = lang; }
- void openFile(std::string name);
+ void openFile(const std::string &name);
bool readLine();
@@ -57,7 +57,7 @@ class PoParser final
bool checkLine() const;
- static std::string getFileName(std::string lang);
+ static std::string getFileName(const std::string &lang);
PoDict *getDict() const;