#pragma once #include "bcu_types.h" #include "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); }