csv-parser 1.1.0
Csv::Parser (csv-parser)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Csv::CellDoubleValue Class Reference

Data inside a single cell, stored as a value of double type. More...

#include <csv_cell.h>

Public Member Functions

constexpr CellDoubleValue ()=default
 Constructor, setting the value to std::numeric_limits<double>::quiet_NaN().
 
template<typename BehaviorPolicy >
constexpr CellDoubleValue (std::string_view cell, CellTypeHint hint_ignored, BehaviorPolicy policy) noexcept
 Constructor, which stores a copy of the cell data.
 
constexpr double getValue () const
 Get the cell value if cell type is Double.
 

Detailed Description

Data inside a single cell, stored as a value of double type.

All cell contents are treated as having CellType::Double type, regardless of its original type. The data is always owned by this object. This may be useful if the CSV has numeric data in double-quotes.

Constructor & Destructor Documentation

◆ CellDoubleValue()

template<typename BehaviorPolicy >
constexpr Csv::CellDoubleValue::CellDoubleValue ( std::string_view  cell,
CellTypeHint  hint_ignored,
BehaviorPolicy  policy 
)
explicitconstexprnoexcept

Constructor, which stores a copy of the cell data.

If conversion failure occurs, NaN is assumed.

Parameters
cellCell data to store.
hint_ignoredThis parameter is ignored and is present for compatibility with CellTrait::create().
policyArgument used for type inference.
Template Parameters
BehaviorPolicyPolicy to use for parsing, same as BehaviorPolicy in Parser.

Member Function Documentation

◆ getValue()

constexpr double Csv::CellDoubleValue::getValue ( ) const
inlineconstexpr

Get the cell value if cell type is Double.

Returns
std::numeric_limits<double>::quiet_NaN() on error.

The documentation for this class was generated from the following file: