From 9b4bfa8b4e60312886491b7fd218e6db667eee0d Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 29 Mar 2025 04:16:21 +0000 Subject: [PATCH] Designated initialisation for biref target descriptor objects --- build/scripts/GenerateBriefTargetDescriptors.php | 10 +++++++++- src/Targets/BriefTargetDescriptor.hpp | 14 +------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/build/scripts/GenerateBriefTargetDescriptors.php b/build/scripts/GenerateBriefTargetDescriptors.php index d461fd6b..babfdfd1 100644 --- a/build/scripts/GenerateBriefTargetDescriptors.php +++ b/build/scripts/GenerateBriefTargetDescriptors.php @@ -44,7 +44,15 @@ $xmlService = new XmlService(); $xmlFiles = $discoveryService->findTargetDescriptionFiles(TDF_DIR_PATH); print count($xmlFiles) . ' target description files found in ' . TDF_DIR_PATH . PHP_EOL . PHP_EOL; -const MAP_ENTRY_TEMPLATE = '{"@CONFIG_VALUE@", {"@TARGET_NAME@", "@CONFIG_VALUE@", @TARGET_FAMILY@, "@TDF_PATH@"}}'; +const MAP_ENTRY_TEMPLATE = '{ + "@CONFIG_VALUE@", + { + .name = "@TARGET_NAME@", + .configValue = "@CONFIG_VALUE@", + .family = @TARGET_FAMILY@, + .relativeTdfPath = "@TDF_PATH@" + } +}'; $entries = []; diff --git a/src/Targets/BriefTargetDescriptor.hpp b/src/Targets/BriefTargetDescriptor.hpp index 4f3e1322..a296db56 100644 --- a/src/Targets/BriefTargetDescriptor.hpp +++ b/src/Targets/BriefTargetDescriptor.hpp @@ -34,20 +34,8 @@ namespace Targets TargetFamily family; /** - * The file path to to the target's TDF, relative to Bloom's TDF directory. + * The file path to the target's TDF, relative to Bloom's TDF directory. */ std::string relativeTdfPath; - - constexpr BriefTargetDescriptor( - const std::string& name, - const std::string& configValue, - TargetFamily family, - const std::string& relativeTdfPath - ) - : name(name) - , configValue(configValue) - , family(family) - , relativeTdfPath(relativeTdfPath) - {} }; }