Moved Paths helper functions to service class

This commit is contained in:
Nav
2022-12-26 21:47:09 +00:00
parent 4c25c85c36
commit 8fa7e82c56
36 changed files with 131 additions and 125 deletions

View File

@@ -7,7 +7,7 @@
#include "src/Application.hpp"
#include "src/Helpers/Paths.hpp"
#include "src/Services/PathService.hpp"
#include "src/Helpers/String.hpp"
#include "src/Logger/Logger.hpp"
@@ -32,7 +32,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
debugSession.connection.writePacket(ResponsePacket(String::toHex(
std::string(
"Bloom v" + Application::VERSION.toString() + "\n"
+ Paths::homeDomainName() + "\n"
+ Services::PathService::homeDomainName() + "\n"
+ "Nav Mohammed\n"
)
)));

View File

@@ -9,7 +9,7 @@
#include "src/Targets/TargetMemory.hpp"
#include "src/Application.hpp"
#include "src/Helpers/Paths.hpp"
#include "src/Services/PathService.hpp"
#include "src/Helpers/String.hpp"
#include "src/Logger/Logger.hpp"
@@ -46,7 +46,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
return;
}
const auto svdOutputFilePath = Paths::projectDirPath() + "/" + targetDescriptor.name + ".svd";
const auto svdOutputFilePath = Services::PathService::projectDirPath() + "/" + targetDescriptor.name + ".svd";
auto outputFile = QFile(QString::fromStdString(svdOutputFilePath));
if (!outputFile.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) {
@@ -102,7 +102,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
deviceElement.setAttribute("xmlns:xs", "http://www.w3.org/2001/XMLSchema-instance");
deviceElement.setAttribute(
"xs:noNamespaceSchemaLocation",
QString::fromStdString(Paths::homeDomainName() + "/assets/svd-schema.xsd")
QString::fromStdString(Services::PathService::homeDomainName() + "/assets/svd-schema.xsd")
);
deviceElement.appendChild(createElement("vendor", QString::fromStdString(targetDescriptor.vendorName)));

View File

@@ -6,7 +6,7 @@
#include "src/DebugServer/Gdb/ResponsePackets/ErrorResponsePacket.hpp"
#include "src/DebugServer/Gdb/ResponsePackets/ResponsePacket.hpp"
#include "src/Helpers/Paths.hpp"
#include "src/Services/PathService.hpp"
#include "src/Helpers/String.hpp"
#include "src/Logger/Logger.hpp"
@@ -35,13 +35,13 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
*/
auto helpFile = QFile(
QString::fromStdString(
Paths::compiledResourcesPath() + "/src/DebugServer/Gdb/Resources/GdbHelpMonitorInfo.txt"
Services::PathService::compiledResourcesPath() + "/src/DebugServer/Gdb/Resources/GdbHelpMonitorInfo.txt"
)
);
if (!helpFile.open(QIODevice::ReadOnly)) {
throw Exception(
"Failed to open GDB monitor info help file - please report this issue at " + Paths::homeDomainName()
"Failed to open GDB monitor info help file - please report this issue at " + Services::PathService::homeDomainName()
+ "/report-issue"
);
}