mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 00:49:19 +02:00
Replace string_starts_with and string_ends_with with string::starts_with and string::ends_with
This commit is contained in:
@@ -86,11 +86,11 @@ bool locale::parse_translation(std::istream &stream)
|
||||
if (line.size() > 0 && line[0] == '#')
|
||||
continue;
|
||||
|
||||
if (string_starts_with(line, "msgid"))
|
||||
if (line.starts_with("msgid"))
|
||||
last = 'i';
|
||||
else if (string_starts_with(line, "msgstr"))
|
||||
else if (line.starts_with("msgstr"))
|
||||
last = 's';
|
||||
else if (string_starts_with(line, "msgctxt"))
|
||||
else if (line.starts_with("msgctxt"))
|
||||
last = 'c';
|
||||
|
||||
if (line.size() > 1 && last != 'x') {
|
||||
|
||||
@@ -215,22 +215,6 @@ std::string to_minutes_str(float const Minutes, bool const Leadingzero, int cons
|
||||
return (minutes.substr(minutes.size() - width, width) + fractionlabels[static_cast<int>(std::floor(minutesfractional * 10 + 0.1))]);
|
||||
}
|
||||
|
||||
bool string_ends_with(const std::string &string, const std::string &ending)
|
||||
{
|
||||
if (string.length() < ending.length())
|
||||
return false;
|
||||
|
||||
return string.compare(string.length() - ending.length(), ending.length(), ending) == 0;
|
||||
}
|
||||
|
||||
bool string_starts_with(const std::string &string, const std::string &begin)
|
||||
{
|
||||
if (string.length() < begin.length())
|
||||
return false;
|
||||
|
||||
return string.compare(0, begin.length(), begin) == 0;
|
||||
}
|
||||
|
||||
int stol_def(const std::string &str, const int &DefaultValue)
|
||||
{
|
||||
|
||||
|
||||
@@ -146,9 +146,6 @@ template <typename Type_, glm::precision Precision_ = glm::defaultp> std::string
|
||||
return to_string(Value.x, Width) + ", " + to_string(Value.y, Width) + ", " + to_string(Value.z, Width) + ", " + to_string(Value.w, Width);
|
||||
}
|
||||
|
||||
bool string_ends_with(std::string const &string, std::string const &ending);
|
||||
bool string_starts_with(std::string const &string, std::string const &begin);
|
||||
|
||||
int stol_def(const std::string &str, const int &DefaultValue);
|
||||
|
||||
std::string ToLower(std::string const &text);
|
||||
|
||||
Reference in New Issue
Block a user