47 if (r.find(
":") == std::string::npos) {
56 if (hrt.size() == 3) {
59 }
else if (hrt.size() == 4) {
63 throw TimeFormatException(
"Input string '" + r +
"' is not a valid time format (jj:HH:MM:SS.S).");
70 std::ostringstream oss;
79 t = (t + scale / 2) / scale;
91 oss << t / day <<
":";
94 oss << std::setfill(
'0') << std::setw(2);
95 oss << t / hour <<
":";
97 oss << std::setw(2) << t / minute <<
":";
99 oss << std::setw(2) << t / second;
101 if (t != 0 ||
TS < 1.) {
107 oss << t / second <<
".";
128 return toString((
double)t / 1000.0) +
"s";
136 if (begin % deltaT == 0) {
137 if (t % deltaT != 0) {
141 if ((t - begin) % deltaT != 0) {
143 +
" and begin time " +
time2string(begin) + error +
".")
#define WRITE_WARNING(msg)
void checkTimeBounds(const double time)
check the valid SUMOTime range of double input and throw an error if out of bounds
std::string elapsedMs2string(long long int t)
convert ms to string for log output
bool checkStepLengthMultiple(const SUMOTime t, const std::string &error, SUMOTime deltaT, SUMOTime begin)
check if given SUMOTime is multiple of the step length
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
int gPrecision
the precision for floating point outputs
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
std::vector< std::string > getVector()
return vector of strings
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter