Tidying
This commit is contained in:
@@ -91,7 +91,7 @@ namespace Services
|
||||
std::vector<std::string_view> StringService::split(std::string_view str, char delimiter) {
|
||||
auto range = str |
|
||||
std::ranges::views::split(delimiter) |
|
||||
std::ranges::views::transform([](auto&& subRange) -> std::string_view {
|
||||
std::ranges::views::transform([] (auto&& subRange) -> std::string_view {
|
||||
return std::string_view(
|
||||
subRange.begin(),
|
||||
static_cast<std::size_t>(std::ranges::distance(subRange))
|
||||
|
||||
@@ -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(
|
||||
@@ -278,7 +277,7 @@ namespace Targets::TargetDescription
|
||||
);
|
||||
}
|
||||
|
||||
AddressSpace TargetDescriptionFile::addressSpaceFromXml(const QDomElement &xmlElement) {
|
||||
AddressSpace TargetDescriptionFile::addressSpaceFromXml(const QDomElement& xmlElement) {
|
||||
static const auto endiannessByName = BiMap<std::string, TargetMemoryEndianness>({
|
||||
{"big", TargetMemoryEndianness::BIG},
|
||||
{"little", TargetMemoryEndianness::LITTLE},
|
||||
|
||||
@@ -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