1#ifndef QUAZIP_QT_COMPAT_H
2#define QUAZIP_QT_COMPAT_H
13#include <QtCore/QtGlobal>
17#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
18# include <QtCore5Compat/QTextCodec>
20# include <QtCore/QTextCodec>
26#if (QT_VERSION >= 0x050100)
27#include <QtCore/QSaveFile>
28inline bool quazip_close(
QIODevice *device) {
29 QSaveFile *file = qobject_cast<QSaveFile*>(device);
30 if (file !=
nullptr) {
38inline bool quazip_close(
QIODevice *device) {
45#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
46using Qt::SkipEmptyParts;
48#include <QtCore/QString>
49const auto SkipEmptyParts = QString::SplitBehavior::SkipEmptyParts;
53#include <QtCore/QList>
54#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
56template<
typename T,
typename C>
57inline void quazip_sort(T begin, T end, C comparator) {
58 std::sort(begin, end, comparator);
61#include <QtCore/QtAlgorithms>
62template<
typename T,
typename C>
63inline void quazip_sort(T begin, T end, C comparator) {
64 qSort(begin, end, comparator);
69#include <QtCore/QDateTime>
70#include <QtCore/QFileInfo>
71#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
82#include <QtCore/QFileInfo>
83#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
84inline bool quazip_is_symlink(
const QFileInfo &fi) {
85 return fi.isSymbolicLink();
88inline bool quazip_is_symlink(
const QFileInfo &fi) {
95#include <QtCore/QFileInfo>
96#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
107#include <QtCore/QDateTime>
108#if (QT_VERSION >= 0x040700)
109inline quint64 quazip_ntfs_ticks(
const QDateTime &time,
int fineTicks) {
111 return base.msecsTo(time) * 10000 + fineTicks;
114inline quint64 quazip_ntfs_ticks(
const QDateTime &time,
int fineTicks) {
117 return (
static_cast<qint64
>(base.date().daysTo(utc.
date()))
118 * Q_INT64_C(86400000)
119 +
static_cast<qint64
>(base.time().msecsTo(utc.
time())))
120 * Q_INT64_C(10000) + fineTicks;
125#include <QtCore/QDateTime>
126#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
127inline qint64 quazip_to_time64_t(
const QDateTime &time) {
131inline qint64 quazip_to_time64_t(
const QDateTime &time) {
132 return static_cast<qint64
>(time.
toTime_t());
136#include <QtCore/QTextStream>
138#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
139const auto quazip_endl = Qt::endl;
141const auto quazip_endl = endl;
uint toTime_t() const const
qint64 toSecsSinceEpoch() const const
QDateTime toUTC() const const
QDateTime created() const const
QString readLink() const const
QDateTime birthTime() const const
bool isSymLink() const const
QString symLinkTarget() const const