2017-12-20 14:39:09 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
2014-06-18 18:05:04 +02:00
|
|
|
*
|
|
|
|
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
2017-09-06 13:51:22 +02:00
|
|
|
* Copyright 2017, Adriaan de Groot <groot@kde.org>
|
2014-06-18 18:05:04 +02:00
|
|
|
*
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calamares is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef YAMLUTILS_H
|
|
|
|
#define YAMLUTILS_H
|
|
|
|
|
|
|
|
#include <QStringList>
|
2015-03-27 11:59:27 +01:00
|
|
|
#include <QVariant>
|
2014-06-18 18:05:04 +02:00
|
|
|
|
2017-09-06 13:51:22 +02:00
|
|
|
class QByteArray;
|
|
|
|
|
2014-06-18 18:05:04 +02:00
|
|
|
namespace YAML
|
|
|
|
{
|
|
|
|
class Node;
|
2017-09-06 13:51:22 +02:00
|
|
|
class Exception;
|
2014-06-18 18:05:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void operator>>( const YAML::Node& node, QStringList& v );
|
|
|
|
|
2014-07-14 18:10:24 +02:00
|
|
|
namespace CalamaresUtils
|
|
|
|
{
|
|
|
|
|
|
|
|
QVariant yamlToVariant( const YAML::Node& node );
|
|
|
|
QVariant yamlScalarToVariant( const YAML::Node& scalarNode );
|
|
|
|
QVariant yamlSequenceToVariant( const YAML::Node& sequenceNode );
|
|
|
|
QVariant yamlMapToVariant( const YAML::Node& mapNode );
|
|
|
|
|
2017-09-06 13:51:22 +02:00
|
|
|
/**
|
|
|
|
* Given an exception from the YAML parser library, explain
|
|
|
|
* what is going on in terms of the data passed to the parser.
|
|
|
|
* Uses @p label when labeling the data source (e.g. "netinstall data")
|
|
|
|
*/
|
|
|
|
void explainYamlException( const YAML::Exception& e, const QByteArray& data, const char *label );
|
|
|
|
|
2014-07-14 18:10:24 +02:00
|
|
|
} //ns
|
|
|
|
|
2014-06-18 18:05:04 +02:00
|
|
|
#endif // YAMLUTILS_H
|