8#ifndef INCLUDED_BALJSN_FORMATTER
9#define INCLUDED_BALJSN_FORMATTER
225#include <balscm_version.h>
233#include <bsl_ostream.h>
238#include <bsl_string.h>
239#include <bsl_string_view.h>
258 bsl::ostream& d_outputStream;
261 bool d_usePrettyStyle;
265 int d_spacesPerLevel;
288 bool isArrayElement()
const;
307 bool usePrettyStyle =
false,
308 int initialIndentLevel = 0,
309 int spacesPerLevel = 0,
363 template <
class TYPE>
394void Formatter::indent()
401bool Formatter::isArrayElement()
const
405 return d_callSequence[d_callSequence.
length() - 1];
412 if (d_usePrettyStyle && isArrayElement()) {
415 d_outputStream <<
"null";
421 if (d_usePrettyStyle && isArrayElement()) {
433 return static_cast<int>(d_callSequence.
length()) - 1;
Definition baljsn_encoderoptions.h:262
Definition bdlc_bitarray.h:521
bsl::size_t length() const
Return the number of bits in this array.
Definition bdlc_bitarray.h:1815
Definition bslstl_stringview.h:441
Definition bslma_allocator.h:457
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition baljsn_datumdecoderoptions.h:113
static int printValue(bsl::ostream &stream, bool value, const EncoderOptions *options=0)
Definition baljsn_printutil.h:410
static bsl::ostream & indent(bsl::ostream &stream, int level, int spacesPerLevel=4)