8#ifndef INCLUDED_BALJSN_FORMATTER
9#define INCLUDED_BALJSN_FORMATTER
225#include <balscm_version.h>
234#include <bsl_ostream.h>
239#include <bsl_string.h>
240#include <bsl_string_view.h>
257 bsl::ostream& d_outputStream;
260 bool d_usePrettyStyle;
262 bool d_escapeForwardSlash;
266 int d_spacesPerLevel;
293 bool isArrayElement()
const;
315 bool usePrettyStyle =
false,
316 int initialIndentLevel = 0,
317 int spacesPerLevel = 0,
321 int initialIndentLevel,
323 bool escapeForwardSlash,
381 template <
class TYPE>
414void Formatter::indent()
421bool Formatter::isArrayElement()
const
425 return d_callSequence[d_callSequence.
length() - 1];
432 if (d_usePrettyStyle && isArrayElement()) {
435 d_outputStream <<
"null";
442 if (d_usePrettyStyle && isArrayElement()) {
454 return static_cast<int>(d_callSequence.
length()) - 1;
Definition baljsn_encoderoptions.h:290
Definition bdlc_bitarray.h:525
bsl::size_t length() const
Return the number of bits in this array.
Definition bdlc_bitarray.h:1886
Definition bslstl_stringview.h:471
Definition bslma_allocator.h:545
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition baljsn_convertfromjsonoptions.h:112
static int printValue(bsl::ostream &stream, bool value, const EncoderOptions *options=0)
Definition baljsn_printutil.h:442
static bsl::ostream & indent(bsl::ostream &stream, int level, int spacesPerLevel=4)