8#ifndef INCLUDED_BDLB_PRINTMETHODS
9#define INCLUDED_BDLB_PRINTMETHODS
257#include <bdlscm_version.h>
269#include <bsl_iomanip.h>
270#include <bsl_ostream.h>
271#include <bsl_vector.h>
273#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
278#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
285template <
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
326 template <
class TYPE>
332 template <
class TYPE>
342namespace PrintMethods {
354bsl::ostream&
print(bsl::ostream& stream,
357 int spacesPerLevel = 4);
358bsl::ostream&
print(bsl::ostream& stream,
361 int spacesPerLevel = 4);
362bsl::ostream&
print(bsl::ostream& stream,
363 unsigned char object,
365 int spacesPerLevel = 4);
372template <
class CHAR_T,
class CHAR_TRAITS_T,
class ALLOC>
373bsl::ostream&
print(bsl::ostream& stream,
378 int spacesPerLevel = 4);
387template <
class ALLOC>
388bsl::ostream&
print(bsl::ostream& stream,
391 int spacesPerLevel = 4);
393#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
407bsl::ostream&
print(bsl::ostream& stream,
408 const std::optional<TYPE>&
object,
410 int spacesPerLevel = 4);
426template <
class ... TYPE>
427bsl::ostream&
print(bsl::ostream& stream,
428 const std::variant<TYPE ...>&
object,
430 int spacesPerLevel = 4);
443bsl::ostream&
print(bsl::ostream& stream,
444 const std::monostate&
object,
446 int spacesPerLevel = 4);
463template <
class TYPE,
class SELECTOR>
479 static bsl::ostream& print(bsl::ostream& stream,
498 static bsl::ostream& print(bsl::ostream& stream,
517 static bsl::ostream& print(bsl::ostream& stream,
535 static bsl::ostream& print(bsl::ostream& stream,
552 bsl::ostream& stream,
568 if (0 <= spacesPerLevel) {
583 print(bsl::ostream& stream,
591 return object.print(stream, level, spacesPerLevel);
602 >::print(bsl::ostream& stream,
616 typedef typename TYPE::const_iterator Iterator;
618 if (0 <= spacesPerLevel) {
627 const int levelPlus1 = level + 1;
629 for (Iterator it =
object.begin(); it !=
object.end(); ++it) {
645 for (Iterator it =
object.begin(); it !=
object.end(); ++it) {
653 return stream << bsl::flush;
663 print(bsl::ostream& stream,
674 if (0 <= spacesPerLevel) {
683 const int levelPlus1 = level + 1;
716 return stream << bsl::flush;
741template <
class CHAR_T,
class CHAR_TRAITS_T,
class ALLOC>
743 bsl::ostream& stream,
755template <
class ALLOC>
770 const int len =
static_cast<int>(
object.size());
778 if (0 <= spacesPerLevel) {
785#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
790 const std::optional<TYPE>&
object,
795 if (
object.has_value()) {
809template <
class ... TYPE>
812 const std::variant<TYPE ...>&
object,
816 const auto lambda = [&](
const auto& x) -> bsl::ostream& {
822 return std::visit(lambda,
object);
828 const std::monostate& ,
Definition bslstl_string.h:1252
Definition bslstl_vector.h:1120
Definition bslmf_nestedtraitdeclaration.h:214
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
bsl::ostream & print(bsl::ostream &stream, const TYPE &object, int level=0, int spacesPerLevel=4)
Definition bdlb_printmethods.h:725
Definition bdlb_algorithmworkaroundutil.h:74
Definition bdlat_valuetypefunctions.h:939
Definition bdlbb_blob.h:579
Definition bdlb_printmethods.h:306
Definition bdlb_printmethods.h:464
static bsl::ostream & indent(bsl::ostream &stream, int level, int spacesPerLevel=4)
static bsl::ostream & printString(bsl::ostream &stream, const char *string, int length, bool escapeBackSlash=false)
Definition bdlb_printmethods.h:329
Definition bdlb_printmethods.h:322
Definition bslalg_hasstliterators.h:99
Definition bslmf_detectnestedtrait.h:467
Definition bslmf_ispair.h:88
Definition bslmf_selecttrait.h:438
Definition bslmf_selecttrait.h:524