Warning, file /system/kjournald/lib/ijournal.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-License-Identifier: LGPL-2.1-or-later OR MIT
0003     SPDX-FileCopyrightText: 2021 Andreas Cord-Landwehr <cordlandwehr@kde.org>
0004 */
0005 
0006 #ifndef IJOURNAL_H
0007 #define IJOURNAL_H
0008 
0009 #include "kjournald_export.h"
0010 #include <QObject>
0011 #include <QString>
0012 
0013 class sd_journal;
0014 
0015 /**
0016  * @brief Interface class for all journal types
0017  */
0018 class KJOURNALD_EXPORT IJournal : public QObject
0019 {
0020     Q_OBJECT
0021 public:
0022     /**
0023      * @brief Construct journal object for system journald DB
0024      */
0025     explicit IJournal() = default;
0026 
0027     /**
0028      * @brief Destroys the journal wrapper
0029      */
0030     virtual ~IJournal() = default;
0031 
0032     /**
0033      * @brief Getter for raw sd_journ“al pointer
0034      *
0035      * This pointer can be nullptr if an error during opening of journal occured. Test
0036      * with @s isValid() before using.
0037      */
0038     virtual sd_journal *sdJournal() const = 0;
0039 
0040     /**
0041      * @brief returns true if and only if the sd_journal pointer is valid
0042      *
0043      * This method shall be used to check of the journal is ready to be used
0044      */
0045     virtual bool isValid() const = 0;
0046 
0047     /**
0048      * @return ID for the current boot (b0) of the system, empty string if none is current
0049      */
0050     virtual QString currentBootId() const = 0;
0051 
0052 Q_SIGNALS:
0053     /**
0054      * @brief signal is fired when new entries are added to the journal
0055      * @param bootId the ID for the boot to which entries are added
0056      */
0057     void journalUpdated(const QString &bootId);
0058 };
0059 
0060 #endif // IJOURNAL_H