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

This policy controls the behavior of the parser. More...

#include <csv_policies.h>

Static Public Member Functions

static constexpr bool useEmptyCellType () noexcept
 If true, empty cell type is a separate type from (empty) string.
 
template<typename Number >
static std::optional< Number > readNumber (std::string_view cell)
 Try to read a numeric value from string data.
 
template<typename CellT >
static constexpr CellT create (std::string_view cell, CellTypeHint hint)
 Create an object of type CellT from cell contents represented as string_view.
 

Detailed Description

This policy controls the behavior of the parser.

This version does uses locale-aware number conversion. To override, create a new policy struct (possibly by inheriting from this one) and pass it to the Parser class as a template parameter.

Member Function Documentation

◆ create()

template<typename CellT >
static constexpr CellT Csv::LocaleAwareBehaviorPolicy::create ( std::string_view  cell,
CellTypeHint  hint 
)
inlinestaticconstexpr

Create an object of type CellT from cell contents represented as string_view.

By default, it handles Cell* classes (CellReference, etc.) and primitive numeric types (long int, double, etc.).

◆ readNumber()

template<typename Number >
static std::optional< Number > Csv::LocaleAwareBehaviorPolicy::readNumber ( std::string_view  cell)
inlinestatic

Try to read a numeric value from string data.

See also
Csv::readNumberLocale().

◆ useEmptyCellType()

static constexpr bool Csv::LocaleAwareBehaviorPolicy::useEmptyCellType ( )
inlinestaticconstexprnoexcept

If true, empty cell type is a separate type from (empty) string.

Default: true.


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