summaryrefslogtreecommitdiff
path: root/zen/time.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2016-10-29 11:34:19 +0200
committerDaniel Wilhelm <shieldwed@outlook.com>2016-10-29 11:34:19 +0200
commit8d66e8a2b8cfe4eef4b946a1ab64354dfd7da00b (patch)
tree48e94273d3ee6b9d755e0081c46d29a387871611 /zen/time.h
parent8.3 (diff)
downloadFreeFileSync-8d66e8a2b8cfe4eef4b946a1ab64354dfd7da00b.tar.gz
FreeFileSync-8d66e8a2b8cfe4eef4b946a1ab64354dfd7da00b.tar.bz2
FreeFileSync-8d66e8a2b8cfe4eef4b946a1ab64354dfd7da00b.zip
8.4
Diffstat (limited to 'zen/time.h')
-rw-r--r--zen/time.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/zen/time.h b/zen/time.h
index f9a0fcb5..04d841b5 100644
--- a/zen/time.h
+++ b/zen/time.h
@@ -1,8 +1,8 @@
-// **************************************************************************
-// * This file is part of the FreeFileSync project. It is distributed under *
-// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
-// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
-// **************************************************************************
+// *****************************************************************************
+// * This file is part of the FreeFileSync project. It is distributed under *
+// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
+// * Copyright (C) Zenju (zenju AT freefilesync DOT org) - All Rights Reserved *
+// *****************************************************************************
#ifndef TIME_H_8457092814324342453627
#define TIME_H_8457092814324342453627
@@ -214,7 +214,7 @@ struct PredefinedFormatTag {};
template <class String, class String2> inline
String formatTime(const String2& format, const TimeComp& comp, UserDefinedFormatTag) //format as specified by "std::strftime", returns empty string on failure
{
- typedef typename GetCharType<String>::Type CharType;
+ using CharType = typename GetCharType<String>::Type;
std::tm ctc = toClibTimeComponents(comp);
std::mktime(&ctc); // unfortunately std::strftime() needs all elements of "struct tm" filled, e.g. tm_wday, tm_yday
//note: although std::mktime() explicitly expects "local time", calculating weekday and day of year *should* be time-zone and DST independent
@@ -227,7 +227,7 @@ String formatTime(const String2& format, const TimeComp& comp, UserDefinedFormat
template <class String, class FormatType> inline
String formatTime(FormatType, const TimeComp& comp, PredefinedFormatTag)
{
- typedef typename GetCharType<String>::Type CharType;
+ using CharType = typename GetCharType<String>::Type;
return formatTime<String>(GetFormat<FormatType>().format(CharType()), comp, UserDefinedFormatTag());
}
}
@@ -260,13 +260,13 @@ time_t localToTimeT(const TimeComp& comp) //returns -1 on error
template <class String, class String2> inline
String formatTime(const String2& format, const TimeComp& comp)
{
- typedef typename SelectIf<
+ using FormatTag = typename SelectIf<
IsSameType<String2, FormatDateTag >::value ||
IsSameType<String2, FormatTimeTag >::value ||
IsSameType<String2, FormatDateTimeTag >::value ||
IsSameType<String2, FormatIsoDateTag >::value ||
IsSameType<String2, FormatIsoTimeTag >::value ||
- IsSameType<String2, FormatIsoDateTimeTag>::value, implementation::PredefinedFormatTag, implementation::UserDefinedFormatTag>::Type FormatTag;
+ IsSameType<String2, FormatIsoDateTimeTag>::value, implementation::PredefinedFormatTag, implementation::UserDefinedFormatTag>::Type;
return implementation::formatTime<String>(format, comp, FormatTag());
}
@@ -275,7 +275,7 @@ String formatTime(const String2& format, const TimeComp& comp)
template <class String, class String2>
bool parseTime(const String& format, const String2& str, TimeComp& comp) //return true on success
{
- typedef typename GetCharType<String>::Type CharType;
+ using CharType = typename GetCharType<String>::Type;
static_assert(IsSameType<CharType, typename GetCharType<String2>::Type>::value, "");
const CharType* itFmt = strBegin(format);
bgstack15