Rename: DeviceSpec=>DAP Spec

This commit is contained in:
2025-08-29 16:12:30 -04:00
parent 66257bcd0e
commit 3ff329a553
5 changed files with 28 additions and 28 deletions
@@ -13,13 +13,13 @@
namespace smo {
namespace device {
std::string DeviceManager::readDeviceSpecFile(const std::string& filename)
std::string DeviceManager::readDapSpecFile(const std::string& filename)
{
std::ifstream file(filename);
if (!file.is_open())
{
throw std::runtime_error(
std::string(__func__) + ": Couldn't open deviceSpec file: "
std::string(__func__) + ": Couldn't open DAP spec file: "
+ filename);
}
@@ -30,39 +30,39 @@ std::string DeviceManager::readDeviceSpecFile(const std::string& filename)
return content;
}
void DeviceManager::collateAllDeviceSpecs(void)
void DeviceManager::collateAllDapSpecs(void)
{
OptionParser &options = OptionParser::getOptions();
allDeviceSpecs = options.deviceSpecs;
allDapSpecs = options.dapSpecs;
for (const auto& file : options.deviceSpecFiles)
for (const auto& file : options.dapSpecFiles)
{
std::string fileContent = readDeviceSpecFile(file);
if (!allDeviceSpecs.empty()) {
allDeviceSpecs += "||";
std::string fileContent = readDapSpecFile(file);
if (!allDapSpecs.empty()) {
allDapSpecs += "||";
}
allDeviceSpecs += fileContent;
allDapSpecs += fileContent;
}
}
void DeviceManager::parseAllDeviceSpecs(void)
void DeviceManager::parseAllDapSpecs(void)
{
std::unique_ptr<FILE, decltype(&fclose)> input(
fmemopen((void*)allDeviceSpecs.c_str(), allDeviceSpecs.size(), "r"),
fmemopen((void*)allDapSpecs.c_str(), allDapSpecs.size(), "r"),
&fclose);
if (!input)
{
throw std::runtime_error(
std::string(__func__) + ": Failed to fmemopen() a FILE* for "
"parsing device specs");
"parsing DAP specs");
}
deviceAttachmentPipeSpeclin = input.get();
if (deviceAttachmentPipeSpecpparse())
{
throw std::runtime_error(
std::string(__func__) + ": Failed to parse device specs. "
std::string(__func__) + ": Failed to parse DAP specs. "
"Check specs for errors");
}
}