43 lines
1.2 KiB
C++
Executable File
43 lines
1.2 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Read bsm xml config file
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Gerlinde Rudolphus, SLSA, 2013-03-05
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "bcu_types.h"
|
|
#include <BuildingControlUnit/buildingcontrolcommon_export.h>
|
|
|
|
class QDomElement;
|
|
|
|
namespace BuildingControlUnit
|
|
{
|
|
class XmlReaderException : public std::exception
|
|
{
|
|
public:
|
|
explicit XmlReaderException(const QString &msg) noexcept
|
|
: m_msg(msg.toUtf8())
|
|
{}
|
|
|
|
~XmlReaderException() = default;
|
|
|
|
virtual const char *what() const noexcept
|
|
{
|
|
return m_msg.data();
|
|
}
|
|
private:
|
|
QByteArray m_msg;
|
|
};
|
|
|
|
BUILDINGCONTROLCOMMON_EXPORT QDomElement readFile(const QString &fn, const QString &rootTag);
|
|
BUILDINGCONTROLCOMMON_EXPORT bool hasTagText(const QDomElement &element, const QString &tagName);
|
|
BUILDINGCONTROLCOMMON_EXPORT QString getTagText(const QDomElement &element, const QString &tagName, bool bOptional = false);
|
|
BUILDINGCONTROLCOMMON_EXPORT QString getAttribute(const QDomElement &element, const QString &attributeName, bool bOptional = false);
|
|
BUILDINGCONTROLCOMMON_EXPORT bool parseBuildingConfigXml(const QString &fn, BuildingBsmConfig &bsmCfg, BuildingEgcuConfig &egcuConfig);
|
|
|
|
} // BuildingControlUnit
|