/** * Json <-> DDS conversion routines * $Id$ * $HeadURL$ * $Author$ * Created by Christian Ehrlicher, SLSE, 2017-11-30 */ // filename: pdm_json.h #pragma once #include "pdm.hpp" #include "pdm_export.h" #include #include namespace ProjectDataManagement { template struct type{}; template T fromJson(const QJsonValue &val, type); template T fromJson(const QJsonValue &val) { return fromJson(val, type{}); } // BiteComponentText PDM_COMMON_EXPORT QJsonObject toJson(const BiteComponentText &element); template<> PDM_COMMON_EXPORT BiteComponentText fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< BiteComponentText > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< BiteComponentText > >); // BuildingChargeEffect PDM_COMMON_EXPORT QJsonObject toJson(const BuildingChargeEffect &element); template<> PDM_COMMON_EXPORT BuildingChargeEffect fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< BuildingChargeEffect > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< BuildingChargeEffect > >); // CanComponentString PDM_COMMON_EXPORT QJsonObject toJson(const CanComponentString &element); template<> PDM_COMMON_EXPORT CanComponentString fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< CanComponentString > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< CanComponentString > >); // ChargeType PDM_COMMON_EXPORT QJsonObject toJson(const ChargeType &element); template<> PDM_COMMON_EXPORT ChargeType fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< ChargeType > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< ChargeType > >); // ChargeTypeIgniterTypeIgniterFunction PDM_COMMON_EXPORT QJsonObject toJson(const ChargeTypeIgniterTypeIgniterFunction &element); template<> PDM_COMMON_EXPORT ChargeTypeIgniterTypeIgniterFunction fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< ChargeTypeIgniterTypeIgniterFunction > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< ChargeTypeIgniterTypeIgniterFunction > >); // ChargeTypeLoadType PDM_COMMON_EXPORT QJsonObject toJson(const ChargeTypeLoadType &element); template<> PDM_COMMON_EXPORT ChargeTypeLoadType fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< ChargeTypeLoadType > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< ChargeTypeLoadType > >); // EquipmentSystemEventFilter PDM_COMMON_EXPORT QJsonObject toJson(const EquipmentSystemEventFilter &element); template<> PDM_COMMON_EXPORT EquipmentSystemEventFilter fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< EquipmentSystemEventFilter > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< EquipmentSystemEventFilter > >); // EventFilterHgrMineSearch PDM_COMMON_EXPORT QJsonObject toJson(const EventFilterHgrMineSearch &element); template<> PDM_COMMON_EXPORT EventFilterHgrMineSearch fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< EventFilterHgrMineSearch > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< EventFilterHgrMineSearch > >); // FirePurpose PDM_COMMON_EXPORT QJsonObject toJson(const FirePurpose &element); template<> PDM_COMMON_EXPORT FirePurpose fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< FirePurpose > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< FirePurpose > >); // GearType PDM_COMMON_EXPORT QJsonObject toJson(const GearType &element); template<> PDM_COMMON_EXPORT GearType fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< GearType > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< GearType > >); // GearTypeChargeType PDM_COMMON_EXPORT QJsonObject toJson(const GearTypeChargeType &element); template<> PDM_COMMON_EXPORT GearTypeChargeType fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< GearTypeChargeType > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< GearTypeChargeType > >); // IgniterFunction PDM_COMMON_EXPORT QJsonObject toJson(const IgniterFunction &element); template<> PDM_COMMON_EXPORT IgniterFunction fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< IgniterFunction > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< IgniterFunction > >); // IgniterType PDM_COMMON_EXPORT QJsonObject toJson(const IgniterType &element); template<> PDM_COMMON_EXPORT IgniterType fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< IgniterType > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< IgniterType > >); // LanguageHmi PDM_COMMON_EXPORT QJsonObject toJson(const LanguageHmi &element); template<> PDM_COMMON_EXPORT LanguageHmi fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< LanguageHmi > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< LanguageHmi > >); // LanguageXdu PDM_COMMON_EXPORT QJsonObject toJson(const LanguageXdu &element); template<> PDM_COMMON_EXPORT LanguageXdu fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< LanguageXdu > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< LanguageXdu > >); // LoadType PDM_COMMON_EXPORT QJsonObject toJson(const LoadType &element); template<> PDM_COMMON_EXPORT LoadType fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< LoadType > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< LoadType > >); // NuclearPreset PDM_COMMON_EXPORT QJsonObject toJson(const NuclearPreset &element); template<> PDM_COMMON_EXPORT NuclearPreset fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< NuclearPreset > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< NuclearPreset > >); // PdmBase PDM_COMMON_EXPORT QJsonObject toJson(const PdmBase &element); template<> PDM_COMMON_EXPORT PdmBase fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< PdmBase > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< PdmBase > >); // PdmBaseName PDM_COMMON_EXPORT QJsonObject toJson(const PdmBaseName &element); template<> PDM_COMMON_EXPORT PdmBaseName fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< PdmBaseName > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< PdmBaseName > >); // RadioGroup PDM_COMMON_EXPORT QJsonObject toJson(const RadioGroup &element); template<> PDM_COMMON_EXPORT RadioGroup fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< RadioGroup > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< RadioGroup > >); // SanitationInjury PDM_COMMON_EXPORT QJsonObject toJson(const SanitationInjury &element); template<> PDM_COMMON_EXPORT SanitationInjury fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationInjury > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< SanitationInjury > >); // SanitationInjuryKind PDM_COMMON_EXPORT QJsonObject toJson(const SanitationInjuryKind &element); template<> PDM_COMMON_EXPORT SanitationInjuryKind fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationInjuryKind > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< SanitationInjuryKind > >); // SanitationInjuryPlace1 PDM_COMMON_EXPORT QJsonObject toJson(const SanitationInjuryPlace1 &element); template<> PDM_COMMON_EXPORT SanitationInjuryPlace1 fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationInjuryPlace1 > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< SanitationInjuryPlace1 > >); // SanitationInjuryPlace2 PDM_COMMON_EXPORT QJsonObject toJson(const SanitationInjuryPlace2 &element); template<> PDM_COMMON_EXPORT SanitationInjuryPlace2 fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationInjuryPlace2 > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< SanitationInjuryPlace2 > >); // SanitationMaterial PDM_COMMON_EXPORT QJsonObject toJson(const SanitationMaterial &element); template<> PDM_COMMON_EXPORT SanitationMaterial fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationMaterial > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< SanitationMaterial > >); // SanitationProcedure PDM_COMMON_EXPORT QJsonObject toJson(const SanitationProcedure &element); template<> PDM_COMMON_EXPORT SanitationProcedure fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationProcedure > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< SanitationProcedure > >); // TargetSubType PDM_COMMON_EXPORT QJsonObject toJson(const TargetSubType &element); template<> PDM_COMMON_EXPORT TargetSubType fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< TargetSubType > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< TargetSubType > >); // TargetType PDM_COMMON_EXPORT QJsonObject toJson(const TargetType &element); template<> PDM_COMMON_EXPORT TargetType fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< TargetType > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< TargetType > >); // TargetTypeTargetSubType PDM_COMMON_EXPORT QJsonObject toJson(const TargetTypeTargetSubType &element); template<> PDM_COMMON_EXPORT TargetTypeTargetSubType fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< TargetTypeTargetSubType > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< TargetTypeTargetSubType > >); // TranslationBlob PDM_COMMON_EXPORT QJsonObject toJson(const TranslationBlob &element); template<> PDM_COMMON_EXPORT TranslationBlob fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< TranslationBlob > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< TranslationBlob > >); // VulnerabilityKind PDM_COMMON_EXPORT QJsonObject toJson(const VulnerabilityKind &element); template<> PDM_COMMON_EXPORT VulnerabilityKind fromJson(const QJsonValue &val, type); PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< VulnerabilityKind > &element); template<> PDM_COMMON_EXPORT std::vector fromJson(const QJsonValue &value, type< std::vector< VulnerabilityKind > >); // // extensions to support sequence of seqence of Non-POD : // } // namespace ProjectDataManagement