8#ifndef INCLUDED_BALJSN_ENCODEIMPLUTIL
9#define INCLUDED_BALJSN_ENCODEIMPLUTIL
90#include <balscm_version.h>
114#include <bsl_cstddef.h>
115#include <bsl_iostream.h>
116#include <bsl_ostream.h>
117#include <bsl_sstream.h>
118#include <bsl_streambuf.h>
119#include <bsl_string.h>
120#include <bsl_string_view.h>
121#include <bsl_vector.h>
133template <
class FORMATTER>
183 template <
class TYPE>
184 static int encode(bsl::ostream *jsonStream,
202 template <
class TYPE>
203 static int encode(bsl::ostream *logStream,
204 bsl::ostream *jsonStream,
228 template <
class TYPE>
229 static int encode(
bool *isValueEmpty,
230 FORMATTER *formatter,
231 bsl::ostream *logStream,
251 template <
class TYPE>
252 static int validate(bsl::ostream *logStream,
255 template <
class TYPE,
class CATEGORY>
256 static int validate(bsl::ostream *logStream,
266 template <
class TYPE>
267 static int validateChoice(bsl::ostream *logStream,
const TYPE& value);
290 template <
class TYPE>
304 FORMATTER *formatter,
314 FORMATTER *formatter,
336 template <
class TYPE>
338 bsl::ostream *logStream,
364 FORMATTER *formatter,
365 bsl::ostream *logStream,
372 template <
class TYPE>
374 FORMATTER *formatter,
375 bsl::ostream *logStream,
382 template <
class TYPE,
class OTHER_CATEGORY>
384 FORMATTER *formatter,
385 bsl::ostream *logStream,
391 OTHER_CATEGORY category);
406 bsl::ostream *logStream,
410 bsl::ostream *logStream,
415 FORMATTER *formatter,
416 bsl::ostream *logStream,
439template <
class FORMATTER>
458 FORMATTER *d_formatter_p;
461 bsl::ostream *d_logStream_p;
473 bool d_isNextObjectFirst;
482 bsl::ostream *logStream,
511 template <
class TYPE>
513 template <
class TYPE>
515 template <
class TYPE>
518 template <
class TYPE>
521 template <
class TYPE>
524 template <
class TYPE>
527 template <
class TYPE>
529 template <
class TYPE>
533 template <
class TYPE>
555template <
class FORMATTER>
562 FORMATTER *d_formatter_p;
565 bsl::ostream *d_logStream_p;
574 bool d_isNextElementFirst;
583 bsl::ostream *logStream,
607 template <
class TYPE>
632template <
class FORMATTER>
639 FORMATTER *d_formatter_p;
642 bsl::ostream *d_logStream_p;
651 bool d_isNextElementFirst;
660 bsl::ostream *logStream,
688 template <
class TYPE>
690 template <
class TYPE>
692 template <
class TYPE>
695 template <
class TYPE>
698 template <
class TYPE>
701 template <
class TYPE>
704 template <
class TYPE>
706 template <
class TYPE>
710 template <
class TYPE>
732template <
class FORMATTER>
751 FORMATTER *d_formatter_p;
754 bsl::ostream *d_logStream_p;
759 bool d_isNextObjectFirst;
772 bsl::ostream *logStream,
799 template <
class TYPE,
class SELECTION_INFO>
800 int operator()(
const TYPE& selection,
const SELECTION_INFO& selectionInfo);
824template <
class FORMATTER>
843 FORMATTER *d_formatter_p;
846 bsl::ostream *d_logStream_p;
861 bool d_isNextObjectFirst;
869 FORMATTER *formatter,
870 bsl::ostream *logStream,
901 template <
class TYPE>
904 template <
class TYPE>
907 template <
class TYPE,
class CATEGORY>
908 int operator()(
const TYPE& selection, CATEGORY category);
911 template <
class TYPE>
934template <
class FORMATTER>
953 FORMATTER *d_formatter_p;
956 bsl::ostream *d_logStream_p;
961 bool d_isNextAttributeFirst;
974 bsl::ostream *logStream,
1001 template <
class TYPE,
class ATTRIBUTE_INFO>
1002 int operator()(
const TYPE& attribute,
const ATTRIBUTE_INFO& attributeInfo);
1026template <
class FORMATTER>
1045 FORMATTER *d_formatter_p;
1048 bsl::ostream *d_logStream_p;
1063 bool d_isNextAttributeFirst;
1072 FORMATTER *formatter,
1073 bsl::ostream *logStream,
1104 template <
class TYPE>
1106 template <
class TYPE>
1109 template <
class TYPE>
1112 template <
class TYPE>
1115 template <
class TYPE,
class CATEGORY>
1116 int operator()(
const TYPE& attribute, CATEGORY category);
1119 template <
class TYPE>
1139template <
class FORMATTER>
1141 FORMATTER *formatter,
1171 return encodeSimpleValue(formatter, base64String, encoderOptions);
1176template <
class FORMATTER>
1178 bool *memberIsEmpty,
1179 FORMATTER *formatter,
1180 bsl::ostream *logStream,
1188 int rc = ThisUtil::encodeMemberPrefix(formatter,
1197 rc = ThisUtil::encodeCharArray(formatter, member, options);
1199 (*logStream) <<
"Unable to encode value of element "
1200 <<
"named: '" << memberName <<
"'."
1205 *memberIsEmpty =
false;
1211template <
class FORMATTER>
1213 bsl::ostream *outputStream,
1223template <
class FORMATTER>
1225 bsl::ostream *outputStream,
1229 (*outputStream) <<
'\n';
1235template <
class FORMATTER>
1236template <
class TYPE>
1242 bsl::ostream logStream(&logStreamBuf);
1244 return encode(&logStream, jsonStream, value, options);
1247template <
class FORMATTER>
1248template <
class TYPE>
1250 bsl::ostream *jsonStream,
1255 static const bool s_FIRST_MEMBER_FLAG =
false;
1257 FORMATTER formatter(
1264 bool isValueEmpty =
false;
1266 int rc = encode(&isValueEmpty,
1272 s_FIRST_MEMBER_FLAG);
1274 if (0 != formatter.nestingDepth()) {
1275 *logStream <<
"Encoding failed leaving an unclosed element (rc = "
1282template <
class FORMATTER>
1283template <
class TYPE>
1285 FORMATTER *formatter,
1286 bsl::ostream *logStream,
1299 int rc = visitor(value, Category());
1310template <
class FORMATTER>
1311template <
class TYPE>
1316 return validateChoice(logStream, value);
1319template <
class FORMATTER>
1320template <
class TYPE,
class CATEGORY>
1328template <
class FORMATTER>
1329template <
class TYPE>
1335 (*logStream) <<
"Undefined selection for Choice object" << bsl::endl;
1344template <
class FORMATTER>
1345template <
class TYPE>
1347 FORMATTER *formatter,
1351 return formatter->putValue(value, &options);
1356template <
class FORMATTER>
1358 bool *isPrefixEmpty,
1359 FORMATTER *formatter,
1363 *isPrefixEmpty =
true;
1367 formatter->openObject();
1369 *isPrefixEmpty =
false;
1372template <
class FORMATTER>
1374 bool *isSuffixEmpty,
1375 FORMATTER *formatter,
1379 *isSuffixEmpty =
true;
1383 formatter->closeObject();
1385 *isSuffixEmpty =
false;
1390template <
class FORMATTER>
1393 formatter-> openArray(
true);
1394 formatter->closeArray(
true);
1397template <
class FORMATTER>
1398template <
class TYPE>
1400 FORMATTER *formatter,
1401 bsl::ostream *logStream,
1408 formatter->openArray();
1415 for (
int index = 0; index != size; ++index) {
1422 formatter->closeArray();
1437template <
class FORMATTER>
1438template <
class TYPE>
1440 bool *isMemberEmpty,
1441 FORMATTER *formatter,
1442 bsl::ostream *logStream,
1450 int rc = ThisUtil::validate(logStream, member, category);
1455 rc = ThisUtil::encodeMemberPrefix(formatter,
1465 ThisUtil::encodeEmptyArray(formatter);
1467 *isMemberEmpty =
false;
1471 rc = ThisUtil::encodeNonEmptyArray(formatter, logStream, member, options);
1473 (*logStream) <<
"Unable to encode value of element "
1474 <<
"named: '" << memberName <<
"'." << bsl::endl;
1478 *isMemberEmpty =
false;
1482template <
class FORMATTER>
1483template <
class TYPE,
class OTHER_CATEGORY>
1485 bool *isMemberEmpty,
1486 FORMATTER *formatter,
1487 bsl::ostream *logStream,
1493 OTHER_CATEGORY category)
1495 int rc = ThisUtil::validate(logStream, member, category);
1500 bool isPrefixEmpty =
false;
1501 rc = ThisUtil::encodeMemberPrefix(&isPrefixEmpty,
1511 bool isValueEmpty =
false;
1512 rc = ThisUtil::encode(&isValueEmpty,
1518 !isPrefixEmpty || isFirstMember);
1520 (*logStream) <<
"Unable to encode value of element "
1521 <<
"named: '" << memberName <<
"'." << bsl::endl;
1530 *isMemberEmpty = isFirstMember && isValueEmpty;
1534template <
class FORMATTER>
1536 FORMATTER *formatter,
1537 bsl::ostream *logStream,
1541 if (!isFirstMember) {
1542 formatter->closeMember();
1545 int rc = formatter->openMember(memberName);
1547 (*logStream) <<
"Unable to encode element name: '" << memberName
1548 <<
"'." << bsl::endl;
1555template <
class FORMATTER>
1557 FORMATTER *formatter,
1558 bsl::ostream *logStream,
1567 return ThisUtil::encodeMemberPrefix(formatter,
1573template <
class FORMATTER>
1575 bool *isPrefixEmpty,
1576 FORMATTER *formatter,
1577 bsl::ostream *logStream,
1583 *isPrefixEmpty =
true;
1587 int rc = ThisUtil::encodeMemberPrefix(formatter,
1595 *isPrefixEmpty =
false;
1604template <
class FORMATTER>
1607 FORMATTER *formatter,
1608 bsl::ostream *logStream,
1610 bool isNextObjectFirst,
1612: d_formatter_p(formatter)
1613, d_logStream_p(logStream)
1614, d_options_p(&options)
1615, d_formattingMode(formattingMode)
1616, d_isNextObjectFirst(isNextObjectFirst)
1621template <
class FORMATTER>
1627 d_isNextObjectFirst =
false;
1633template <
class FORMATTER>
1634template <
class TYPE>
1642 if (arrayIsEmpty && !d_options_p->encodeEmptyArrays()) {
1643 d_isNextObjectFirst =
true;
1647 if (arrayIsEmpty && d_options_p->encodeEmptyArrays()) {
1649 d_isNextObjectFirst =
false;
1661 d_isNextObjectFirst =
false;
1665template <
class FORMATTER>
1666template <
class TYPE>
1678 bool isPrefixEmpty =
false;
1686 !isPrefixEmpty || d_isNextObjectFirst,
1695 bool isSuffixEmpty =
false;
1700 d_isNextObjectFirst = isPrefixEmpty && isSelectionEmpty && isSuffixEmpty;
1704template <
class FORMATTER>
1705template <
class TYPE>
1712 &d_isNextObjectFirst,
1718 d_isNextObjectFirst);
1721template <
class FORMATTER>
1722template <
class TYPE>
1731template <
class FORMATTER>
1732template <
class TYPE>
1741 d_isNextObjectFirst =
false;
1747template <
class FORMATTER>
1748template <
class TYPE>
1755 int rc = d_formatter_p->putNullValue();
1756 d_isNextObjectFirst =
false;
1763 d_isNextObjectFirst,
1775template <
class FORMATTER>
1776template <
class TYPE>
1782 bool isPrefixEmpty =
false;
1790 !isPrefixEmpty || d_isNextObjectFirst,
1800 bool isSuffixEmpty =
false;
1805 d_isNextObjectFirst = isPrefixEmpty && isAttributeEmpty && isSuffixEmpty;
1809template <
class FORMATTER>
1810template <
class TYPE>
1816 d_isNextObjectFirst =
false;
1822template <
class FORMATTER>
1823template <
class TYPE>
1833template <
class FORMATTER>
1837 return d_isNextObjectFirst;
1845template <
class FORMATTER>
1848 FORMATTER *formatter,
1849 bsl::ostream *logStream,
1850 bool isNextElementFirst,
1852: d_formatter_p(formatter)
1853, d_logStream_p(logStream)
1854, d_options_p(&options)
1855, d_isNextElementFirst(isNextElementFirst)
1860template <
class FORMATTER>
1861template <
class TYPE>
1868 d_isNextElementFirst,
1872 int rc = dispatcher(element, Category());
1882template <
class FORMATTER>
1886 return d_isNextElementFirst;
1894template <
class FORMATTER>
1897 FORMATTER *formatter,
1898 bsl::ostream *logStream,
1899 bool isNextElementFirst,
1901: d_formatter_p(formatter)
1902, d_logStream_p(logStream)
1903, d_options_p(&options)
1904, d_isNextElementFirst(isNextElementFirst)
1909template <
class FORMATTER>
1915 if (!d_isNextElementFirst) {
1916 d_formatter_p->addArrayElementSeparator();
1926 d_isNextElementFirst =
false;
1930template <
class FORMATTER>
1931template <
class TYPE>
1933 const TYPE& element,
1938 if (arrayIsEmpty && !d_options_p->encodeEmptyArrays()) {
1942 if (!d_isNextElementFirst) {
1943 d_formatter_p->addArrayElementSeparator();
1946 if (arrayIsEmpty && d_options_p->encodeEmptyArrays()) {
1948 d_isNextElementFirst =
false;
1960 d_isNextElementFirst =
false;
1964template <
class FORMATTER>
1965template <
class TYPE>
1967 const TYPE& element,
1975 if (!d_isNextElementFirst) {
1976 d_formatter_p->addArrayElementSeparator();
1979 d_formatter_p->openObject();
1990 d_formatter_p->closeObject();
1992 d_isNextElementFirst =
false;
1996template <
class FORMATTER>
1997template <
class TYPE>
1999 const TYPE& element,
2007template <
class FORMATTER>
2008template <
class TYPE>
2010 const TYPE& element,
2016template <
class FORMATTER>
2017template <
class TYPE>
2019 const TYPE& element,
2022 if (!d_isNextElementFirst) {
2023 d_formatter_p->addArrayElementSeparator();
2029 d_isNextElementFirst =
false;
2035template <
class FORMATTER>
2036template <
class TYPE>
2038 const TYPE& element,
2043 if (elementIsNull) {
2044 if (!d_isNextElementFirst) {
2045 d_formatter_p->addArrayElementSeparator();
2048 d_isNextElementFirst =
false;
2049 int rc = d_formatter_p->putNullValue();
2055 d_isNextElementFirst,
2067template <
class FORMATTER>
2068template <
class TYPE>
2070 const TYPE& element,
2073 if (!d_isNextElementFirst) {
2074 d_formatter_p->addArrayElementSeparator();
2077 d_formatter_p->openObject();
2089 d_formatter_p->closeObject();
2091 d_isNextElementFirst =
false;
2095template <
class FORMATTER>
2096template <
class TYPE>
2098 const TYPE& element,
2101 if (!d_isNextElementFirst) {
2102 d_formatter_p->addArrayElementSeparator();
2105 d_isNextElementFirst =
false;
2111template <
class FORMATTER>
2112template <
class TYPE>
2121template <
class FORMATTER>
2125 return d_isNextElementFirst;
2133template <
class FORMATTER>
2136 FORMATTER *formatter,
2137 bsl::ostream *logStream,
2138 bool isNextObjectFirst,
2140: d_formatter_p(formatter)
2141, d_logStream_p(logStream)
2142, d_isNextObjectFirst(isNextObjectFirst)
2143, d_options_p(&options)
2148template <
class FORMATTER>
2149template <
class TYPE,
class SELECTION_INFO>
2152 const TYPE& selection,
2153 const SELECTION_INFO& selectionInfo)
2158 selectionInfo.name(),
2159 selectionInfo.formattingMode(),
2160 d_isNextObjectFirst,
2164 int rc = dispatcher(selection, Category());
2175template <
class FORMATTER>
2179 return d_isNextObjectFirst;
2187template <
class FORMATTER>
2191 bsl::ostream *logStream,
2194 bool isNextObjectFirst,
2196: d_formatter_p(formatter)
2197, d_logStream_p(logStream)
2198, d_options_p(&options)
2199, d_selectionName(selectionName)
2200, d_formattingMode(formattingMode)
2201, d_isNextObjectFirst(isNextObjectFirst)
2206template <
class FORMATTER>
2207template <
class TYPE>
2210 const TYPE& selection,
2218template <
class FORMATTER>
2219template <
class TYPE>
2222 const TYPE& selection,
2228template <
class FORMATTER>
2229template <
class TYPE,
class CATEGORY>
2232 const TYPE& selection,
2238 d_selectionName.data(),
2242 d_isNextObjectFirst,
2246template <
class FORMATTER>
2247template <
class TYPE>
2257template <
class FORMATTER>
2261 return d_isNextObjectFirst;
2269template <
class FORMATTER>
2272 FORMATTER *formatter,
2273 bsl::ostream *logStream,
2274 bool isNextAttributeFirst,
2276: d_formatter_p(formatter)
2277, d_logStream_p(logStream)
2278, d_isNextAttributeFirst(isNextAttributeFirst)
2279, d_options_p(&options)
2284template <
class FORMATTER>
2285template <
class TYPE,
class ATTRIBUTE_INFO>
2287 const TYPE& attribute,
2288 const ATTRIBUTE_INFO& attributeInfo)
2293 attributeInfo.name(),
2294 attributeInfo.formattingMode(),
2295 d_isNextAttributeFirst,
2299 int rc = dispatcher(attribute, Category());
2309template <
class FORMATTER>
2313 return d_isNextAttributeFirst;
2321template <
class FORMATTER>
2325 FORMATTER *formatter,
2326 bsl::ostream *logStream,
2329 bool isNextAttributeFirst,
2331: d_formatter_p(formatter)
2332, d_logStream_p(logStream)
2333, d_options_p(&options)
2334, d_attributeName(attributeName)
2335, d_formattingMode(formattingMode)
2336, d_isNextAttributeFirst(isNextAttributeFirst)
2341template <
class FORMATTER>
2350 d_attributeName.data(),
2354 d_isNextAttributeFirst,
2358template <
class FORMATTER>
2359template <
class TYPE>
2362 const TYPE& attribute,
2367 if (!d_options_p->encodeEmptyArrays() && isArrayEmpty) {
2374 d_attributeName.data(),
2378 d_isNextAttributeFirst,
2382template <
class FORMATTER>
2383template <
class TYPE>
2386 const TYPE& attribute,
2394template <
class FORMATTER>
2395template <
class TYPE>
2398 const TYPE& attribute,
2404template <
class FORMATTER>
2405template <
class TYPE>
2408 const TYPE& attribute,
2412 !d_options_p->encodeNullElements()) {
2419 d_attributeName.data(),
2423 d_isNextAttributeFirst,
2427template <
class FORMATTER>
2428template <
class TYPE,
class CATEGORY>
2431 const TYPE& attribute,
2437 d_attributeName.data(),
2441 d_isNextAttributeFirst,
2445template <
class FORMATTER>
2446template <
class TYPE>
2456template <
class FORMATTER>
2461 return d_isNextAttributeFirst;
Definition baljsn_encodeimplutil.h:1027
EncodeImplUtil_AttributeDispatcher(FORMATTER *formatter, bsl::ostream *logStream, const bsl::string_view &attributeName, FormattingMode formattingMode, bool isNextAttributeFirst, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:2324
int operator()(const bsl::vector< char > &attribute, bdlat_TypeCategory::Array category)
Definition baljsn_encodeimplutil.h:2343
bool isNextAttributeFirst() const
Definition baljsn_encodeimplutil.h:2458
int FormattingMode
Definition baljsn_encodeimplutil.h:1038
Definition baljsn_encodeimplutil.h:935
EncodeImplUtil_AttributeVisitor(FORMATTER *formatter, bsl::ostream *logStream, bool isNextAttributeFirst, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:2271
int FormattingMode
Definition baljsn_encodeimplutil.h:946
int operator()(const TYPE &attribute, const ATTRIBUTE_INFO &attributeInfo)
Definition baljsn_encodeimplutil.h:2286
bool isNextAttributeFirst() const
Definition baljsn_encodeimplutil.h:2311
Definition baljsn_encodeimplutil.h:633
EncodeImplUtil_ElementDispatcher(FORMATTER *formatter, bsl::ostream *logStream, bool isNextElementFirst, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:1896
int operator()(const bsl::vector< char > &element, bdlat_TypeCategory::Array category)
Definition baljsn_encodeimplutil.h:1911
bool isNextElementFirst() const
Return the value of the isNextElementFirst attribute of this object.
Definition baljsn_encodeimplutil.h:2123
Definition baljsn_encodeimplutil.h:556
int operator()(const TYPE &element)
Definition baljsn_encodeimplutil.h:1863
bool isNextElementFirst() const
Definition baljsn_encodeimplutil.h:1884
EncodeImplUtil_ElementVisitor(FORMATTER *formatter, bsl::ostream *logStream, bool isNextElementFirst, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:1847
Definition baljsn_encodeimplutil.h:825
bool isNextObjectFirst() const
Definition baljsn_encodeimplutil.h:2259
int FormattingMode
Definition baljsn_encodeimplutil.h:836
int operator()(const TYPE &selection, bdlat_TypeCategory::CustomizedType category)
Definition baljsn_encodeimplutil.h:2209
EncodeImplUtil_SelectionDispatcher(FORMATTER *formatter, bsl::ostream *logStream, const bsl::string_view &selectionName, FormattingMode formattingMode, bool isNextObjectFirst, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:2190
Definition baljsn_encodeimplutil.h:733
int FormattingMode
Definition baljsn_encodeimplutil.h:744
bool isNextObjectFirst() const
Definition baljsn_encodeimplutil.h:2177
EncodeImplUtil_SelectionVisitor(FORMATTER *formatter, bsl::ostream *logStream, bool isNextObjectFirst, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:2135
int operator()(const TYPE &selection, const SELECTION_INFO &selectionInfo)
Definition baljsn_encodeimplutil.h:2151
Definition baljsn_encodeimplutil.h:440
bool isNextObjectFirst() const
Definition baljsn_encodeimplutil.h:1835
int FormattingMode
Definition baljsn_encodeimplutil.h:451
int operator()(const bsl::vector< char > &value, bdlat_TypeCategory::Array category)
Definition baljsn_encodeimplutil.h:1623
EncodeImplUtil_ValueDispatcher(FORMATTER *formatter, bsl::ostream *logStream, FormattingMode formattingMode, bool isNextObjectFirst, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:1606
Definition baljsn_encoderoptions.h:290
@ e_PRETTY
Definition baljsn_encoderoptions.h:353
baljsn::EncoderOptions::EncodingStyle encodingStyle() const
Definition baljsn_encoderoptions.h:1043
int initialIndentLevel() const
Definition baljsn_encoderoptions.h:1031
bool escapeForwardSlash() const
Return the value of the "EscapeForwardSlash" attribute of this object.
Definition baljsn_encoderoptions.h:1091
int spacesPerLevel() const
Definition baljsn_encoderoptions.h:1037
Definition bdlde_base64encoder.h:497
static bsl::size_t encodedLength(const EncoderOptions &options, bsl::size_t inputLength)
Definition bdlde_base64encoder.h:945
int convert(OUTPUT_ITERATOR out, INPUT_ITERATOR begin, INPUT_ITERATOR end)
Definition bdlde_base64encoder.h:1021
int endConvert(OUTPUT_ITERATOR out)
Definition bdlde_base64encoder.h:1092
Definition bdlsb_memoutstreambuf.h:212
Definition bslstl_stringview.h:471
Definition bslstl_string.h:1252
size_type length() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:7301
void resize(size_type newLength, CHAR_TYPE character)
Definition bslstl_string.h:5977
void swap(basic_string &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits const_iterator begin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:2792
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this vector.
Definition bslstl_vector.h:3019
iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2866
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_vector.h:2874
Definition bslstl_vector.h:1120
static int accessByCategory(const TYPE &object, ACCESSOR &accessor)
Definition bdlat_typecategory.h:1455
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_ASSERT_OPT(X)
Definition bsls_assert.h:2045
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition baljsn_convertfromjsonoptions.h:112
bsl::size_t size(const TYPE &array)
Return the number of elements in the specified array.
int accessElement(const TYPE &array, ACCESSOR &accessor, int index)
int accessSelection(const TYPE &object, ACCESSOR &accessor)
@ k_UNDEFINED_SELECTION_ID
Definition bdlat_choicefunctions.h:515
int selectionId(const TYPE &object)
const BaseType< TYPE >::Type & convertToBaseType(const TYPE &object)
Load into the specified result the value of the specified object.
void toString(bsl::string *result, const TYPE &value)
bool isNull(const TYPE &object)
int accessValue(const TYPE &object, ACCESSOR &accessor)
int accessAttributes(const TYPE &object, ACCESSOR &accessor)
Definition baljsn_encodeimplutil.h:134
static int encodeCharArray(FORMATTER *formatter, const bsl::vector< char > &value, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:1140
EncodeImplUtil ThisUtil
ThisUtil is a convenience alias for this utility struct.
Definition baljsn_encodeimplutil.h:139
static int encode(bsl::ostream *jsonStream, const TYPE &value, const EncoderOptions &options=EncoderOptions())
Definition baljsn_encodeimplutil.h:1237
static void closeDocument(bsl::ostream *outputStream, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:1224
static void encodeObjectPrefix(bool *isPrefixEmpty, FORMATTER *formatter, FormattingMode formattingMode)
Definition baljsn_encodeimplutil.h:1357
static void openDocument(bsl::ostream *outputStream, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:1212
int FormattingMode
Definition baljsn_encodeimplutil.h:147
static int encodeSimpleValue(FORMATTER *formatter, const TYPE &value, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:1346
static int encodeMemberPrefix(FORMATTER *formatter, bsl::ostream *logStream, const bsl::string_view &memberName, bool isFirstMember)
Definition baljsn_encodeimplutil.h:1535
static int encodeMember(bool *isMemberEmpty, FORMATTER *formatter, bsl::ostream *logStream, const bsl::string_view &memberName, const bsl::vector< char > &member, FormattingMode formattingMode, const EncoderOptions &options, bool isFirstMember, bdlat_TypeCategory::Array category)
Definition baljsn_encodeimplutil.h:1177
static void encodeEmptyArray(FORMATTER *formatter)
Definition baljsn_encodeimplutil.h:1391
static int validate(bsl::ostream *logStream, const TYPE &value, bdlat_TypeCategory::Choice category)
Definition baljsn_encodeimplutil.h:1312
static int validateChoice(bsl::ostream *logStream, const TYPE &value)
Definition baljsn_encodeimplutil.h:1330
static int encodeNonEmptyArray(FORMATTER *formatter, bsl::ostream *logStream, const TYPE &value, const EncoderOptions &options)
Definition baljsn_encodeimplutil.h:1399
static void encodeObjectSuffix(bool *isSuffixEmpty, FORMATTER *formatter, FormattingMode formattingMode)
Definition baljsn_encodeimplutil.h:1373
static int accessValueByCategory(const TYPE &object, ACCESSOR &accessor)
Definition bdlat_nullablevalueutil.h:328
Definition bdlat_typecategory.h:1037
Definition bdlat_typecategory.h:1038
Definition bdlat_typecategory.h:1039
Definition bdlat_typecategory.h:1036
Definition bdlat_typecategory.h:1040
Definition bdlat_typecategory.h:1041
Definition bdlat_typecategory.h:1042
Definition bdlat_typecategory.h:1043
static bsl::ostream & indent(bsl::ostream &stream, int level, int spacesPerLevel=4)
Definition bslmf_nil.h:133