Sming Framework API
()
Toggle main menu visibility
Sming
Components
IFS
src
include
IFS
TimeStamp.h
Go to the documentation of this file.
1
/****
2
* TimeStamp.h
3
*
4
* Copyright 2019 mikee47 <mike@sillyhouse.net>
5
*
6
* This file is part of the IFS Library
7
*
8
* This library is free software: you can redistribute it and/or modify it under the terms of the
9
* GNU General Public License as published by the Free Software Foundation, version 3 or later.
10
*
11
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
* See the GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License along with this library.
16
* If not, see <https://www.gnu.org/licenses/>.
17
*
18
****/
19
20
#pragma once
21
22
#include <cstdint>
23
#include <time.h>
24
#include <cstring>
25
#include <
WString.h
>
26
27
namespace
IFS
28
{
36
struct
TimeStamp
{
37
uint32_t
mValue
;
38
39
operator
time_t()
const
40
{
41
return
mValue
;
42
}
43
44
TimeStamp
&
operator=
(time_t t)
45
{
46
mValue
= t;
47
return
*
this
;
48
}
49
53
String
toString
(
const
char
* dtsep =
" "
)
const
;
54
55
explicit
operator
String
()
const
56
{
57
return
toString
();
58
}
59
};
60
67
time_t
fsGetTimeUTC
();
68
69
}
// namespace IFS
70
71
inline
String
toString
(
IFS::TimeStamp
timestamp)
72
{
73
return
timestamp.
toString
();
74
}
toString
String toString(IFS::TimeStamp timestamp)
Definition:
TimeStamp.h:71
WString.h
String
The String class.
Definition:
WString.h:137
IFS
Definition:
DirectoryTemplate.h:37
IFS::fsGetTimeUTC
time_t fsGetTimeUTC()
Get current timestamp in UTC.
IFS::TimeStamp
Manage IFS timestamps stored as an unsigned 32-bit value.
Definition:
TimeStamp.h:36
IFS::TimeStamp::operator=
TimeStamp & operator=(time_t t)
Definition:
TimeStamp.h:44
IFS::TimeStamp::mValue
uint32_t mValue
Definition:
TimeStamp.h:37
IFS::TimeStamp::toString
String toString(const char *dtsep=" ") const
Convert time to local time for display.
Generated by
1.9.1