2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 Lorenz Haas
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2014-05-11 19:59:46 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2014-05-11 19:59:46 +02:00
|
|
|
|
2018-08-29 14:36:47 +02:00
|
|
|
#include "texteditor_global.h"
|
|
|
|
|
|
2023-02-07 18:02:53 +01:00
|
|
|
#include <utils/filepath.h>
|
2014-05-11 19:59:46 +02:00
|
|
|
|
2018-08-29 14:36:47 +02:00
|
|
|
namespace TextEditor {
|
2014-05-11 19:59:46 +02:00
|
|
|
|
2018-08-29 14:36:47 +02:00
|
|
|
class TEXTEDITOR_EXPORT Command
|
2014-05-11 19:59:46 +02:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
enum Processing {
|
|
|
|
|
FileProcessing,
|
|
|
|
|
PipeProcessing
|
|
|
|
|
};
|
|
|
|
|
|
2015-09-17 21:27:25 +02:00
|
|
|
bool isValid() const;
|
|
|
|
|
|
2023-02-07 18:02:53 +01:00
|
|
|
Utils::FilePath executable() const;
|
|
|
|
|
void setExecutable(const Utils::FilePath &executable);
|
2014-05-11 19:59:46 +02:00
|
|
|
|
|
|
|
|
QStringList options() const;
|
|
|
|
|
void addOption(const QString &option);
|
2022-11-03 15:20:13 +03:00
|
|
|
void addOptions(const QStringList &options);
|
2014-05-11 19:59:46 +02:00
|
|
|
|
|
|
|
|
Processing processing() const;
|
|
|
|
|
void setProcessing(const Processing &processing);
|
|
|
|
|
|
|
|
|
|
bool pipeAddsNewline() const;
|
|
|
|
|
void setPipeAddsNewline(bool pipeAddsNewline);
|
|
|
|
|
|
2014-07-09 08:59:38 +02:00
|
|
|
bool returnsCRLF() const;
|
|
|
|
|
void setReturnsCRLF(bool returnsCRLF);
|
|
|
|
|
|
2014-05-11 19:59:46 +02:00
|
|
|
private:
|
2023-02-07 18:02:53 +01:00
|
|
|
Utils::FilePath m_executable;
|
2014-05-11 19:59:46 +02:00
|
|
|
QStringList m_options;
|
2016-04-21 21:08:57 +02:00
|
|
|
Processing m_processing = FileProcessing;
|
|
|
|
|
bool m_pipeAddsNewline = false;
|
|
|
|
|
bool m_returnsCRLF = false;
|
2014-05-11 19:59:46 +02:00
|
|
|
};
|
|
|
|
|
|
2018-08-29 14:36:47 +02:00
|
|
|
} // namespace TextEditor
|