28 #include <boost/lexical_cast.hpp>
29 #include <boost/regex.hpp>
31 #if BOOST_VERSION < 107300
32 #include <boost/io/detail/quoted_manip.hpp>
34 #include <boost/io/quoted.hpp>
41 using boost::regex_match;
45 if (type ==
typeid(
bool)) {
48 if (type ==
typeid(int32_t)) {
51 if (type ==
typeid(int64_t)) {
54 if (type ==
typeid(
float)) {
57 if (type ==
typeid(
double)) {
96 auto column_info = table.getColumnInfo();
97 for (
size_t i = 0; i < column_info->size(); ++i) {
98 sizes.push_back(
quoted(column_info->getDescription(i).name).
size());
100 for (
auto row : table) {
101 for (
size_t i = 0; i < sizes.size(); ++i) {
105 for (
auto&
s : sizes) {
112 regex whitespace_quotes{
".*[\\s\"].*"};
113 if (!regex_match(str, whitespace_quotes))
NdArray(const std::vector< size_t > &shape_)
std::vector< size_t > calculateColumnLengths(const Table &table)
Calculates the sizes in characters each column of the table needs.
std::string quoted(const std::string &str)
std::string typeToKeyword(std::type_index type)
Converts a type to its string representation.