libzypp: zypp::json::Parser Class Reference

libzypp 17.38.6

zypp::json::Parser Class Reference

`#include <zypp-core/parser/json.h>`

Inheritance diagram for zypp::json::Parser:

## Classes
struct | Token

## Public Member Functions
| Parser ()=default
| Default ctor.
| Parser (const Parser &)=delete
| Parser (Parser &&)=delete
Parser & | operator= (const Parser &)=delete
Parser & | operator= (Parser &&)=delete
virtual | ~Parser ()
| Dtor.
zyppng::expected< Value > | parse (const InputStream &input_r)
| Parse the stream.
zyppng::expected< Token > | nextToken ()

## Private Member Functions
zyppng::expected< Object > | parseObject ()
zyppng::expected< Array > | parseArray ()
zyppng::expected< Value > | parseValue ()
zyppng::expected< Value > | finishParseValue (Token begin)
zyppng::expected< Token > | parseStringToken ()
zyppng::expected< Token > | parseNumberToken ()
zyppng::expected< Token > | parseBoolToken ()
zyppng::expected< Token > | parseNullToken ()
std::istream::char_type | popChar ()
std::istream::char_type | peekChar ()
void | consumeChar ()
zyppng::expected< void > | consumeString (const std::string &str)
template<typename T = Token>
zyppng::expected< T > | makeParseError (const std::string &message, exception_detail::CodeLocation &&loc)

## Static Private Member Functions
static std::istream::char_type | eofChar ()

## Private Attributes
std::optional< InputStream > | _stream
int | _nestingDepth = 0

## Detailed Description

Definition at line 24 of file json.h.

## Constructor & Destructor Documentation

## ◆ Parser() [1/3]

zypp::json::Parser::Parser | ( |  | ) |
| default

Default ctor.

## ◆ Parser() [2/3]

zypp::json::Parser::Parser | ( | const Parser & |  | ) |
| delete

## ◆ Parser() [3/3]

zypp::json::Parser::Parser | ( | Parser && |  | ) |
| delete

## ◆ ~Parser()

virtual zypp::json::Parser::~Parser | ( |  | ) |
| inlinevirtual

Dtor.

Definition at line 35 of file json.h.

## Member Function Documentation

## ◆ operator=() [1/2]

Parser & zypp::json::Parser::operator= | ( | const Parser & |  | ) |
| delete

## ◆ operator=() [2/2]

Parser & zypp::json::Parser::operator= | ( | Parser && |  | ) |
| delete

## ◆ parse()

zyppng::expected< Value > zypp::json::Parser::parse | ( | const InputStream & | input_r | ) |

Parse the stream.

Returns
  ParseException on errors.

Definition at line 37 of file json.cc.

## ◆ nextToken()

zyppng::expected< Parser::Token > zypp::json::Parser::nextToken | ( |  | ) |

Definition at line 508 of file json.cc.

## ◆ parseObject()

zyppng::expected< Object > zypp::json::Parser::parseObject | ( |  | ) |
| private

Definition at line 87 of file json.cc.

## ◆ parseArray()

zyppng::expected< Array > zypp::json::Parser::parseArray | ( |  | ) |
| private

Definition at line 184 of file json.cc.

## ◆ parseValue()

zyppng::expected< Value > zypp::json::Parser::parseValue | ( |  | ) |
| private

Parse a complete value from the stream

Definition at line 252 of file json.cc.

## ◆ finishParseValue()

zyppng::expected< Value > zypp::json::Parser::finishParseValue | ( | Token | begin | ) |
| private

Finish parsing a JSON value, the token passed in begin either IS the value in case of essential types or the begin token of a array or object

Definition at line 265 of file json.cc.

## ◆ parseStringToken()

zyppng::expected< Parser::Token > zypp::json::Parser::parseStringToken | ( |  | ) |
| private

Definition at line 594 of file json.cc.

## ◆ parseNumberToken()

zyppng::expected< Parser::Token > zypp::json::Parser::parseNumberToken | ( |  | ) |
| private

Definition at line 323 of file json.cc.

## ◆ parseBoolToken()

zyppng::expected< Parser::Token > zypp::json::Parser::parseBoolToken | ( |  | ) |
| private

Definition at line 302 of file json.cc.

## ◆ parseNullToken()

zyppng::expected< Parser::Token > zypp::json::Parser::parseNullToken | ( |  | ) |
| private

Definition at line 293 of file json.cc.

## ◆ popChar()

std::istream::char_type zypp::json::Parser::popChar | ( |  | ) |
| private

Definition at line 466 of file json.cc.

## ◆ peekChar()

std::istream::char_type zypp::json::Parser::peekChar | ( |  | ) |
| private

Definition at line 478 of file json.cc.

## ◆ consumeChar()

void zypp::json::Parser::consumeChar | ( |  | ) |
| private

Definition at line 490 of file json.cc.

## ◆ consumeString()

zyppng::expected< void > zypp::json::Parser::consumeString | ( | const std::string & | str | ) |
| private

Definition at line 496 of file json.cc.

## ◆ eofChar()

std::istream::char_type zypp::json::Parser::eofChar | ( |  | ) |
| inlinestaticprivate

Definition at line 91 of file json.h.

## ◆ makeParseError()

template<typename T = Token>

zyppng::expected< T > zypp::json::Parser::makeParseError | ( | const std::string & | message,
|  | exception_detail::CodeLocation && | loc )
| inlineprivate

Definition at line 96 of file json.h.

## Member Data Documentation

## ◆ _stream

std::optional<InputStream> zypp::json::Parser::_stream
| private

Definition at line 101 of file json.h.

## ◆ _nestingDepth

int zypp::json::Parser::_nestingDepth = 0
| private

Definition at line 102 of file json.h.

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

- zypp-core/parser/json.h
- zypp-core/parser/json.cc