#include "mologram/SpecDocument.hpp" #include #include #include namespace mologram { static std::string trim(const std::string& s) { size_t a = s.find_first_not_of(" \t\r"); if (a == std::string::npos) return ""; size_t b = s.find_last_not_of(" \t\r"); return s.substr(a, b - a + 1); } SpecDocument::SpecDocument(const std::string& path) { std::ifstream in(path); if (!in) { error_ = "cannot open " + path; return; } text_.assign((std::istreambuf_iterator(in)), std::istreambuf_iterator()); std::istringstream ls(text_); std::string line, current; int rowInTable = 0; while (std::getline(ls, line)) { if (line.rfind(""); current = line.substr(10, e - 10); tables_[current]; rowInTable = 0; continue; } if (line.rfind("