libdballe 9.6
Public Member Functions | Public Attributes | List of all members
dballe::core::json::Stream Struct Reference

Public Member Functions

 Stream (std::istream &in)
 
void expect_token (const char *token)
 Raise a parse error if the stream does not yield this exact token.
 
void skip_spaces ()
 Consume and discard all spaces at the start of the stream.
 
template<typename T >
parse_unsigned ()
 Parse an unsigned integer.
 
template<typename T >
parse_signed ()
 Parse a signed integer.
 
double parse_double ()
 Parse a double.
 
std::tuple< std::string, bool > parse_number ()
 Parse a number, without converting it.
 
std::string parse_string ()
 Parse a string from the start of the stream.
 
Coords parse_coords ()
 Parse a Coords object.
 
Station parse_station ()
 Parse a Coords object.
 
DBStation parse_dbstation ()
 Parse a Coords object.
 
Ident parse_ident ()
 Parse an Ident object.
 
Level parse_level ()
 Parse a Level object.
 
Trange parse_trange ()
 Parse a Trange object.
 
Datetime parse_datetime ()
 Parse a Datetime object.
 
DatetimeRange parse_datetimerange ()
 Parse a DatetimeRange object.
 
template<typename T >
parse ()
 
void parse_array (std::function< void()> on_element)
 Parse a JSON array, calling on_element to parse each element.
 
void parse_object (std::function< void(const std::string &key)> on_value)
 Parse a JSON object, calling on_value to parse each value.
 
Element identify_next ()
 Identify the next element in the stream, without moving the stream position.
 
template<>
std::string parse ()
 

Public Attributes

std::istream & in
 

Member Function Documentation

◆ parse_number()

std::tuple< std::string, bool > dballe::core::json::Stream::parse_number ( )

Parse a number, without converting it.

Returns the number, and true if it looks like a floating point number, false if it looks like an integer number


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