Vince's CSV Parser
data_type.hpp File Reference

Implements data type parsing functionality. More...

#include <cmath>
#include <cctype>
#include <string>
#include <cassert>
#include "common.hpp"

Go to the source code of this file.

Namespaces

 csv
 The all encompassing namespace.
 
 csv::internals
 Stuff that is generally not of interest to end-users.
 

Enumerations

enum class  csv::DataType {
  UNKNOWN = -1 , csv::CSV_NULL , csv::CSV_STRING , csv::CSV_INT8 ,
  csv::CSV_INT16 , csv::CSV_INT32 , csv::CSV_INT64 , csv::CSV_BIGINT ,
  csv::CSV_DOUBLE
}
 Enumerates the different CSV field types that are recognized by this library. More...
 

Functions

template<typename T >
HEDLEY_CONST CONSTEXPR_14 long double csv::internals::pow10 (const T &n) noexcept
 Compute 10 to the power of n.
 
template<>
HEDLEY_CONST CONSTEXPR_14 long double csv::internals::pow10 (const unsigned &n) noexcept
 Compute 10 to the power of n.
 
template<size_t Bytes>
CONSTEXPR_14 long double csv::internals::get_int_max ()
 Given a byte size, return the largest number than can be stored in an integer of that size. More...
 
template<size_t Bytes>
CONSTEXPR_14 long double csv::internals::get_uint_max ()
 Given a byte size, return the largest number than can be stored in an unsigned integer of that size.
 
HEDLEY_PRIVATE CONSTEXPR_14 DataType csv::internals::_process_potential_exponential (csv::string_view exponential_part, const long double &coeff, long double *const out)
 Given a pointer to the start of what is start of the exponential part of a number written (possibly) in scientific notation parse the exponent.
 
HEDLEY_PRIVATE HEDLEY_PURE CONSTEXPR_14 DataType csv::internals::_determine_integral_type (const long double &number) noexcept
 Given the absolute value of an integer, determine what numeric type it fits in.
 
CONSTEXPR_14 DataType csv::internals::data_type (csv::string_view in, long double *const out, const char decimalSymbol)
 Distinguishes numeric from other text values. More...
 

Variables

CONSTEXPR_VALUE_14 long double csv::internals::CSV_INT8_MAX = get_int_max<1>()
 Largest number that can be stored in a 8-bit integer.
 
CONSTEXPR_VALUE_14 long double csv::internals::CSV_INT16_MAX = get_int_max<2>()
 Largest number that can be stored in a 16-bit integer.
 
CONSTEXPR_VALUE_14 long double csv::internals::CSV_INT32_MAX = get_int_max<4>()
 Largest number that can be stored in a 32-bit integer.
 
CONSTEXPR_VALUE_14 long double csv::internals::CSV_INT64_MAX = get_int_max<8>()
 Largest number that can be stored in a 64-bit integer.
 
CONSTEXPR_VALUE_14 long double csv::internals::CSV_UINT8_MAX = get_uint_max<1>()
 Largest number that can be stored in a 8-bit ungisned integer.
 
CONSTEXPR_VALUE_14 long double csv::internals::CSV_UINT16_MAX = get_uint_max<2>()
 Largest number that can be stored in a 16-bit unsigned integer.
 
CONSTEXPR_VALUE_14 long double csv::internals::CSV_UINT32_MAX = get_uint_max<4>()
 Largest number that can be stored in a 32-bit unsigned integer.
 
CONSTEXPR_VALUE_14 long double csv::internals::CSV_UINT64_MAX = get_uint_max<8>()
 Largest number that can be stored in a 64-bit unsigned integer.
 

Detailed Description

Implements data type parsing functionality.

Definition in file data_type.hpp.