Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
q20chrono.h
Go to the documentation of this file.
1
// Copyright (C) 2023 Ahmad Samir <a.samirh78@gmail.com>
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
Q20CHRONO_H
6
#
define
Q20CHRONO_H
7
8
#
include
<
QtCore
/
qtconfigmacros
.
h
>
9
10
#
include
<
chrono
>
11
12
//
13
// W A R N I N G
14
// -------------
15
//
16
// This file is not part of the Qt API. Types and functions defined in this
17
// file can reliably be replaced by their std counterparts, once available.
18
// You may use these definitions in your own code, but be aware that we
19
// will remove them once Qt depends on the C++ version that supports
20
// them in namespace std. There will be NO deprecation warning, the
21
// definitions will JUST go away.
22
//
23
// If you can't agree to these terms, don't use these definitions!
24
//
25
// We mean it.
26
//
27
28
QT_BEGIN_NAMESPACE
29
30
namespace
q20
{
31
namespace
chrono
{
32
33
#
if
defined
(
__GLIBCXX__
)
34
// https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libstdc%2B%2B-v3/include/bits/chrono.h
35
using
IntRep = int64_t;
36
#
else
37
// https://github.com/llvm/llvm-project/blob/main/libcxx/include/__chrono/duration.h
38
// https://github.com/microsoft/STL/blob/main/stl/inc/__msvc_chrono.hpp
39
using
IntRep
=
int
;
40
#
endif
41
42
// INTEGRITY incident-85878 (timezone and clock_cast are not supported)
43
#
if
__cpp_lib_chrono
>=
201907L
&&
!
defined
(
Q_OS_INTEGRITY
)
44
using
std
::
chrono
::
days
;
45
using
std
::
chrono
::
weeks
;
46
using
std
::
chrono
::
years
;
47
using
std
::
chrono
::
months
;
48
49
static_assert
(
std
::
is_same_v
<
days
::
rep
,
IntRep
>);
50
static_assert
(
std
::
is_same_v
<
weeks
::
rep
,
IntRep
>);
51
static_assert
(
std
::
is_same_v
<
years
::
rep
,
IntRep
>);
52
static_assert
(
std
::
is_same_v
<
months
::
rep
,
IntRep
>);
53
#
else
54
using
days
=
std
::
chrono
::
duration
<
IntRep
,
std
::
ratio
<86400>>;
55
using
weeks
=
std
::
chrono
::
duration
<
IntRep
,
std
::
ratio_multiply
<
std
::
ratio
<7>,
days
::
period
>>;
56
using
years
=
std
::
chrono
::
duration
<
IntRep
,
std
::
ratio_multiply
<
std
::
ratio
<146097, 400>,
days
::
period
>>;
57
using
months
=
std
::
chrono
::
duration
<
IntRep
,
std
::
ratio_divide
<
years
::
period
,
std
::
ratio
<12>>>;
58
#
endif
// __cpp_lib_chrono >= 201907L
59
}
// namespace chrono
60
}
// namespace q20
61
62
QT_END_NAMESPACE
63
64
#
endif
/* Q20CHRONO_H */
QDebugStateSaverPrivate
Definition
qdebug.cpp:1397
QDebugStateSaverPrivate::m_noQuotes
const bool m_noQuotes
Definition
qdebug.cpp:1427
QDebugStateSaverPrivate::restoreState
void restoreState()
Definition
qdebug.cpp:1407
QDebugStateSaverPrivate::m_verbosity
const int m_verbosity
Definition
qdebug.cpp:1428
QDebugStateSaverPrivate::m_streamParams
const QTextStreamPrivate::Params m_streamParams
Definition
qdebug.cpp:1431
QDebugStateSaverPrivate::QDebugStateSaverPrivate
QDebugStateSaverPrivate(QDebug::Stream *stream)
Definition
qdebug.cpp:1399
QDebugStateSaverPrivate::m_spaces
const bool m_spaces
Definition
qdebug.cpp:1426
QMetaClassInfo
\inmodule QtCore
Definition
qmetaobject.h:434
QMetaEnum
\inmodule QtCore
Definition
qmetaobject.h:273
QMetaMethod
\inmodule QtCore
Definition
qmetaobject.h:22
QMetaProperty
\inmodule QtCore
Definition
qmetaobject.h:342
QUntypedBindable
\inmodule QtCore
Definition
qproperty.h:754
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
q20::chrono
Definition
q20chrono.h:31
q20
Definition
qnumeric.cpp:467
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
Q_DECLARE_TYPEINFO
Q_DECLARE_TYPEINFO(QByteArrayView, Q_PRIMITIVE_TYPE)
qt_QMetaEnum_debugOperator
QDebug qt_QMetaEnum_debugOperator(QDebug &dbg, qint64 value, const QMetaObject *meta, const char *name)
Definition
qdebug.cpp:1516
putEscapedString
static void putEscapedString(QTextStreamPrivate *d, const Char *begin, size_t length, bool isUnicode=true)
Definition
qdebug.cpp:216
isPrintable
static bool isPrintable(char16_t uc)
Definition
qdebug.cpp:211
timeUnit
static QByteArray timeUnit(qint64 num, qint64 den)
Definition
qdebug.cpp:367
isPrintable
static bool isPrintable(uchar c)
Definition
qdebug.cpp:212
operator<<
QDebug operator<<(QDebug debug, const std::error_code &code)
Definition
qdebug.cpp:584
isPrintable
static bool isPrintable(char32_t ucs4)
Definition
qdebug.cpp:210
qt_QMetaEnum_flagDebugOperator
void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, uint value)
Definition
qdebug.cpp:1465
operator<<
QDebug operator<<(QDebug debug, const std::error_condition &condition)
Definition
qdebug.cpp:599
qtbase
src
corelib
global
q20chrono.h
Generated on
for Qt by
1.18.0