ADTF File Library
Loading...
Searching...
No Matches
time_utils.h
Go to the documentation of this file.
1
16
17#pragma once
18#include <chrono>
19#include <string>
20#include <a_util/datetime/datetime.h>
21#include <optional>
22
23namespace adtf_file
24{
34 std::string fractional_value_to_string(const int64_t fractional_value, std::optional<size_t> fixed_precision = {});
35
43 std::chrono::nanoseconds
44 parseTimestamp(const std::string& strTimestamp);
45
57 std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>
58 parseIsoTimestamp(const std::string& strTimestamp);
59
71 std::string
72 createIsoTimestampString(const std::chrono::nanoseconds& nanos, std::optional<size_t> fixed_precision = {}, bool local_time = false);
73
83 std::string
84 createDurationString(std::chrono::nanoseconds const ns, std::optional<size_t> fixed_precision = {});
85
86} // namespace adtf_file
namespace for ADTF File library
Definition adtf2_adtf_core_media_sample_deserializer.h:25
std::string createDurationString(std::chrono::nanoseconds const ns, std::optional< size_t > fixed_precision={})
Create string in seconds (and fractions) and without unit postfix.
std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > parseIsoTimestamp(const std::string &strTimestamp)
Convert ISO 8601 string to timestamp in nanoseconds of system_clock ( high performance clock )....
std::string fractional_value_to_string(const int64_t fractional_value, std::optional< size_t > fixed_precision={})
Converts the decimal part of a floating point number given as an integer value into a string.
std::string createIsoTimestampString(const std::chrono::nanoseconds &nanos, std::optional< size_t > fixed_precision={}, bool local_time=false)
Format ISO 8601 string from a 'std.chrono.nanoseconds' param.
std::chrono::nanoseconds parseTimestamp(const std::string &strTimestamp)
General parser for timestamps in several formats (ISO-8601, number+unit).