1 | // SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. |
---|---|
2 | // |
3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | |
5 | #ifndef LOGUTILS_H |
6 | #define LOGUTILS_H |
7 | |
8 | #include "framework/framework_global.h" |
9 | |
10 | #include <QString> |
11 | #include <QDateTime> |
12 | |
13 | DPF_BEGIN_NAMESPACE |
14 | |
15 | class LogUtils final |
16 | { |
17 | public: |
18 | explicit LogUtils() = delete; |
19 | static void checkAppCacheLogDir(const QString &subDirName = ""); |
20 | static QString appCacheLogPath(); |
21 | static QString localDateTime(); |
22 | static QString localDate(); |
23 | static QString localDataTimeCSV(); |
24 | static uint lastTimeStamp(const QDateTime &dateTime, uint dayCount); |
25 | static QDateTime lastDateTime(const QDateTime &dateTime, uint dayCount); |
26 | static bool containLastDay(const QDateTime &src, const QDateTime &dst, uint dayCount); |
27 | static QDateTime toDayZero(); |
28 | }; |
29 | |
30 | DPF_END_NAMESPACE |
31 | |
32 | #endif // LOGUTILS_H |
33 |