Changeset View
Changeset View
Standalone View
Standalone View
src/utils/input.h
| Show All 40 Lines | |||||
| 41 | class QString; | 41 | class QString; | ||
| 42 | class QStringList; | 42 | class QStringList; | ||
| 43 | class QByteArray; | 43 | class QByteArray; | ||
| 44 | class QFile; | 44 | class QFile; | ||
| 45 | class QDir; | 45 | class QDir; | ||
| 46 | 46 | | |||
| 47 | namespace Kleo | 47 | namespace Kleo | ||
| 48 | { | 48 | { | ||
| 49 | 49 | class Output; | |||
| 50 | class Input | 50 | class Input | ||
| 51 | { | 51 | { | ||
| 52 | public: | 52 | public: | ||
| 53 | virtual ~Input(); | 53 | virtual ~Input(); | ||
| 54 | 54 | | |||
| 55 | virtual QString label() const = 0; | 55 | virtual QString label() const = 0; | ||
| 56 | virtual void setLabel(const QString &label) = 0; | 56 | virtual void setLabel(const QString &label) = 0; | ||
| 57 | virtual std::shared_ptr<QIODevice> ioDevice() const = 0; | 57 | virtual std::shared_ptr<QIODevice> ioDevice() const = 0; | ||
| 58 | virtual unsigned int classification() const = 0; | 58 | virtual unsigned int classification() const = 0; | ||
| 59 | virtual unsigned long long size() const = 0; | 59 | virtual unsigned long long size() const = 0; | ||
| 60 | virtual QString errorString() const = 0; | 60 | virtual QString errorString() const = 0; | ||
| 61 | void finalize(); // equivalent to ioDevice()->close(); | 61 | void finalize(); // equivalent to ioDevice()->close(); | ||
| 62 | 62 | | |||
| 63 | static std::shared_ptr<Input> createFromPipeDevice(assuan_fd_t fd, const QString &label); | 63 | static std::shared_ptr<Input> createFromPipeDevice(assuan_fd_t fd, const QString &label); | ||
| 64 | static std::shared_ptr<Input> createFromFile(const QString &filename, bool dummy = false); | 64 | static std::shared_ptr<Input> createFromFile(const QString &filename, bool dummy = false); | ||
| 65 | static std::shared_ptr<Input> createFromFile(const std::shared_ptr<QFile> &file); | 65 | static std::shared_ptr<Input> createFromFile(const std::shared_ptr<QFile> &file); | ||
| 66 | static std::shared_ptr<Input> createFromOutput(const std::shared_ptr<Output> &output); // implemented in output.cpp | ||||
| 66 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command); | 67 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command); | ||
| 67 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command, const QStringList &args); | 68 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command, const QStringList &args); | ||
| 68 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command, const QStringList &args, const QDir &workingDirectory); | 69 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command, const QStringList &args, const QDir &workingDirectory); | ||
| 69 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command, const QByteArray &stdin_); | 70 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command, const QByteArray &stdin_); | ||
| 70 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command, const QStringList &args, const QByteArray &stdin_); | 71 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command, const QStringList &args, const QByteArray &stdin_); | ||
| 71 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command, const QStringList &args, const QDir &workingDirectory, const QByteArray &stdin_); | 72 | static std::shared_ptr<Input> createFromProcessStdOut(const QString &command, const QStringList &args, const QDir &workingDirectory, const QByteArray &stdin_); | ||
| 72 | #ifndef QT_NO_CLIPBOARD | 73 | #ifndef QT_NO_CLIPBOARD | ||
| 73 | static std::shared_ptr<Input> createFromClipboard(); | 74 | static std::shared_ptr<Input> createFromClipboard(); | ||
| 74 | #endif | 75 | #endif | ||
| 75 | }; | 76 | }; | ||
| 76 | } | 77 | } | ||
| 77 | 78 | | |||
| 78 | #endif /* __KLEOPATRA_UTILS_INPUT_H__ */ | 79 | #endif /* __KLEOPATRA_UTILS_INPUT_H__ */ | ||
| 79 | 80 | | |||