PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
time.h File Reference

Compatibility header for cross-platform time functions. More...

#include <ctime>
Include dependency graph for time.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  kcenon
 
namespace  kcenon::pacs
 
namespace  kcenon::pacs::compat
 

Functions

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

Detailed Description

Compatibility header for cross-platform time functions.

This header provides a unified interface for time functions that differ between POSIX (Unix/Linux/macOS) and Windows.

Key differences:

  • POSIX uses localtime_r(time_t*, tm*) - thread-safe, pointer first
  • Windows uses localtime_s(tm*, time_t*) - thread-safe, tm pointer first

Usage: #include <kcenon/pacs/compat/time.h> std::tm tm{}; kcenon::pacs::compat::localtime_safe(&time_val, &tm);

Author
kcenon
Since
1.0.0

Definition in file time.h.