[#BloombergLP-baljsn-EncodeImplUtil] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::EncodeImplUtil :relfileprefix: ../../ :mrdocs: This component‐private utility `struct` provides a suite of functions that encode `bdlat` types in the JSON format. == Synopsis Declared in `<baljsn_encodeimplutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class FORMATTER> struct EncodeImplUtil; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/baljsn/EncodeImplUtil/FormattingMode.adoc[`FormattingMode`] | `FormattingMode` is an alias to the type of an `int`‐valued `bdlat_FormattingMode` bit‐field. A `FormattingMode` value is not valid unless it is equal to an enumerator of `bdlat_FormattingMode` or a valid bitwise‐or of two or more such enumerators. See `bdlat_formattingmode` for a description of the set of valid formatting‐mode values. | xref:BloombergLP/baljsn/EncodeImplUtil/ThisUtil.adoc[`ThisUtil`] | `ThisUtil` is a convenience alias for this utility `struct`. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/baljsn/EncodeImplUtil/closeDocument.adoc[`closeDocument`] | Print the sequence of characters that designate the end of a JSON document to the specified `outputStream` according to the specified encoding `options`. See the `baljsn_encoderoptions` for a description of the effects, if any, of each option in the `options` on the end of a JSON document. | xref:BloombergLP/baljsn/EncodeImplUtil/encode-0a.adoc[`encode`] | `encode` overloads | xref:BloombergLP/baljsn/EncodeImplUtil/encodeCharArray.adoc[`encodeCharArray`] | Encode the JSON representation of the specified `value` to the specified JSON `formatter`. Use the specified `options` to configure aspects of the JSON representation of the `value`. Return 0 on success, and a non‐zero value otherwise. | xref:BloombergLP/baljsn/EncodeImplUtil/encodeEmptyArray.adoc[`encodeEmptyArray`] | Encode the representation of the empty‐array JSON value to the specified `formatter`. | xref:BloombergLP/baljsn/EncodeImplUtil/encodeMember-04.adoc[`encodeMember`] | `encodeMember` overloads | xref:BloombergLP/baljsn/EncodeImplUtil/encodeMemberPrefix-03.adoc[`encodeMemberPrefix`] | `encodeMemberPrefix` overloads | xref:BloombergLP/baljsn/EncodeImplUtil/encodeNonEmptyArray.adoc[`encodeNonEmptyArray`] | Encode the JSON representation of the specified `value` to the specified JSON `formatter`. Use the specified `options` to configure aspects of the JSON representation of the `value`. If this operation is not successful, load an unspecified, human‐readable description of the error condition to the specified `logStream`. Return 0 on success, and a non‐zero value otherwise. The behavior is undefined unless the `value` is non‐empty and the specified `TYPE` satisfies both the static and dynamic requirements of the `Array` `bdlat` type‐category concept. See `baljsn_encoderoptions` for a description of the effects, if any, of each option in the `options` on the JSON representation of the `selection`. See the package‐level documentation of `bdlat` for an introduction to the requirements of `bdlat` type‐category concepts. | xref:BloombergLP/baljsn/EncodeImplUtil/encodeObjectPrefix.adoc[`encodeObjectPrefix`] | If the specified `formattingMode` does not have the `bdlat_FormattingMode::e_UNTAGGED` bit set, encode a "left brace" JSON token to the specified `formatter`, and encoding nothing to the `formatter` otherwise. If this operation encodes a token to the formatter, load the value `false` to the specified `isPrefixEmpty`, and the value `true` otherwise. | xref:BloombergLP/baljsn/EncodeImplUtil/encodeObjectSuffix.adoc[`encodeObjectSuffix`] | If the specified `formattingMode` does not have the `bdlat_FormattingMode::e_UNTAGGED` bit set, encode a "right brace" JSON token to the specified `formatter`, and encoding nothing to the `formatter` otherwise. If this operation encodes a token to the `formatter`, load the value `false` to the specified `isSuffixEmpty`, and the value `true` otherwise. | xref:BloombergLP/baljsn/EncodeImplUtil/encodeSimpleValue.adoc[`encodeSimpleValue`] | Encode the JSON representation of the specified `value` to the specified JSON `formatter`. Use the specified `options` to configure aspects of the JSON representation of the `value`. Return 0 on success, and a non‐zero value otherwise. The behavior is undefined unless the specified `TYPE` satisfies both the static and dynamic requirements of the `Simple` `bdlat` type‐category concept. See `baljsn_encoderoptions` for a description of the effects, if any, of each option in the `options` on the JSON representation of the `value`. See the package‐level documentation of `bdlat` for an introduction to the requirements of `bdlat` type‐category concepts. | xref:BloombergLP/baljsn/EncodeImplUtil/openDocument.adoc[`openDocument`] | Print the sequence of characters that designate the start of a JSON document to the specified `outputStream` according to the specified encoding `options`. See `baljsn_encoderoptions` for a description of the effects, if any, of each option in the `options` on the start of a JSON document. | xref:BloombergLP/baljsn/EncodeImplUtil/validate-0f.adoc[`validate`] | `validate` overloads | xref:BloombergLP/baljsn/EncodeImplUtil/validateChoice.adoc[`validateChoice`] | Determine if the specified `value` satisfies the requirements for encoding using this component. If the `value` meets the encoding requirements, return 0, otherwise load an unspecified, human‐readable description of the requirements that are not satisfied by the `value` to the specified `logStream` and return a non‐zero value. The `value` is required to not have an undefined `selectionId`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#