9#include "quill/LogMacros.h"
13 inline void ltrim(std::string &s) {
16 std::ranges::find_if(s,
17 [](
const unsigned char ch) {
18 return !std::isspace(ch);
23 inline void rtrim(std::string &s) {
28 [](
const unsigned char ch) {
29 return !std::isspace(ch);
35 inline void trim(std::string &s) {
45 LOG_TRACE_L1(
m_logger,
"Parsing simple reaction list file: {}", filename);
47 std::ifstream file(filename);
48 if (!file.is_open()) {
49 LOG_ERROR(
m_logger,
"Failed to open file: {}", filename);
51 throw std::runtime_error(
"Could not open file: " + filename);
57 while (std::getline(file, line)) {
59 LOG_TRACE_L3(
m_logger,
"Parsing reaction list file {}, line {}: {}", filename, line_number, line);
61 const size_t comment_pos = line.find(
'#');
62 if (comment_pos != std::string::npos) {
63 line = line.substr(0, comment_pos);
ParsedNetworkData parse(const std::string &filename) const override
Parses a simple reaction list file.
SimpleReactionListFileParser()
Constructs a SimpleReactionListFileParser.
Holds the data parsed from a network file.
std::vector< std::string > reactionPENames
A vector of reaction names in their PEN-style format.