8#ifndef INCLUDED_BSLIM_PRINTER
9#define INCLUDED_BSLIM_PRINTER
570#include <bslscm_version.h>
583#include <bsl_optional.h>
584#include <bsl_ostream.h>
585#include <bsl_memory.h>
586#include <bsl_string.h>
587#include <bsl_utility.h>
604 bsl::ostream *d_stream_p;
612 bool d_suppressInitialIndentFlag;
614 int d_spacesPerLevel;
643 void end(
bool suppressBracket =
false)
const;
645#ifndef BDE_OPENSOURCE_PUBLICATION
677 template <
class TYPE>
678 void print(
const TYPE& data,
const char *name)
const;
719 template <
class TYPE>
728 template <
class ITERATOR>
730 const ITERATOR& begin,
731 const ITERATOR&
end)
const;
746 template <
class ITERATOR,
class PRINT_FUNCTOR>
748 const ITERATOR& begin,
750 const PRINT_FUNCTOR& printFunctionObject)
const;
769 template <
class TYPE,
class PRINT_FUNCTOR>
771 const PRINT_FUNCTOR& printFunctionObject,
772 const char *name)
const;
794 template <
class TYPE>
795 void printOrNull(
const TYPE& address,
const char *name)
const;
834 template <
class TYPE>
843 template <
class ITERATOR>
845 const ITERATOR&
end)
const;
861 template <
class ITERATOR,
class PRINT_FUNCTOR>
864 const PRINT_FUNCTOR& printFunctionObject)
const;
877 void start(
bool suppressBracket =
false)
const;
903 template <
class TYPE>
904 static void print(bsl::ostream& stream,
916 template <
class ITERATOR>
917 static void print(bsl::ostream& stream,
918 const ITERATOR& begin,
930 template <
class ITERATOR,
class PRINT_FUNCTOR>
931 static void print(bsl::ostream& stream,
932 const ITERATOR& begin,
934 const PRINT_FUNCTOR& printFunctionObject,
936 const int spacesPerLevel);
955 template <
class TYPE>
956 static void printRaw(bsl::ostream& stream,
961 template <
class TYPE>
962 static void printRaw(bsl::ostream& stream,
970 template <
class TYPE>
971 static void printRaw(bsl::ostream& stream,
989 template <
class TYPE>
990 static void printRaw(bsl::ostream& stream,
995 template <
class TYPE>
996 static void printRaw(bsl::ostream& stream,
1004 static void printRaw(bsl::ostream& stream,
1009 template <
class TYPE>
1010 static void printRaw(bsl::ostream& stream,
1018 template <
class T1,
class T2>
1019 static void printRaw(bsl::ostream& stream,
1037 template <
class TYPE>
1038 static void printRaw(bsl::ostream& stream,
1044 template <
class TYPE>
1045 static void printRaw(bsl::ostream& stream,
1055 template <
class TYPE>
1056 static void printRaw(bsl::ostream& stream,
1073#ifndef BDE_OPENSOURCE_PUBLICATION
1074template <
class TYPE>
1080 *d_stream_p << name <<
" = ";
1090template <
class TYPE>
1092 const TYPE& data)
const
1096 *d_stream_p << name <<
" = ";
1104template <
class ITERATOR>
1106 const ITERATOR& begin,
1107 const ITERATOR& end)
const
1111 *d_stream_p << name <<
" = ";
1120template <
class ITERATOR,
class PRINT_FUNCTOR>
1123 const ITERATOR& begin,
1124 const ITERATOR& end,
1125 const PRINT_FUNCTOR& printFunctionObject)
const
1129 *d_stream_p << name <<
" = ";
1134 printFunctionObject,
1139template <
class TYPE,
class PRINT_FUNCTOR>
1141 const PRINT_FUNCTOR& printFunctionObject,
1142 const char *name)
const
1147 *d_stream_p << name <<
" = ";
1150 printFunctionObject(*d_stream_p,
1156template <
class TYPE>
1162 *d_stream_p << name <<
" = ";
1166 *d_stream_p <<
"NULL";
1167 if (d_spacesPerLevel >= 0) {
1168 *d_stream_p <<
'\n';
1181void Printer::printOrNull<const void *>(
const void *
const& address,
1182 const char *name)
const
1187 *d_stream_p << name <<
" = ";
1189 const void *temp = address;
1199void Printer::printOrNull<void *>(
void *
const& address,
const char *name)
const
1201 const void *
const& temp = address;
1205template <
class TYPE>
1217template <
class ITERATOR>
1219 const ITERATOR& end)
const
1230template <
class ITERATOR,
class PRINT_FUNCTOR>
1232 const ITERATOR& end,
1233 const PRINT_FUNCTOR& printFunctionObject)
const
1241 printFunctionObject,
1256template <
class ITERATOR>
1259 const ITERATOR& begin,
1260 const ITERATOR& end,
1262 const int spacesPerLevel)
1266 for (ITERATOR it = begin; end != it; ++it) {
1272template <
class ITERATOR,
class PRINT_FUNCTOR>
1275 const ITERATOR& begin,
1276 const ITERATOR& end,
1277 const PRINT_FUNCTOR& printFunctionObject,
1279 const int spacesPerLevel)
1283 for (ITERATOR it = begin; end != it; ++it) {
1284 printFunctionObject(stream,
1288 if (spacesPerLevel >= 0) {
1297template <
class TYPE>
1306 if (spacesPerLevel >= 0) {
1311template <
class TYPE>
1328template <
class TYPE>
1331 bsl::ostream& stream,
1341 reinterpret_cast<const void *
>(
1349template <
class TYPE>
1358 static_cast<const void *
>(data),
1363 if (spacesPerLevel >= 0) {
1373template <
class TYPE>
1393 bsl::ostream& stream,
1406template <
class TYPE>
1409 bsl::ostream& stream,
1424template <
class T1,
class T2>
1439template <
class TYPE>
1448 static_cast<const void *
>(data.get()),
1456 else if (spacesPerLevel >= 0) {
1461template <
class TYPE>
1469 if (data.has_value()) {
1473 if (spacesPerLevel >= 0) {
1482template <
class TYPE>
1490 data.print(stream, level, spacesPerLevel);
1497template <
class TYPE>
Definition bslstl_stringview.h:441
Definition bslstl_string.h:1281
Definition bslstl_optional.h:1861
Definition bslstl_pair.h:1210
Definition bslstl_sharedptr.h:1830
Definition bslim_printer.h:601
int spacesPerLevel() const
void printOrNull(const TYPE &address, const char *name) const
Definition bslim_printer.h:1157
void printValue(const TYPE &data) const
Definition bslim_printer.h:1207
void printForeign(const TYPE &data, const PRINT_FUNCTOR &printFunctionObject, const char *name) const
Definition bslim_printer.h:1140
void printHexAddr(const void *address, const char *name) const
void end(bool suppressBracket=false) const
~Printer()
Destroy this Printer object.
void start(bool suppressBracket=false) const
void print(const TYPE &data, const char *name) const
Definition bslim_printer.h:1075
void printEndIndentation() const
Printer(bsl::ostream *stream, int level, int spacesPerLevel)
void printAttribute(const bslstl::StringRef &name, const TYPE &data) const
Definition bslim_printer.h:1091
bool suppressInitialIndentFlag() const
void printIndentation() const
Definition bslstl_stringref.h:372
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bslim_formatguard.h:120
Definition bslmf_isarray.h:168
Definition bslmf_isenum.h:270
Definition bslmf_isfundamental.h:329
Definition bslmf_ispointer.h:138
Definition bslalg_hasstliterators.h:99
Definition bslim_printer.h:893
static void printRaw(bsl::ostream &stream, const bslstl::StringRef &data, int level, int spacesPerLevel, bslmf::SelectTraitCase<>)
static void printRaw(bsl::ostream &stream, const bsl::string_view &data, int level, int spacesPerLevel, bslmf::SelectTraitCase<>)
static void printRaw(bsl::ostream &stream, const void *data, int level, int spacesPerLevel, bslmf::SelectTraitCase< bsl::is_pointer >)
static void printRaw(bsl::ostream &stream, const char *data, int level, int spacesPerLevel, bslmf::SelectTraitCase< bsl::is_pointer >)
static void printRaw(bsl::ostream &stream, char data, int level, int spacesPerLevel, bslmf::SelectTraitCase< bsl::is_fundamental >)
static void printRaw(bsl::ostream &stream, unsigned char data, int level, int spacesPerLevel, bslmf::SelectTraitCase< bsl::is_fundamental >)
static void print(bsl::ostream &stream, const TYPE &data, int level, int spacesPerLevel)
Definition bslim_printer.h:1499
static void printRaw(bsl::ostream &stream, bool data, int level, int spacesPerLevel, bslmf::SelectTraitCase< bsl::is_fundamental >)
Definition bslmf_functionpointertraits.h:153
Definition bslmf_selecttrait.h:438
Definition bslmf_selecttrait.h:522
std::size_t UintPtr
Definition bsls_types.h:126