mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-20 12:39:17 +02:00
switch state visualisation, semaphore tracking for map purposes
This commit is contained in:
@@ -252,6 +252,22 @@ std::string to_hex_str( int const Value, int const Width )
|
||||
return converter.str();
|
||||
};
|
||||
|
||||
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) {
|
||||
|
||||
int result { DefaultValue };
|
||||
|
||||
Reference in New Issue
Block a user