Get current system time.
| 80 | |
| 81 | // Get current system time. |
| 82 | static bool CurrentTime(struct tm& time_data) |
| 83 | { |
| 84 | bool ret = false; |
| 85 | std::stringstream suffix; |
| 86 | time_t current_time = std::time(0); |
| 87 | #ifdef _WIN32 |
| 88 | struct tm* time_local = &time_data; |
| 89 | ret = (localtime_s(time_local, ¤t_time) == 0); |
| 90 | #else |
| 91 | struct tm* time_local = localtime(¤t_time); |
| 92 | if (time_local != nullptr) |
| 93 | { |
| 94 | time_data = *time_local; |
| 95 | ret = true; |
| 96 | } |
| 97 | #endif |
| 98 | return ret; |
| 99 | } |
| 100 | |
| 101 | // Delete log files older than "daysNum" days. |
| 102 | bool RgaSharedUtils::DeleteOldLogs(const std::string& dir, const std::string& base_file_name, unsigned int days_num) |
no outgoing calls
no test coverage detected