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:
36
src/eos/private/eosIO.cpp
Normal file
36
src/eos/private/eosIO.cpp
Normal 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user