2022-10-05 19:08:53 +02:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
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
|
2022-10-05 19:08:53 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "vcsbase_global.h"
|
|
|
|
|
|
|
|
|
|
namespace VcsBase {
|
|
|
|
|
|
|
|
|
|
enum class RunFlags {
|
2022-12-09 13:59:12 +01:00
|
|
|
None = 0, // Empty.
|
2023-05-09 22:49:14 +02:00
|
|
|
// Process related
|
2022-10-06 15:06:09 +02:00
|
|
|
MergeOutputChannels = (1 << 0), // See QProcess::ProcessChannelMode::MergedChannels.
|
|
|
|
|
ForceCLocale = (1 << 1), // Force C-locale, sets LANG and LANGUAGE env vars to "C".
|
|
|
|
|
UseEventLoop = (1 << 2), // Use event loop when executed in UI thread with
|
|
|
|
|
// runBlocking().
|
2022-10-06 14:39:49 +02:00
|
|
|
// Decorator related
|
2022-10-06 15:06:09 +02:00
|
|
|
SuppressStdErr = (1 << 3), // Suppress standard error output.
|
|
|
|
|
SuppressFailMessage = (1 << 4), // No message about command failure.
|
|
|
|
|
SuppressCommandLogging = (1 << 5), // No starting command log entry.
|
|
|
|
|
ShowSuccessMessage = (1 << 6), // Show message about successful completion of command.
|
|
|
|
|
ShowStdOut = (1 << 7), // Show standard output.
|
2022-12-09 13:59:12 +01:00
|
|
|
ProgressiveOutput = (1 << 8), // Emit stdOutText() and stdErrText() signals.
|
|
|
|
|
ExpectRepoChanges = (1 << 9), // Expect changes in repository by the command.
|
2022-10-06 14:39:49 +02:00
|
|
|
NoOutput = SuppressStdErr | SuppressFailMessage | SuppressCommandLogging
|
2022-10-05 19:08:53 +02:00
|
|
|
};
|
|
|
|
|
|
2022-10-27 09:09:06 +03:00
|
|
|
inline void operator|=(RunFlags &p, RunFlags r)
|
2022-10-05 19:08:53 +02:00
|
|
|
{
|
|
|
|
|
p = RunFlags(int(p) | int(r));
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-27 09:09:06 +03:00
|
|
|
inline RunFlags operator|(RunFlags p, RunFlags r)
|
2022-10-05 19:08:53 +02:00
|
|
|
{
|
|
|
|
|
return RunFlags(int(p) | int(r));
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-27 09:09:06 +03:00
|
|
|
inline void operator&=(RunFlags &p, RunFlags r)
|
2022-10-05 19:08:53 +02:00
|
|
|
{
|
|
|
|
|
p = RunFlags(int(p) & int(r));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Note, that it returns bool, not RunFlags.
|
|
|
|
|
// It's only meant for testing whether a specific bit is set.
|
2022-10-27 09:09:06 +03:00
|
|
|
inline bool operator&(RunFlags p, RunFlags r)
|
2022-10-05 19:08:53 +02:00
|
|
|
{
|
|
|
|
|
return bool(int(p) & int(r));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace VcsBase
|