Warning, file /system/kjournald/lib/systemdjournalremote.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 SYSTEMDJOURNALREMOTE_H
0007 #define SYSTEMDJOURNALREMOTE_H
0008 
0009 #include "ijournal.h"
0010 #include "kjournald_export.h"
0011 #include <QString>
0012 #include <memory>
0013 
0014 class SystemdJournalRemotePrivate;
0015 class sd_journal;
0016 class QIODevice;
0017 
0018 /**
0019  * @brief The SystemdJournalRemote provides access to a remote journal via the systemd-journal-remote tool
0020  *
0021  */
0022 class KJOURNALD_EXPORT SystemdJournalRemote : public IJournal
0023 {
0024     Q_OBJECT
0025     Q_PROPERTY(QString journalFile READ journalFile NOTIFY journalFileChanged)
0026 public:
0027     /**
0028      * @brief Construct journal object form file containing logs in systemd's journal export format
0029      */
0030     SystemdJournalRemote(const QString &filePath);
0031 
0032     /**
0033      * @brief Construct journal object form file containing logs in systemd's journal export format
0034      */
0035     SystemdJournalRemote(const QString &url, const QString &port);
0036 
0037     /**
0038      * @brief Destroys the journal wrapper
0039      */
0040     ~SystemdJournalRemote() override;
0041 
0042     /**
0043      * @brief Path to journal file that temporarily stores data from remote journal
0044      *
0045      * @note the lifetime of this file is bound to the lifetime of the SystemJournalRemote object that
0046      * relays the remote data to the file.
0047      * @return path to the journald ".journal" file
0048      */
0049     QString journalFile() const;
0050 
0051     /**
0052      * @brief Getter for raw sd_journal pointer
0053      *
0054      * This pointer can be nullptr if an error during opening of journal occured. Test
0055      * with @s isValid() before using.
0056      */
0057     sd_journal *sdJournal() const override;
0058 
0059     /**
0060      * @brief returns true if and only if the sd_journal pointer is valid
0061      */
0062     bool isValid() const override;
0063 
0064     /**
0065      * @copydoc IJournal::currentBootId()
0066      */
0067     QString currentBootId() const override;
0068 
0069     /**
0070      * @brief Get file system usage of journal
0071      * @return size of journal in bytes
0072      */
0073     uint64_t usage() const;
0074 
0075 Q_SIGNALS:
0076     void journalFileChanged();
0077 
0078 private Q_SLOTS:
0079     void handleJournalFileCreated(const QString &path);
0080 
0081 private:
0082     std::unique_ptr<SystemdJournalRemotePrivate> d;
0083 };
0084 
0085 #endif