28#include "ElementsKernel/Exception.h"
31#include <boost/algorithm/string.hpp>
32#include <boost/lexical_cast.hpp>
46 if (dataset_name ==
"") {
59 dataset_name = s_match[1].
str();
80 std::string reg_ex_str =
"^\\s*#\\s*" + key_word +
"\\s*:\\s*(.+)\\s*$";
83 while (sfile.
good()) {
112 return std::make_pair(boost::get<double>(row[0]), boost::get<double>(row[1]));
121 bool is_a_dataset_file =
false;
140 ss >> d1 >> d2 >> empty_string;
141 boost::lexical_cast<double>(d1);
142 boost::lexical_cast<double>(d2);
143 if (!empty_string.
empty()) {
144 is_a_dataset_file =
false;
146 is_a_dataset_file =
true;
149 is_a_dataset_file =
false;
153 return is_a_dataset_file;
TableReader implementation for reading ASCII tables from streams.
AsciiReader & fixColumnTypes(std::vector< std::type_index > column_types)
Overrides the automatically detected column types.
Represents one row of a Table.
std::string getParameter(const std::string &file, const std::string &key_word) override
Get the parameter identified by a given key_word value from a file.
bool isDatasetFile(const std::string &file) override
Check that the ASCII file is a dataset file(with at least one line with2 double values)
std::unique_ptr< XYDataset > getDataset(const std::string &file) override
Get a XYDataset object reading data from an ASCII file.
std::string getName(const std::string &file) override
Get the dataset name of a ASCII file.
std::string removeExtension(const std::string &input_str)
std::string removeAllBeforeLastSlash(const std::string &input_str)
std::unique_ptr< T > make_unique(Args &&... args)
Constructs an object of type T and wraps it in a std::unique_ptr using args as the parameter list for...