16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-20 10:19:19 +02:00

switch state visualisation, semaphore tracking for map purposes

This commit is contained in:
milek7
2019-02-22 22:21:23 +01:00
parent 2bacb941c0
commit 939aa73384
14 changed files with 141 additions and 25 deletions

View File

@@ -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 };