File indexing completed on 2024-05-05 17:43:12

0001 /*
0002  *   SPDX-FileCopyrightText: 2017 Ivan Cukic <ivan.cukic (at) kde.org>
0003  *
0004  *   SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 #ifndef PLASMAVAULT_KDED_ENGINE_COMMON_TYPES_H
0008 #define PLASMAVAULT_KDED_ENGINE_COMMON_TYPES_H
0009 
0010 #include <QHash>
0011 #include <QString>
0012 
0013 #define PLASMAVAULT_CONFIG_FILE QStringLiteral("plasmavaultrc")
0014 
0015 namespace PlasmaVault
0016 {
0017 class Device
0018 {
0019 public:
0020     explicit Device(const QString &device = QString());
0021     QString data() const;
0022 
0023 private:
0024     QString m_device;
0025 };
0026 
0027 inline uint qHash(const Device &value, uint seed = 0)
0028 {
0029     return qHash(value.data(), seed);
0030 }
0031 
0032 inline bool operator==(const Device &left, const Device &right)
0033 {
0034     return left.data() == right.data();
0035 }
0036 
0037 class MountPoint
0038 {
0039 public:
0040     explicit MountPoint(const QString &mountPoint = QString());
0041     QString data() const;
0042 
0043     inline bool isEmpty() const
0044     {
0045         return m_mountPoint.isEmpty();
0046     }
0047 
0048 private:
0049     QString m_mountPoint;
0050 };
0051 
0052 } // namespace PlasmaVault
0053 
0054 #endif // include guard