2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2018 Intel Corporation.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2018-01-19 23:30:24 +00:00
|
|
|
|
|
|
|
#include "nullconverter.h"
|
|
|
|
|
2023-08-25 14:04:41 +00:00
|
|
|
using namespace Qt::StringLiterals;
|
|
|
|
|
2018-01-19 23:30:24 +00:00
|
|
|
static NullConverter nullConverter;
|
2023-10-31 15:10:55 +00:00
|
|
|
bool Converter::isNull(const Converter *converter)
|
|
|
|
{
|
|
|
|
return converter == &nullConverter;
|
|
|
|
}
|
2018-01-19 23:30:24 +00:00
|
|
|
|
2023-09-01 11:34:26 +00:00
|
|
|
QString NullConverter::name() const
|
2018-01-19 23:30:24 +00:00
|
|
|
{
|
2023-08-25 14:04:41 +00:00
|
|
|
return "null"_L1;
|
2018-01-19 23:30:24 +00:00
|
|
|
}
|
|
|
|
|
2023-09-04 12:37:25 +00:00
|
|
|
Converter::Directions NullConverter::directions() const
|
2018-01-19 23:30:24 +00:00
|
|
|
{
|
2023-09-05 13:37:20 +00:00
|
|
|
return Direction::Out;
|
2018-01-19 23:30:24 +00:00
|
|
|
}
|
|
|
|
|
2023-09-01 11:34:26 +00:00
|
|
|
Converter::Options NullConverter::outputOptions() const
|
2018-01-19 23:30:24 +00:00
|
|
|
{
|
|
|
|
return SupportsArbitraryMapKeys;
|
|
|
|
}
|
|
|
|
|
2023-09-01 11:34:26 +00:00
|
|
|
void NullConverter::saveFile(QIODevice *f, const QVariant &contents,
|
|
|
|
const QStringList &options) const
|
2018-01-19 23:30:24 +00:00
|
|
|
{
|
|
|
|
if (!options.isEmpty()) {
|
2023-10-19 14:16:52 +00:00
|
|
|
qFatal("Unknown option '%s' to null output. This format has no options.",
|
|
|
|
qPrintable(options.first()));
|
2018-01-19 23:30:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Q_UNUSED(f);
|
|
|
|
Q_UNUSED(contents);
|
|
|
|
}
|