8#ifndef INCLUDED_BDLJSN_JSONUTIL
9#define INCLUDED_BDLJSN_JSONUTIL
368#include <bdlscm_version.h>
381#include <bsl_cstdint.h>
382#include <bsl_iosfwd.h>
383#include <bsl_sstream.h>
384#include <bsl_string.h>
385#include <bsl_string_view.h>
404 bsl::istream& input);
409 bsl::streambuf *input);
411 bsl::streambuf *input,
419 Error *errorDescription,
420 bsl::istream& input);
422 Error *errorDescription,
426 Error *errorDescription,
427 bsl::streambuf *input);
429 Error *errorDescription,
430 bsl::streambuf *input,
433 Error *errorDescription,
452 Error *errorDescription,
464 static bsl::ostream&
printError(bsl::ostream& stream,
468 bsl::streambuf *input,
470 static bsl::ostream&
printError(bsl::ostream& stream,
474 static int write(bsl::ostream& output,
476 static int write(bsl::ostream& output,
479 static int write(bsl::streambuf *output,
481 static int write(bsl::streambuf *output,
489#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
490 static int write(std::pmr::string *output,
492 static int write(std::pmr::string *output,
496 static int write(std::string *output,
503 static int write(std::string *output,
522 return read(result, &tmp, input, options);
530 return read(result, input, options);
535 bsl::streambuf *input,
539 return read(result, &tmp, input, options);
544 bsl::streambuf *input)
547 return read(result, input, options);
556 return read(result, &tmp, input, options);
564 return read(result, input, options);
569 Error *errorDescription,
574 return read(result, errorDescription, input.rdbuf(), options);
579 Error *errorDescription,
584 return read(result, errorDescription, input, options);
589 Error *errorDescription,
590 bsl::streambuf *input)
594 return read(result, errorDescription, input, options);
599 Error *errorDescription,
604 return read(result, errorDescription, &inputBuf, options);
609 Error *errorDescription,
613 return read(result, errorDescription, input, options);
621 return printError(stream, input.rdbuf(), error);
638 bsl::ostream outputStream(output);
639 return write(outputStream, json, options);
647 return write(output, json, options);
657 int rc =
write(stream, json, options);
659#ifdef BSLS_PLATFORM_CMP_SUN
675 return write(output, json, options);
678#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
684#if defined (BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY)
685 typedef std::basic_ostringstream<char,
686 std::char_traits<char>,
687 std::pmr::polymorphic_allocator<char> >
690 PmrOstringStream stream(std::ios_base::out, output->get_allocator());
691 int rc =
write(stream, json, options);
693 std::pmr::string tmpOutput = stream.str(output->get_allocator());
698 std::ostringstream stream;
699 int rc =
write(stream, json, options);
709#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
714 WriteOptions options;
716 return write(output, json, options);
725 std::ostringstream stream;
727 int rc =
write(stream, json, options);
729 std::string tmpOutput(stream.str());
741 return write(output, json, options);
748 return write(output, json, options);
Definition bdljsn_error.h:157
Definition bdljsn_json.h:1110
Definition bdljsn_readoptions.h:128
Definition bdljsn_writeoptions.h:134
Definition bdlsb_fixedmeminstreambuf.h:187
Definition bslstl_ostringstream.h:175
void str(const StringType &value)
Definition bslstl_ostringstream.h:581
Definition bslstl_stringview.h:441
BSLS_KEYWORD_CONSTEXPR const_pointer data() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_stringview.h:1760
BSLS_KEYWORD_CONSTEXPR size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the length of this view.
Definition bslstl_stringview.h:1676
Definition bslstl_string.h:1281
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Return the allocator used by this string to supply memory.
Definition bslstl_string.h:6723
Definition bslstl_pair.h:1210
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdljsn_error.h:143
Definition bdljsn_jsonutil.h:396
static int write(bsl::ostream &output, const Json &json, const WriteOptions &options)
static int write(bsl::ostream &output, const Json &json)
Definition bdljsn_jsonutil.h:745
static bsl::ostream & printError(bsl::ostream &stream, bsl::istream &input, const Error &error)
Definition bdljsn_jsonutil.h:617
static bsl::ostream & printError(bsl::ostream &stream, bsl::streambuf *input, const Error &error)
bsl::pair< bsl::uint64_t, bsl::uint64_t > LineAndColumnNumber
Definition bdljsn_jsonutil.h:399
static int read(Json *result, bsl::istream &input)
Definition bdljsn_jsonutil.h:526
static int read(Json *result, Error *errorDescription, bsl::streambuf *input, const ReadOptions &options)
static MovableRef< t_TYPE > move(t_TYPE &reference) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1060