26 #include <boost/algorithm/string.hpp>
27 #include <boost/regex.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();
87 std::string reg_ex_str =
"^\\s*#\\s*" + key_word +
"\\s+(\\w+)\\s*$";
88 boost::regex expression(reg_ex_str);
90 while (sfile.
good()) {
92 boost::smatch s_match;
93 if (!line.empty() && boost::regex_match(line, s_match, expression)) {
95 size_t start_position = line.find(key_word) + key_word.
length();
96 value = line.substr(start_position);
114 auto table =
Table::AsciiReader{sfile}.fixColumnTypes({
typeid(double),
typeid(
double)}).read();
117 for (
auto row : table) {
127 bool is_a_dataset_file =
false;
134 boost::regex expression(
"\\s*#.*");
135 boost::smatch s_match;
136 while ((line.empty() || boost::regex_match(line, s_match, expression)) && sfile.
good()) {
145 ss >> d1 >> d2 >> empty_string;
146 boost::lexical_cast<double>(d1);
147 boost::lexical_cast<double>(d2);
148 if (!empty_string.empty()) {
149 is_a_dataset_file =
false;
151 is_a_dataset_file =
true;
154 is_a_dataset_file =
false;
158 return is_a_dataset_file;