feat(eosIO): added EosIO class to handle arbitrary eos data

EosIO class wraps all eos tables (like helm) so that they can be used in a more standard fashion
This commit is contained in:
2025-03-20 14:25:22 -04:00
parent efa4bdadff
commit 171fbf7961
4 changed files with 232 additions and 46 deletions

36
src/eos/private/eosIO.cpp Normal file
View File

@@ -0,0 +1,36 @@
#include <string>
#include "eosIO.h"
#include "helm.h"
#include "debug.h"
EosIO::EosIO(const std::string filename) : m_filename(filename) {
load();
}
std::string EosIO::getFormat() const {
return m_format;
}
EOSTable& EosIO::getTable() {
return m_table;
}
void EosIO::load() {
// Load the EOS table from the file
// For now, just set the format to HELM
m_format = "helm";
if (m_format == "helm") {
loadHelm();
}
}
void EosIO::loadHelm() {
// Load the HELM table from the file
auto helmTabptr = helmholtz::read_helm_table(m_filename);
m_table = std::move(helmTabptr);
m_loaded = true;
}