26 #include <boost/regex.hpp>
27 #include <boost/algorithm/string.hpp>
32 #include "boost/lexical_cast.hpp"
40 using boost::regex_match;
60 while (line.empty() && sfile.
good()) {
65 boost::smatch s_match;
66 if (boost::regex_match(line, s_match, expression)) {
67 dataset_name = s_match[1].str();
89 std::string reg_ex_str =
"^\\s*#\\s*" + key_word +
"\\s+(\\w+)\\s*$";
90 boost::regex expression(reg_ex_str);
92 while (sfile.
good()) {
94 boost::smatch s_match;
95 if (!line.empty() && boost::regex_match(line, s_match, expression)) {
97 size_t start_position = line.find(key_word)+key_word.
length();
98 value = line.substr (start_position);
116 auto table =
Table::AsciiReader{sfile}.fixColumnTypes({
typeid(double),
typeid(
double)}).read();
119 for (
auto row : table) {
129 bool is_a_dataset_file =
false;
136 boost::regex expression(
"\\s*#.*");
137 boost::smatch s_match;
138 while ((line.empty() || boost::regex_match(line, s_match, expression)) && sfile.
good()) {
147 ss >> d1 >> d2 >> empty_string;
148 boost::lexical_cast<double>(d1);
149 boost::lexical_cast<double>(d2);
150 if (!empty_string.empty()){
151 is_a_dataset_file =
false;
154 is_a_dataset_file =
true;
158 is_a_dataset_file =
false;
162 return is_a_dataset_file;