| 52 | } |
| 53 | return *state.file_stream; |
| 54 | } |
| 55 | |
| 56 | std::string timestamp_seconds_local() { |
| 57 | const auto now = std::chrono::system_clock::now(); |
| 58 | const std::time_t now_time = std::chrono::system_clock::to_time_t(now); |
| 59 | std::tm local_tm{}; |
| 60 | #if defined(_WIN32) |
| 61 | localtime_s(&local_tm, &now_time); |
| 62 | #else |
| 63 | localtime_r(&now_time, &local_tm); |
| 64 | #endif |
| 65 | std::ostringstream out; |
| 66 | out << std::put_time(&local_tm, "%Y%m%d-%H%M%S"); |
| 67 | return out.str(); |
| 68 | } |
| 69 |
no test coverage detected