openGPMP
Open Source Mathematics Package
Functions | Variables
datatable1.cpp File Reference
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <openGPMP/core/datatable_wip.hpp>
#include <openGPMP/core/utils.hpp>
#include <regex>
#include <sstream>
#include <string>
#include <typeinfo>
#include <unordered_map>
#include <variant>
#include <vector>

Go to the source code of this file.

Functions

bool is_int (const std::string &str)
 
bool is_double (const std::string &str)
 
std::string dt_to_str (gpmp::core::DataType type)
 

Variables

static gpmp::core::Logger _log_
 

Function Documentation

◆ dt_to_str()

std::string dt_to_str ( gpmp::core::DataType  type)

Definition at line 163 of file datatable1.cpp.

163  {
164  switch (type) {
166  return "int64";
168  return "long double";
170  return "std::string";
171  // TODO : Add more cases if needed
172  default:
173  return "Unknown";
174  }
175 }

References gpmp::core::dt_int64, gpmp::core::dt_ldouble, and gpmp::core::dt_str.

Referenced by gpmp::core::DataTable::native_type().

◆ is_double()

bool is_double ( const std::string &  str)

Definition at line 130 of file datatable1.cpp.

130  {
131  return std::regex_match(str, std::regex(R"(-?\d+\.\d+)"));
132 }

Referenced by gpmp::core::DataTable::inferType().

◆ is_int()

bool is_int ( const std::string &  str)

Definition at line 124 of file datatable1.cpp.

124  {
125  // TODO : determine type of int based on length of largest val?
126  return std::regex_match(str, std::regex(R"(-?\d+)"));
127 }

Referenced by gpmp::core::DataTable::inferType().

Variable Documentation

◆ _log_

gpmp::core::Logger _log_
static

Logger class object

Definition at line 49 of file datatable1.cpp.

Referenced by gpmp::core::DataTable::inferType(), and gpmp::core::DataTable::native_type().