Warning, file /system/kpmcore/src/core/smartparser.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     SPDX-FileCopyrightText: 2018 Caio Jordão Carvalho <caiojcarvalho@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #ifndef KPMCORE_SMARTPARSER_H
0008 #define KPMCORE_SMARTPARSER_H
0009 
0010 #include <QJsonDocument>
0011 #include <QString>
0012 
0013 class SmartDiskInformation;
0014 
0015 /** A parser to SMART JSON output.
0016 
0017     Responsible to execute smartctl and parse its output.
0018 
0019     @author Caio Jordão Carvalho <caiojcarvalho@gmail.com>
0020 */
0021 class SmartParser
0022 {
0023 public:
0024     explicit SmartParser(const QString &device_path);
0025     ~SmartParser();
0026 
0027 public:
0028     bool init();
0029 
0030 public:
0031     const QString &devicePath() const
0032     {
0033         return m_DevicePath; /**< @return the device path that SMART must analyze */
0034     }
0035 
0036     SmartDiskInformation *diskInformation() const
0037     {
0038         return m_DiskInformation; /**< @return a reference to parsed disk information */
0039     }
0040 
0041 protected:
0042     void loadSmartOutput();
0043 
0044     void loadAttributes();
0045 
0046 private:
0047     const QString m_DevicePath;
0048     QJsonDocument m_SmartOutput;
0049     SmartDiskInformation *m_DiskInformation;
0050 
0051 };
0052 
0053 #endif // SMARTPARSER_H