Tidying
This commit is contained in:
@@ -37,18 +37,17 @@ namespace Targets::TargetDescription
|
||||
}
|
||||
|
||||
TargetFamily TargetDescriptionFile::getFamily() const {
|
||||
static const auto familiesByName = std::map<std::string, TargetFamily> {
|
||||
{"AVR8", TargetFamily::AVR_8},
|
||||
{"RISCV", TargetFamily::RISC_V},
|
||||
};
|
||||
const auto& family = this->deviceAttribute("family");
|
||||
|
||||
const auto familyIt = familiesByName.find(this->deviceAttribute("family"));
|
||||
|
||||
if (familyIt == familiesByName.end()) {
|
||||
throw InvalidTargetDescriptionDataException("Failed to resolve target family - invalid family name");
|
||||
if (family == "AVR8") {
|
||||
return TargetFamily::AVR_8;
|
||||
}
|
||||
|
||||
return familyIt->second;
|
||||
if (family == "RISCV") {
|
||||
return TargetFamily::RISC_V;
|
||||
}
|
||||
|
||||
throw InvalidTargetDescriptionDataException("Failed to resolve target family - invalid family name");
|
||||
}
|
||||
|
||||
std::optional<std::reference_wrapper<const PropertyGroup>> TargetDescriptionFile::tryGetPropertyGroup(
|
||||
|
||||
@@ -135,77 +135,14 @@ namespace Targets::TargetDescription
|
||||
|
||||
static PropertyGroup propertyGroupFromXml(const QDomElement& xmlElement);
|
||||
static Property propertyFromXml(const QDomElement& xmlElement);
|
||||
|
||||
/**
|
||||
* Constructs an AddressSpace object from an XML element.
|
||||
*
|
||||
* @param xmlElement
|
||||
* @return
|
||||
*/
|
||||
static AddressSpace addressSpaceFromXml(const QDomElement& xmlElement);
|
||||
|
||||
/**
|
||||
* Constructs a MemorySegment object from an XML element.
|
||||
*
|
||||
* @param xmlElement
|
||||
* @return
|
||||
*/
|
||||
static MemorySegment memorySegmentFromXml(const QDomElement& xmlElement);
|
||||
|
||||
/**
|
||||
* Constructs a MemorySegmentSection from an XML element.
|
||||
*
|
||||
* @param xmlElement
|
||||
* @return
|
||||
*/
|
||||
static MemorySegmentSection memorySegmentSectionFromXml(const QDomElement& xmlElement);
|
||||
|
||||
/**
|
||||
* Constructs a PhysicalInterface from al XML element.
|
||||
*
|
||||
* @param xmlElement
|
||||
* @return
|
||||
*/
|
||||
static PhysicalInterface physicalInterfaceFromXml(const QDomElement& xmlElement);
|
||||
|
||||
/**
|
||||
* Constructs a Module object from an XML element.
|
||||
*
|
||||
* @param xmlElement
|
||||
* @return
|
||||
*/
|
||||
static Module moduleFromXml(const QDomElement& xmlElement);
|
||||
|
||||
/**
|
||||
* Constructs a RegisterGroup object from an XML element.
|
||||
*
|
||||
* @param xmlElement
|
||||
* @return
|
||||
*/
|
||||
static RegisterGroup registerGroupFromXml(const QDomElement& xmlElement);
|
||||
|
||||
/**
|
||||
* Constructs a RegisterGroupReference object from an XML element.
|
||||
*
|
||||
* @param xmlElement
|
||||
* @return
|
||||
*/
|
||||
static RegisterGroupReference registerGroupReferenceFromXml(const QDomElement& xmlElement);
|
||||
|
||||
/**
|
||||
* Constructs a Register object from an XML element.
|
||||
*
|
||||
* @param xmlElement
|
||||
* @return
|
||||
*/
|
||||
static Register registerFromXml(const QDomElement& xmlElement);
|
||||
|
||||
/**
|
||||
* Constructs a BitField object from an XML element.
|
||||
*
|
||||
* @param xmlElement
|
||||
* @return
|
||||
*/
|
||||
static BitField bitFieldFromXml(const QDomElement& xmlElement);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user