swift
samplesvpilotrules.cpp
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
6 
7 #include "samplesvpilotrules.h"
8 
9 #include <QScopedPointer>
10 #include <QStringList>
11 #include <QTextStream>
12 #include <QtGlobal>
13 
14 #include "misc/registermetadata.h"
17 #include "misc/stringutils.h"
18 
19 using namespace swift::misc;
20 using namespace swift::misc::simulation;
21 using namespace swift::misc::simulation::fscommon;
22 
23 namespace swift::sample
24 {
25 
26  /*
27  * Samples
28  */
29  void CSamplesVPilotRules::samples(QTextStream &streamOut, const QTextStream &streamIn)
30  {
32  QScopedPointer<CVPilotRulesReader> vPilotReader(new CVPilotRulesReader());
33  bool s = vPilotReader->read(false);
34  streamOut << "Read success: " << swift::misc::boolToYesNo(s) << Qt::endl;
35  streamOut << "Read " << vPilotReader->countRulesLoaded() << " rules from " << vPilotReader->countFilesLoaded()
36  << " files" << Qt::endl;
37  streamOut << "Distributors: " << vPilotReader->getRules().getSortedDistributors().join(", ");
38 
39  Q_UNUSED(streamIn);
40  }
41 
42 } // namespace swift::sample
Free functions in swift::misc.
void registerMetadata()
Register all relevant metadata in Misc.
SWIFT_MISC_EXPORT const QString & boolToYesNo(bool v)
Bool to yes/no.