Time Shield Library
C++ library for working with time
Toggle main menu visibility
Loading...
Searching...
No Matches
time_struct.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
#pragma once
3
#ifndef TIME_SHIELD_HEADER_TIME_SHIELD_TIME_STRUCT_HPP_INCLUDED
4
#define TIME_SHIELD_HEADER_TIME_SHIELD_TIME_STRUCT_HPP_INCLUDED
5
10
11
namespace
time_shield
{
12
15
struct
TimeStruct
{
16
int16_t
hour
;
17
int16_t
min
;
18
int16_t
sec
;
19
int16_t
ms
;
20
};
21
29
inline
const
TimeStruct
create_time_struct
(
30
int16_t hour,
31
int16_t min,
32
int16_t sec = 0,
33
int16_t ms = 0) {
34
TimeStruct
data{hour, min, sec, ms};
35
return
data;
36
}
37
38
};
// namespace time_shield
39
40
#endif
// TIME_SHIELD_HEADER_TIME_SHIELD_TIME_STRUCT_HPP_INCLUDED
time_shield::create_time_struct
const TimeStruct create_time_struct(int16_t hour, int16_t min, int16_t sec=0, int16_t ms=0)
Creates a TimeStruct instance.
Definition
time_struct.hpp:29
time_shield
Main namespace for the Time Shield library.
time_shield::TimeStruct
Structure to represent time.
Definition
time_struct.hpp:15
time_shield::TimeStruct::ms
int16_t ms
Millisecond component of time (0-999).
Definition
time_struct.hpp:19
time_shield::TimeStruct::hour
int16_t hour
Hour component of time (0-23).
Definition
time_struct.hpp:16
time_shield::TimeStruct::sec
int16_t sec
Second component of time (0-59).
Definition
time_struct.hpp:18
time_shield::TimeStruct::min
int16_t min
Minute component of time (0-59).
Definition
time_struct.hpp:17
include
time_shield
time_struct.hpp
Generated by
1.17.0