libzypp 17.38.15

json.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9
10#include "json.h"
11#include "json/private/jsonparser_p.h"
12
13 namespace zypp::json {
14
15#ifdef ZYPP_DLL
16 zyppng::expected<Value> parseDocumentExpected( const InputStream & input_r )
17 {
18 detail::Parser p;
19 return p.parse( input_r );
20 }
21#endif
22
23 Value parseDocument( const InputStream & input_r )
24 {
25 // json.cc is always compiled with ZYPP_DLL defined, so
26 // parseDocumentExpected is always available here.
27 return parseDocumentExpected( input_r ).unwrap();
28 }
29
30} // namespace zypp::json
zypp::InputStream
Helper to create and pass std::istream.
Definition inputstream.h:57
zypp::json::Value
Definition JsonValue.h:175
zypp::json::detail::Parser
Definition jsonparser_p.h:54
zypp::json::detail::Parser::parse
zyppng::expected< Value > parse(const InputStream &input_r)
Parse the stream.
Definition jsonparser_p.cc:37
json.h
Public JSON API.
jsonparser_p.h
Internal JSON tokeniser — NOT part of the public API.
zypp::json
Definition TargetImpl.cc:153
zypp::json::parseDocument
Value parseDocument(const InputStream &input_r)
Parse a JSON document from input_r.
Definition json.cc:23