File indexing completed on 2024-05-12 05:50:21
0001 /* 0002 SPDX-FileCopyrightText: 2011 Luke Shumaker <lukeshu@sbcglobal.net> 0003 SPDX-FileCopyrightText: 2016 Elvis Angelaccio <elvis.angelaccio@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef CLIPLUGIN_H 0009 #define CLIPLUGIN_H 0010 0011 #include "cliinterface.h" 0012 0013 class CliPlugin : public Kerfuffle::CliInterface 0014 { 0015 Q_OBJECT 0016 0017 public: 0018 explicit CliPlugin(QObject *parent, const QVariantList &args); 0019 ~CliPlugin() override; 0020 0021 bool list() override; 0022 bool 0023 extractFiles(const QVector<Kerfuffle::Archive::Entry *> &files, const QString &destinationDirectory, const Kerfuffle::ExtractionOptions &options) override; 0024 void resetParsing() override; 0025 bool readListLine(const QString &line) override; 0026 bool readExtractLine(const QString &line) override; 0027 bool isPasswordPrompt(const QString &line) override; 0028 0029 /** 0030 * Fill the lsar's json output all in once (useful for unit testing). 0031 */ 0032 void setJsonOutput(const QString &jsonOutput); 0033 0034 protected Q_SLOTS: 0035 void readStdout(bool handleAll = false) override; 0036 0037 protected: 0038 bool handleLine(const QString &line) override; 0039 0040 private Q_SLOTS: 0041 void processFinished(int exitCode, QProcess::ExitStatus exitStatus) override; 0042 0043 private: 0044 void setupCliProperties(); 0045 void readJsonOutput(); 0046 0047 QString m_jsonOutput; 0048 }; 0049 0050 #endif // CLIPLUGIN_H