GLAC  1.0
Public Member Functions
nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::lexer::strtonum Struct Reference

parse string into a built-in arithmetic type as if the current locale is POSIX. More...

#include <json.hpp>

Public Member Functions

 strtonum (const char *start, const char *end)
 
template<typename T , typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
bool to (T &val) const
 

Detailed Description

template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer>
struct nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::lexer::strtonum

parse string into a built-in arithmetic type as if the current locale is POSIX.

Note
in floating-point case strtod may parse past the token's end - this is not an error
any leading blanks are not handled

Constructor & Destructor Documentation

◆ strtonum()

template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer>
nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::lexer::strtonum::strtonum ( const char *  start,
const char *  end 
)
inline

Member Function Documentation

◆ to()

template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer>
template<typename T , typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
bool nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::lexer::strtonum::to ( T &  val) const
inline
Returns
true iff parsed successfully as number of type T
Parameters
[in,out]valshall contain parsed value, or undefined value if could not parse

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