PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::compat Namespace Reference

Typedefs

template<typename... Args>
using format_string = std::format_string<Args...>
 

Functions

std::tm * localtime_safe (const std::time_t *time, std::tm *result)
 Cross-platform thread-safe local time conversion.
 
std::tm * gmtime_safe (const std::time_t *time, std::tm *result)
 Cross-platform thread-safe UTC time conversion.
 

Typedef Documentation

◆ format_string

template<typename... Args>
using kcenon::pacs::compat::format_string = std::format_string<Args...>

Definition at line 31 of file format.h.

Function Documentation

◆ gmtime_safe()

std::tm * kcenon::pacs::compat::gmtime_safe ( const std::time_t * time,
std::tm * result )
inline

Cross-platform thread-safe UTC time conversion.

Converts a time_t value to UTC time in a thread-safe manner. Uses gmtime_r on POSIX systems and gmtime_s on Windows.

Parameters
timePointer to the time_t value to convert
resultPointer to the tm structure to store the result
Returns
Pointer to the tm structure (result) on success, nullptr on failure

Definition at line 62 of file time.h.

62 {
63#if defined(_WIN32) || defined(_WIN64)
64 // Windows: gmtime_s returns errno_t (0 on success)
65 return gmtime_s(result, time) == 0 ? result : nullptr;
66#else
67 // POSIX: gmtime_r returns tm*
68 return gmtime_r(time, result);
69#endif
70}

Referenced by kcenon::pacs::storage::worklist_repository::cleanup_old_worklist_items().

Here is the caller graph for this function:

◆ localtime_safe()

std::tm * kcenon::pacs::compat::localtime_safe ( const std::time_t * time,
std::tm * result )
inline

Cross-platform thread-safe local time conversion.

Converts a time_t value to local time in a thread-safe manner. Uses localtime_r on POSIX systems and localtime_s on Windows.

Parameters
timePointer to the time_t value to convert
resultPointer to the tm structure to store the result
Returns
Pointer to the tm structure (result) on success, nullptr on failure

Definition at line 40 of file time.h.

40 {
41#if defined(_WIN32) || defined(_WIN64)
42 // Windows: localtime_s returns errno_t (0 on success)
43 // Parameter order: (tm*, time_t*)
44 return localtime_s(result, time) == 0 ? result : nullptr;
45#else
46 // POSIX: localtime_r returns tm* (result on success, nullptr on failure)
47 // Parameter order: (time_t*, tm*)
48 return localtime_r(time, result);
49#endif
50}

Referenced by kcenon::pacs::storage::worklist_repository::cleanup_worklist_items_before().

Here is the caller graph for this function: