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;
80 t = (t + scale / 2) / scale;
92 oss << t / day <<
":";
95 oss << std::setfill(
'0') << std::setw(2);
96 oss << t / hour <<
":";
98 oss << std::setw(2) << t / minute <<
":";
100 oss << std::setw(2) << t / second;
102 if (t != 0 ||
TS < 1.) {
108 oss << t / second <<
".";
129 return toString((
double)t / 1000.0) +
"s";
137 if (begin % deltaT == 0) {
138 if (t % deltaT != 0) {
142 if ((t - begin) % deltaT != 0) {
144 +
" 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