Turn Directions enum into an enum class in serialization converter
Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: Ie1f8ea5e2575427528c19875db7a8e4e27200aec Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
parent
ad63118071
commit
e53d0220da
@ -127,7 +127,7 @@ QString CborDiagnosticDumper::name() const
|
||||
|
||||
Converter::Directions CborDiagnosticDumper::directions() const
|
||||
{
|
||||
return Out;
|
||||
return Direction::Out;
|
||||
}
|
||||
|
||||
Converter::Options CborDiagnosticDumper::outputOptions() const
|
||||
@ -199,7 +199,7 @@ QString CborConverter::name() const
|
||||
|
||||
Converter::Directions CborConverter::directions() const
|
||||
{
|
||||
return InOut;
|
||||
return Direction::InOut;
|
||||
}
|
||||
|
||||
Converter::Options CborConverter::outputOptions() const
|
||||
|
@ -32,7 +32,7 @@ protected:
|
||||
public:
|
||||
static Converter *null;
|
||||
|
||||
enum Direction { In = 1, Out = 2, InOut = In | Out };
|
||||
enum class Direction { In = 1, Out = 2, InOut = In | Out };
|
||||
Q_DECLARE_FLAGS(Directions, Direction)
|
||||
|
||||
enum Option { SupportsArbitraryMapKeys = 0x01 };
|
||||
|
@ -55,7 +55,7 @@ QString DataStreamConverter::name() const
|
||||
|
||||
Converter::Directions DataStreamConverter::directions() const
|
||||
{
|
||||
return InOut;
|
||||
return Direction::InOut;
|
||||
}
|
||||
|
||||
Converter::Options DataStreamConverter::outputOptions() const
|
||||
|
@ -50,7 +50,7 @@ QString DebugTextDumper::name() const
|
||||
|
||||
Converter::Directions DebugTextDumper::directions() const
|
||||
{
|
||||
return Out;
|
||||
return Direction::Out;
|
||||
}
|
||||
|
||||
Converter::Options DebugTextDumper::outputOptions() const
|
||||
|
@ -32,7 +32,7 @@ QString JsonConverter::name() const
|
||||
|
||||
Converter::Directions JsonConverter::directions() const
|
||||
{
|
||||
return InOut;
|
||||
return Direction::InOut;
|
||||
}
|
||||
|
||||
Converter::Options JsonConverter::outputOptions() const
|
||||
|
@ -36,9 +36,9 @@ int main(int argc, char *argv[])
|
||||
for (const Converter *conv : std::as_const(*availableConverters)) {
|
||||
auto direction = conv->directions();
|
||||
QString name = conv->name();
|
||||
if (direction.testFlag(Converter::In))
|
||||
if (direction.testFlag(Converter::Direction::In))
|
||||
inputFormats << name;
|
||||
if (direction.testFlag(Converter::Out))
|
||||
if (direction.testFlag(Converter::Direction::Out))
|
||||
outputFormats << name;
|
||||
}
|
||||
inputFormats.sort();
|
||||
@ -162,7 +162,8 @@ int main(int argc, char *argv[])
|
||||
if (!inconv) {
|
||||
// probe the input to find a file format
|
||||
for (const Converter *conv : std::as_const(*availableConverters)) {
|
||||
if (conv->directions().testFlag(Converter::In) && conv->probeFile(&input)) {
|
||||
if (conv->directions().testFlag(Converter::Direction::In)
|
||||
&& conv->probeFile(&input)) {
|
||||
inconv = conv;
|
||||
break;
|
||||
}
|
||||
@ -177,7 +178,8 @@ int main(int argc, char *argv[])
|
||||
if (!outconv) {
|
||||
// probe the output to find a file format
|
||||
for (const Converter *conv : std::as_const(*availableConverters)) {
|
||||
if (conv->directions().testFlag(Converter::Out) && conv->probeFile(&output)) {
|
||||
if (conv->directions().testFlag(Converter::Direction::Out)
|
||||
&& conv->probeFile(&output)) {
|
||||
outconv = conv;
|
||||
break;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ QString NullConverter::name() const
|
||||
|
||||
Converter::Directions NullConverter::directions() const
|
||||
{
|
||||
return Out;
|
||||
return Direction::Out;
|
||||
}
|
||||
|
||||
Converter::Options NullConverter::outputOptions() const
|
||||
|
@ -51,7 +51,7 @@ QString TextConverter::name() const
|
||||
|
||||
Converter::Directions TextConverter::directions() const
|
||||
{
|
||||
return InOut;
|
||||
return Direction::InOut;
|
||||
}
|
||||
|
||||
Converter::Options TextConverter::outputOptions() const
|
||||
|
@ -403,7 +403,7 @@ QString XmlConverter::name() const
|
||||
|
||||
Converter::Directions XmlConverter::directions() const
|
||||
{
|
||||
return InOut;
|
||||
return Direction::InOut;
|
||||
}
|
||||
|
||||
Converter::Options XmlConverter::outputOptions() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user