[#BloombergLP-baljsn-EncodeImplUtil-encodeMemberPrefix-040] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/EncodeImplUtil.adoc[EncodeImplUtil]::encodeMemberPrefix :relfileprefix: ../../../ :mrdocs: Encode any needed comma and member‐name tokens before a member value. == Synopsis Declared in `<baljsn_encodeimplutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int encodeMemberPrefix( FORMATTER* formatter, std::ostream* logStream, std::string_view const& memberName, bool isFirstMember); ---- == Description If the specified `isFirstMember` flag is `false`, encode a "comma" JSON token to the specified `formatter`, and do not encode a "comma" JSON token otherwise. If the specified `formattingMode` does not have the `bdlat_FormattingMode::e_UNTAGGED` bit set, encode a JSON "string" token having the specified `memberName` contents, and encode a JSON "colon" token after the string, and do not encode these tokens otherwise. If this operation is not successful, load an unspecified, human‐readable description of the error condition to the specified `logStream`. Optionally specify `isPrefixEmpty`. If this operation encodes a token to the formatter, load the value `false` to `isPrefixEmpty` if specified, and the value `true` otherwise. Return 0 on success, and a non‐zero value otherwise. == Return Value 0 on success, and a non‐zero value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *formatter* | JSON formatter that receives the encoded tokens | *logStream* | stream for human‐readable error descriptions | *memberName* | name of the member | *isFirstMember* | if `true`, omit a leading comma |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#