libzypp 17.38.14
json.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9
10#include "json.h"
12
13namespace zypp::json {
14
15#ifdef ZYPP_DLL
16 zyppng::expected<Value> parseDocumentExpected( const InputStream & input_r )
17 {
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
Helper to create and pass std::istream.
Definition inputstream.h:57
zyppng::expected< Value > parse(const InputStream &input_r)
Parse the stream.
Public JSON API.
Internal JSON tokeniser — NOT part of the public API.
Value parseDocument(const InputStream &input_r)
Parse a JSON document from input_r.
Definition json.cc:23