// balxml_encoderoptions.h          *DO NOT EDIT*          @generated -*-C++-*-
#ifndef INCLUDED_BALXML_ENCODEROPTIONS
#define INCLUDED_BALXML_ENCODEROPTIONS

#include <bsls_ident.h>
BSLS_IDENT_RCSID(balxml_encoderoptions_h, "$Id$ $CSID$")
BSLS_IDENT_PRAGMA_ONCE

//@PURPOSE: Provide value-semantic attribute classes

#include <bslalg_typetraits.h>

#include <bdlat_attributeinfo.h>

#include <bdlat_selectioninfo.h>

#include <bdlat_typetraits.h>

#include <bsls_objectbuffer.h>

#include <bslma_default.h>

#include <bsls_assert.h>

#include <balxml_encodingstyle.h>

#include <bdlb_nullablevalue.h>

#include <bsl_string.h>

#include <bsl_iosfwd.h>
#include <bsl_limits.h>

namespace BloombergLP {

namespace bslma { class Allocator; }

namespace balxml { class EncoderOptions; }
namespace balxml {

                            // ====================
                            // class EncoderOptions
                            // ====================

/// Options for performing XML encodings.  Encoding style is either COMPACT
/// or PRETTY.  If encoding style is COMPACT, no whitespace will be added
/// between elements.  If encoding style is `PRETTY`, then the
/// `InitialIndentLevel`, `SpacesPerLevel`, and `WrapColumn` parameters are
/// used to specify the formatting of the output.  Note that
/// `InitialIndentLevel`, `SpacesPerLevel`, and `WrapColumn` are ignored
/// when `EncodingStyle` is COMPACT (this is the default).
/// The generated C++ code for this schema element is created by using
/// bas_codegen.pl, run by balxml/code_from_xsd.pl, with no hand-editing.
class EncoderOptions {

    // INSTANCE DATA

    // namespace where object is defined
    bsl::string               d_objectNamespace;

    // location of the schema
    bsl::string               d_schemaLocation;

    // tag for top level
    bsl::string               d_tag;

    // Formatting mode
    int                       d_formattingMode;

    // initial indentation level
    int                       d_initialIndentLevel;

    // spaces per level of indentation
    int                       d_spacesPerLevel;

    // number of characters to wrap text
    int                       d_wrapColumn;

    // This option controls the number of decimal places used for seconds
    // when encoding `Datetime` and `DatetimeTz`.
    // Note that the default of this field is `6` in
    // `balxml_encoderoptions.cpp`, but is edited to `3` in
    // `balxml_configschema.cpp` by balxml/code_from_xsd.pl.
    int                       d_datetimeFractionalSecondPrecision;

    // Maximum total digits of the decimal value that should be displayed
    bdlb::NullableValue<int>  d_maxDecimalTotalDigits;

    // Maximum fractional digits of the decimal value that should be
    // displayed
    bdlb::NullableValue<int>  d_maxDecimalFractionDigits;

    // The number of significant digits that must be displayed for the
    // double value.
    bdlb::NullableValue<int>  d_significantDoubleDigits;

    // encoding style (see component-level doc)
    EncodingStyle::Value      d_encodingStyle;

    // Allow control characters to be encoded.
    bool                      d_allowControlCharacters;

    // This option controls if the baexml encoder should output the XML
    // header.
    bool                      d_outputXMLHeader;

    // This option controls if the baexml encoder should output the XSI
    // alias with the top-level element.
    bool                      d_outputXSIAlias;

    // This option control whether `Z` should be used for the zone
    // designator of `DateTz` or instead of `+00:00` (specific to UTC).
    bool                      d_useZAbbreviationForUtc;

  public:
    // TYPES
    enum {
        ATTRIBUTE_ID_OBJECT_NAMESPACE                     = 0
      , ATTRIBUTE_ID_SCHEMA_LOCATION                      = 1
      , ATTRIBUTE_ID_TAG                                  = 2
      , ATTRIBUTE_ID_FORMATTING_MODE                      = 3
      , ATTRIBUTE_ID_INITIAL_INDENT_LEVEL                 = 4
      , ATTRIBUTE_ID_SPACES_PER_LEVEL                     = 5
      , ATTRIBUTE_ID_WRAP_COLUMN                          = 6
      , ATTRIBUTE_ID_MAX_DECIMAL_TOTAL_DIGITS             = 7
      , ATTRIBUTE_ID_MAX_DECIMAL_FRACTION_DIGITS          = 8
      , ATTRIBUTE_ID_SIGNIFICANT_DOUBLE_DIGITS            = 9
      , ATTRIBUTE_ID_ENCODING_STYLE                       = 10
      , ATTRIBUTE_ID_ALLOW_CONTROL_CHARACTERS             = 11
      , ATTRIBUTE_ID_OUTPUT_X_M_L_HEADER                  = 12
      , ATTRIBUTE_ID_OUTPUT_X_S_I_ALIAS                   = 13
      , ATTRIBUTE_ID_DATETIME_FRACTIONAL_SECOND_PRECISION = 14
      , ATTRIBUTE_ID_USE_Z_ABBREVIATION_FOR_UTC           = 15
    };

    enum {
        NUM_ATTRIBUTES = 16
    };

    enum {
        ATTRIBUTE_INDEX_OBJECT_NAMESPACE                     = 0
      , ATTRIBUTE_INDEX_SCHEMA_LOCATION                      = 1
      , ATTRIBUTE_INDEX_TAG                                  = 2
      , ATTRIBUTE_INDEX_FORMATTING_MODE                      = 3
      , ATTRIBUTE_INDEX_INITIAL_INDENT_LEVEL                 = 4
      , ATTRIBUTE_INDEX_SPACES_PER_LEVEL                     = 5
      , ATTRIBUTE_INDEX_WRAP_COLUMN                          = 6
      , ATTRIBUTE_INDEX_MAX_DECIMAL_TOTAL_DIGITS             = 7
      , ATTRIBUTE_INDEX_MAX_DECIMAL_FRACTION_DIGITS          = 8
      , ATTRIBUTE_INDEX_SIGNIFICANT_DOUBLE_DIGITS            = 9
      , ATTRIBUTE_INDEX_ENCODING_STYLE                       = 10
      , ATTRIBUTE_INDEX_ALLOW_CONTROL_CHARACTERS             = 11
      , ATTRIBUTE_INDEX_OUTPUT_X_M_L_HEADER                  = 12
      , ATTRIBUTE_INDEX_OUTPUT_X_S_I_ALIAS                   = 13
      , ATTRIBUTE_INDEX_DATETIME_FRACTIONAL_SECOND_PRECISION = 14
      , ATTRIBUTE_INDEX_USE_Z_ABBREVIATION_FOR_UTC           = 15
    };

    // CONSTANTS
    static const char CLASS_NAME[];

    static const int DEFAULT_INITIALIZER_FORMATTING_MODE;

    static const int DEFAULT_INITIALIZER_INITIAL_INDENT_LEVEL;

    static const int DEFAULT_INITIALIZER_SPACES_PER_LEVEL;

    static const int DEFAULT_INITIALIZER_WRAP_COLUMN;

    static const EncodingStyle::Value DEFAULT_INITIALIZER_ENCODING_STYLE;

    static const bool DEFAULT_INITIALIZER_ALLOW_CONTROL_CHARACTERS;

    static const bool DEFAULT_INITIALIZER_OUTPUT_X_M_L_HEADER;

    static const bool DEFAULT_INITIALIZER_OUTPUT_X_S_I_ALIAS;

    static const int DEFAULT_INITIALIZER_DATETIME_FRACTIONAL_SECOND_PRECISION;

    static const bool DEFAULT_INITIALIZER_USE_Z_ABBREVIATION_FOR_UTC;

    static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[];

  public:
    // CLASS METHODS

    /// Return attribute information for the attribute indicated by the
    /// specified `id` if the attribute exists, and 0 otherwise.
    static const bdlat_AttributeInfo *lookupAttributeInfo(int id);

    /// Return attribute information for the attribute indicated by the
    /// specified `name` of the specified `nameLength` if the attribute
    /// exists, and 0 otherwise.
    static const bdlat_AttributeInfo *lookupAttributeInfo(
                                                       const char *name,
                                                       int         nameLength);

    // CREATORS

    /// Create an object of type `EncoderOptions` having the default value.
    /// Use the optionally specified `basicAllocator` to supply memory.  If
    /// `basicAllocator` is 0, the currently installed default allocator is
    /// used.
    explicit EncoderOptions(bslma::Allocator *basicAllocator = 0);

    /// Create an object of type `EncoderOptions` having the value of the
    /// specified `original` object.  Use the optionally specified
    /// `basicAllocator` to supply memory.  If `basicAllocator` is 0, the
    /// currently installed default allocator is used.
    EncoderOptions(const EncoderOptions& original,
                   bslma::Allocator *basicAllocator = 0);

#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
    /// Create an object of type `EncoderOptions` having the value of the
    /// specified `original` object.  After performing this action, the
    /// `original` object will be left in a valid, but unspecified state.
    EncoderOptions(EncoderOptions&& original) noexcept;

    /// Create an object of type `EncoderOptions` having the value of the
    /// specified `original` object.  After performing this action, the
    /// `original` object will be left in a valid, but unspecified state.
    /// Use the optionally specified `basicAllocator` to supply memory.  If
    /// `basicAllocator` is 0, the currently installed default allocator is
    /// used.
    EncoderOptions(EncoderOptions&& original,
                   bslma::Allocator *basicAllocator);
#endif

    /// Destroy this object.
    ~EncoderOptions();

    // MANIPULATORS

    /// Assign to this object the value of the specified `rhs` object.
    EncoderOptions& operator=(const EncoderOptions& rhs);

#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
    /// Assign to this object the value of the specified `rhs` object.
    /// After performing this action, the `rhs` object will be left in a
    /// valid, but unspecified state.
    EncoderOptions& operator=(EncoderOptions&& rhs);
#endif

    /// Reset this object to the default value (i.e., its value upon
    /// default construction).
    void reset();

    /// Invoke the specified `manipulator` sequentially on the address of
    /// each (modifiable) attribute of this object, supplying `manipulator`
    /// with the corresponding attribute information structure until such
    /// invocation returns a non-zero value.  Return the value from the
    /// last invocation of `manipulator` (i.e., the invocation that
    /// terminated the sequence).
    template <typename t_MANIPULATOR>
    int manipulateAttributes(t_MANIPULATOR& manipulator);

    /// Invoke the specified `manipulator` on the address of
    /// the (modifiable) attribute indicated by the specified `id`,
    /// supplying `manipulator` with the corresponding attribute
    /// information structure.  Return the value returned from the
    /// invocation of `manipulator` if `id` identifies an attribute of this
    /// class, and -1 otherwise.
    template <typename t_MANIPULATOR>
    int manipulateAttribute(t_MANIPULATOR& manipulator, int id);

    /// Invoke the specified `manipulator` on the address of
    /// the (modifiable) attribute indicated by the specified `name` of the
    /// specified `nameLength`, supplying `manipulator` with the
    /// corresponding attribute information structure.  Return the value
    /// returned from the invocation of `manipulator` if `name` identifies
    /// an attribute of this class, and -1 otherwise.
    template <typename t_MANIPULATOR>
    int manipulateAttribute(t_MANIPULATOR&  manipulator,
                            const char   *name,
                            int           nameLength);

    /// Set the "ObjectNamespace" attribute of this object to the specified
    /// `value`.
    void setObjectNamespace(const bsl::string_view& value);

    /// Set the "SchemaLocation" attribute of this object to the specified
    /// `value`.
    void setSchemaLocation(const bsl::string_view& value);

    /// Set the "Tag" attribute of this object to the specified `value`.
    void setTag(const bsl::string_view& value);

    /// Set the "FormattingMode" attribute of this object to the specified
    /// `value`.
    void setFormattingMode(int value);

    /// Set the "InitialIndentLevel" attribute of this object to the
    /// specified `value`.
    void setInitialIndentLevel(int value);

    /// Set the "SpacesPerLevel" attribute of this object to the specified
    /// `value`.
    void setSpacesPerLevel(int value);

    /// Set the "WrapColumn" attribute of this object to the specified
    /// `value`.
    void setWrapColumn(int value);

    /// Set the "MaxDecimalTotalDigits" attribute of this object to the
    /// specified `value`.
    void setMaxDecimalTotalDigits(const bdlb::NullableValue<int>& value);

    /// Set the "MaxDecimalFractionDigits" attribute of this object to the
    /// specified `value`.
    void setMaxDecimalFractionDigits(const bdlb::NullableValue<int>& value);

    /// Set the "SignificantDoubleDigits" attribute of this object to the
    /// specified `value`.
    void setSignificantDoubleDigits(const bdlb::NullableValue<int>& value);

    /// Set the "EncodingStyle" attribute of this object to the specified
    /// `value`.
    void setEncodingStyle(EncodingStyle::Value value);

    /// Set the "AllowControlCharacters" attribute of this object to the
    /// specified `value`.
    void setAllowControlCharacters(bool value);

    /// Set the "OutputXMLHeader" attribute of this object to the specified
    /// `value`.
    void setOutputXMLHeader(bool value);

    /// Set the "OutputXSIAlias" attribute of this object to the specified
    /// `value`.
    void setOutputXSIAlias(bool value);

    /// Set the "DatetimeFractionalSecondPrecision" attribute of this object
    /// to the specified `value`.
    void setDatetimeFractionalSecondPrecision(int value);

    /// Set the "UseZAbbreviationForUtc" attribute of this object to the
    /// specified `value`.
    void setUseZAbbreviationForUtc(bool value);

    // ACCESSORS

    /// Format this object to the specified output `stream` at the
    /// optionally specified indentation `level` and return a reference to
    /// the modifiable `stream`.  If `level` is specified, optionally
    /// specify `spacesPerLevel`, the number of spaces per indentation level
    /// for this and all of its nested objects.  Each line is indented by
    /// the absolute value of `level * spacesPerLevel`.  If `level` is
    /// negative, suppress indentation of the first line.  If
    /// `spacesPerLevel` is negative, suppress line breaks and format the
    /// entire output on one line.  If `stream` is initially invalid, this
    /// operation has no effect.  Note that a trailing newline is provided
    /// in multiline mode only.
    bsl::ostream& print(bsl::ostream& stream,
                        int           level          = 0,
                        int           spacesPerLevel = 4) const;

    /// Invoke the specified `accessor` sequentially on each
    /// (non-modifiable) attribute of this object, supplying `accessor`
    /// with the corresponding attribute information structure until such
    /// invocation returns a non-zero value.  Return the value from the
    /// last invocation of `accessor` (i.e., the invocation that terminated
    /// the sequence).
    template <typename t_ACCESSOR>
    int accessAttributes(t_ACCESSOR& accessor) const;

    /// Invoke the specified `accessor` on the (non-modifiable) attribute
    /// of this object indicated by the specified `id`, supplying `accessor`
    /// with the corresponding attribute information structure.  Return the
    /// value returned from the invocation of `accessor` if `id` identifies
    /// an attribute of this class, and -1 otherwise.
    template <typename t_ACCESSOR>
    int accessAttribute(t_ACCESSOR& accessor, int id) const;

    /// Invoke the specified `accessor` on the (non-modifiable) attribute
    /// of this object indicated by the specified `name` of the specified
    /// `nameLength`, supplying `accessor` with the corresponding attribute
    /// information structure.  Return the value returned from the
    /// invocation of `accessor` if `name` identifies an attribute of this
    /// class, and -1 otherwise.
    template <typename t_ACCESSOR>
    int accessAttribute(t_ACCESSOR&   accessor,
                        const char *name,
                        int         nameLength) const;

    /// Return a reference offering non-modifiable access to the
    /// "ObjectNamespace" attribute of this object.
    const bsl::string& objectNamespace() const;

    /// Return a reference offering non-modifiable access to the
    /// "SchemaLocation" attribute of this object.
    const bsl::string& schemaLocation() const;

    /// Return a reference offering non-modifiable access to the "Tag"
    /// attribute of this object.
    const bsl::string& tag() const;

    /// Return the value of the "FormattingMode" attribute of this object.
    int formattingMode() const;

    /// Return the value of the "InitialIndentLevel" attribute of this
    /// object.
    int initialIndentLevel() const;

    /// Return the value of the "SpacesPerLevel" attribute of this object.
    int spacesPerLevel() const;

    /// Return the value of the "WrapColumn" attribute of this object.
    int wrapColumn() const;

    /// Return a reference offering non-modifiable access to the
    /// "MaxDecimalTotalDigits" attribute of this object.
    const bdlb::NullableValue<int>& maxDecimalTotalDigits() const;

    /// Return a reference offering non-modifiable access to the
    /// "MaxDecimalFractionDigits" attribute of this object.
    const bdlb::NullableValue<int>& maxDecimalFractionDigits() const;

    /// Return a reference offering non-modifiable access to the
    /// "SignificantDoubleDigits" attribute of this object.
    const bdlb::NullableValue<int>& significantDoubleDigits() const;

    /// Return the value of the "EncodingStyle" attribute of this object.
    EncodingStyle::Value encodingStyle() const;

    /// Return the value of the "AllowControlCharacters" attribute of this
    /// object.
    bool allowControlCharacters() const;

    /// Return the value of the "OutputXMLHeader" attribute of this object.
    bool outputXMLHeader() const;

    /// Return the value of the "OutputXSIAlias" attribute of this object.
    bool outputXSIAlias() const;

    /// Return the value of the "DatetimeFractionalSecondPrecision"
    /// attribute of this object.
    int datetimeFractionalSecondPrecision() const;

    /// Return the value of the "UseZAbbreviationForUtc" attribute of this
    /// object.
    bool useZAbbreviationForUtc() const;
};

// FREE OPERATORS

/// Return `true` if the specified `lhs` and `rhs` attribute objects have
/// the same value, and `false` otherwise.  Two attribute objects have the
/// same value if each respective attribute has the same value.
inline
bool operator==(const EncoderOptions& lhs, const EncoderOptions& rhs);

/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
/// have the same value, and `false` otherwise.  Two attribute objects do
/// not have the same value if one or more respective attributes differ in
/// values.
inline
bool operator!=(const EncoderOptions& lhs, const EncoderOptions& rhs);

/// Format the specified `rhs` to the specified output `stream` and
/// return a reference to the modifiable `stream`.
inline
bsl::ostream& operator<<(bsl::ostream& stream, const EncoderOptions& rhs);

}  // close package namespace

// TRAITS

BDLAT_DECL_SEQUENCE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS(balxml::EncoderOptions)

// ============================================================================
//                         INLINE FUNCTION DEFINITIONS
// ============================================================================

namespace balxml {

                            // --------------------
                            // class EncoderOptions
                            // --------------------

// CLASS METHODS
// MANIPULATORS
template <typename t_MANIPULATOR>
int EncoderOptions::manipulateAttributes(t_MANIPULATOR& manipulator)
{
    int ret;

    ret = manipulator(&d_objectNamespace, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OBJECT_NAMESPACE]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_schemaLocation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SCHEMA_LOCATION]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_tag, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_TAG]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_formattingMode, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_FORMATTING_MODE]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_initialIndentLevel, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_INITIAL_INDENT_LEVEL]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_spacesPerLevel, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SPACES_PER_LEVEL]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_wrapColumn, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_WRAP_COLUMN]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_maxDecimalTotalDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_DECIMAL_TOTAL_DIGITS]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_maxDecimalFractionDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_DECIMAL_FRACTION_DIGITS]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_significantDoubleDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SIGNIFICANT_DOUBLE_DIGITS]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_encodingStyle, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ENCODING_STYLE]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_allowControlCharacters, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOW_CONTROL_CHARACTERS]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_outputXMLHeader, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OUTPUT_X_M_L_HEADER]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_outputXSIAlias, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OUTPUT_X_S_I_ALIAS]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_datetimeFractionalSecondPrecision, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DATETIME_FRACTIONAL_SECOND_PRECISION]);
    if (ret) {
        return ret;
    }

    ret = manipulator(&d_useZAbbreviationForUtc, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_USE_Z_ABBREVIATION_FOR_UTC]);
    if (ret) {
        return ret;
    }

    return 0;
}

template <typename t_MANIPULATOR>
int EncoderOptions::manipulateAttribute(t_MANIPULATOR& manipulator, int id)
{
    enum { NOT_FOUND = -1 };

    switch (id) {
      case ATTRIBUTE_ID_OBJECT_NAMESPACE: {
        return manipulator(&d_objectNamespace, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OBJECT_NAMESPACE]);
      }
      case ATTRIBUTE_ID_SCHEMA_LOCATION: {
        return manipulator(&d_schemaLocation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SCHEMA_LOCATION]);
      }
      case ATTRIBUTE_ID_TAG: {
        return manipulator(&d_tag, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_TAG]);
      }
      case ATTRIBUTE_ID_FORMATTING_MODE: {
        return manipulator(&d_formattingMode, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_FORMATTING_MODE]);
      }
      case ATTRIBUTE_ID_INITIAL_INDENT_LEVEL: {
        return manipulator(&d_initialIndentLevel, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_INITIAL_INDENT_LEVEL]);
      }
      case ATTRIBUTE_ID_SPACES_PER_LEVEL: {
        return manipulator(&d_spacesPerLevel, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SPACES_PER_LEVEL]);
      }
      case ATTRIBUTE_ID_WRAP_COLUMN: {
        return manipulator(&d_wrapColumn, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_WRAP_COLUMN]);
      }
      case ATTRIBUTE_ID_MAX_DECIMAL_TOTAL_DIGITS: {
        return manipulator(&d_maxDecimalTotalDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_DECIMAL_TOTAL_DIGITS]);
      }
      case ATTRIBUTE_ID_MAX_DECIMAL_FRACTION_DIGITS: {
        return manipulator(&d_maxDecimalFractionDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_DECIMAL_FRACTION_DIGITS]);
      }
      case ATTRIBUTE_ID_SIGNIFICANT_DOUBLE_DIGITS: {
        return manipulator(&d_significantDoubleDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SIGNIFICANT_DOUBLE_DIGITS]);
      }
      case ATTRIBUTE_ID_ENCODING_STYLE: {
        return manipulator(&d_encodingStyle, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ENCODING_STYLE]);
      }
      case ATTRIBUTE_ID_ALLOW_CONTROL_CHARACTERS: {
        return manipulator(&d_allowControlCharacters, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOW_CONTROL_CHARACTERS]);
      }
      case ATTRIBUTE_ID_OUTPUT_X_M_L_HEADER: {
        return manipulator(&d_outputXMLHeader, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OUTPUT_X_M_L_HEADER]);
      }
      case ATTRIBUTE_ID_OUTPUT_X_S_I_ALIAS: {
        return manipulator(&d_outputXSIAlias, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OUTPUT_X_S_I_ALIAS]);
      }
      case ATTRIBUTE_ID_DATETIME_FRACTIONAL_SECOND_PRECISION: {
        return manipulator(&d_datetimeFractionalSecondPrecision, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DATETIME_FRACTIONAL_SECOND_PRECISION]);
      }
      case ATTRIBUTE_ID_USE_Z_ABBREVIATION_FOR_UTC: {
        return manipulator(&d_useZAbbreviationForUtc, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_USE_Z_ABBREVIATION_FOR_UTC]);
      }
      default:
        return NOT_FOUND;
    }
}

template <typename t_MANIPULATOR>
int EncoderOptions::manipulateAttribute(
        t_MANIPULATOR& manipulator,
        const char    *name,
        int            nameLength)
{
    enum { NOT_FOUND = -1 };

    const bdlat_AttributeInfo *attributeInfo =
                                         lookupAttributeInfo(name, nameLength);
    if (0 == attributeInfo) {
        return NOT_FOUND;
    }

    return manipulateAttribute(manipulator, attributeInfo->d_id);
}

inline
void EncoderOptions::setObjectNamespace(const bsl::string_view& value)
{
    d_objectNamespace = value;
}

inline
void EncoderOptions::setSchemaLocation(const bsl::string_view& value)
{
    d_schemaLocation = value;
}

inline
void EncoderOptions::setTag(const bsl::string_view& value)
{
    d_tag = value;
}

inline
void EncoderOptions::setFormattingMode(int value)
{
    d_formattingMode = value;
}

inline
void EncoderOptions::setInitialIndentLevel(int value)
{
    d_initialIndentLevel = value;
}

inline
void EncoderOptions::setSpacesPerLevel(int value)
{
    d_spacesPerLevel = value;
}

inline
void EncoderOptions::setWrapColumn(int value)
{
    d_wrapColumn = value;
}

inline
void EncoderOptions::setMaxDecimalTotalDigits(const bdlb::NullableValue<int>& value)
{
    d_maxDecimalTotalDigits = value;
}

inline
void EncoderOptions::setMaxDecimalFractionDigits(const bdlb::NullableValue<int>& value)
{
    d_maxDecimalFractionDigits = value;
}

inline
void EncoderOptions::setSignificantDoubleDigits(const bdlb::NullableValue<int>& value)
{
    d_significantDoubleDigits = value;
}

inline
void EncoderOptions::setEncodingStyle(EncodingStyle::Value value)
{
    d_encodingStyle = value;
}

inline
void EncoderOptions::setAllowControlCharacters(bool value)
{
    d_allowControlCharacters = value;
}

inline
void EncoderOptions::setOutputXMLHeader(bool value)
{
    d_outputXMLHeader = value;
}

inline
void EncoderOptions::setOutputXSIAlias(bool value)
{
    d_outputXSIAlias = value;
}

inline
void EncoderOptions::setDatetimeFractionalSecondPrecision(int value)
{
    d_datetimeFractionalSecondPrecision = value;
}

inline
void EncoderOptions::setUseZAbbreviationForUtc(bool value)
{
    d_useZAbbreviationForUtc = value;
}

// ACCESSORS
template <typename t_ACCESSOR>
int EncoderOptions::accessAttributes(t_ACCESSOR& accessor) const
{
    int ret;

    ret = accessor(d_objectNamespace, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OBJECT_NAMESPACE]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_schemaLocation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SCHEMA_LOCATION]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_tag, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_TAG]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_formattingMode, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_FORMATTING_MODE]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_initialIndentLevel, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_INITIAL_INDENT_LEVEL]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_spacesPerLevel, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SPACES_PER_LEVEL]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_wrapColumn, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_WRAP_COLUMN]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_maxDecimalTotalDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_DECIMAL_TOTAL_DIGITS]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_maxDecimalFractionDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_DECIMAL_FRACTION_DIGITS]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_significantDoubleDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SIGNIFICANT_DOUBLE_DIGITS]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_encodingStyle, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ENCODING_STYLE]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_allowControlCharacters, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOW_CONTROL_CHARACTERS]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_outputXMLHeader, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OUTPUT_X_M_L_HEADER]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_outputXSIAlias, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OUTPUT_X_S_I_ALIAS]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_datetimeFractionalSecondPrecision, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DATETIME_FRACTIONAL_SECOND_PRECISION]);
    if (ret) {
        return ret;
    }

    ret = accessor(d_useZAbbreviationForUtc, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_USE_Z_ABBREVIATION_FOR_UTC]);
    if (ret) {
        return ret;
    }

    return 0;
}

template <typename t_ACCESSOR>
int EncoderOptions::accessAttribute(t_ACCESSOR& accessor, int id) const
{
    enum { NOT_FOUND = -1 };

    switch (id) {
      case ATTRIBUTE_ID_OBJECT_NAMESPACE: {
        return accessor(d_objectNamespace, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OBJECT_NAMESPACE]);
      }
      case ATTRIBUTE_ID_SCHEMA_LOCATION: {
        return accessor(d_schemaLocation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SCHEMA_LOCATION]);
      }
      case ATTRIBUTE_ID_TAG: {
        return accessor(d_tag, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_TAG]);
      }
      case ATTRIBUTE_ID_FORMATTING_MODE: {
        return accessor(d_formattingMode, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_FORMATTING_MODE]);
      }
      case ATTRIBUTE_ID_INITIAL_INDENT_LEVEL: {
        return accessor(d_initialIndentLevel, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_INITIAL_INDENT_LEVEL]);
      }
      case ATTRIBUTE_ID_SPACES_PER_LEVEL: {
        return accessor(d_spacesPerLevel, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SPACES_PER_LEVEL]);
      }
      case ATTRIBUTE_ID_WRAP_COLUMN: {
        return accessor(d_wrapColumn, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_WRAP_COLUMN]);
      }
      case ATTRIBUTE_ID_MAX_DECIMAL_TOTAL_DIGITS: {
        return accessor(d_maxDecimalTotalDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_DECIMAL_TOTAL_DIGITS]);
      }
      case ATTRIBUTE_ID_MAX_DECIMAL_FRACTION_DIGITS: {
        return accessor(d_maxDecimalFractionDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_DECIMAL_FRACTION_DIGITS]);
      }
      case ATTRIBUTE_ID_SIGNIFICANT_DOUBLE_DIGITS: {
        return accessor(d_significantDoubleDigits, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SIGNIFICANT_DOUBLE_DIGITS]);
      }
      case ATTRIBUTE_ID_ENCODING_STYLE: {
        return accessor(d_encodingStyle, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ENCODING_STYLE]);
      }
      case ATTRIBUTE_ID_ALLOW_CONTROL_CHARACTERS: {
        return accessor(d_allowControlCharacters, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOW_CONTROL_CHARACTERS]);
      }
      case ATTRIBUTE_ID_OUTPUT_X_M_L_HEADER: {
        return accessor(d_outputXMLHeader, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OUTPUT_X_M_L_HEADER]);
      }
      case ATTRIBUTE_ID_OUTPUT_X_S_I_ALIAS: {
        return accessor(d_outputXSIAlias, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_OUTPUT_X_S_I_ALIAS]);
      }
      case ATTRIBUTE_ID_DATETIME_FRACTIONAL_SECOND_PRECISION: {
        return accessor(d_datetimeFractionalSecondPrecision, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DATETIME_FRACTIONAL_SECOND_PRECISION]);
      }
      case ATTRIBUTE_ID_USE_Z_ABBREVIATION_FOR_UTC: {
        return accessor(d_useZAbbreviationForUtc, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_USE_Z_ABBREVIATION_FOR_UTC]);
      }
      default:
        return NOT_FOUND;
    }
}

template <typename t_ACCESSOR>
int EncoderOptions::accessAttribute(
        t_ACCESSOR&  accessor,
        const char  *name,
        int          nameLength) const
{
    enum { NOT_FOUND = -1 };

    const bdlat_AttributeInfo *attributeInfo =
          lookupAttributeInfo(name, nameLength);
    if (0 == attributeInfo) {
       return NOT_FOUND;
    }

    return accessAttribute(accessor, attributeInfo->d_id);
}

inline
const bsl::string& EncoderOptions::objectNamespace() const
{
    return d_objectNamespace;
}

inline
const bsl::string& EncoderOptions::schemaLocation() const
{
    return d_schemaLocation;
}

inline
const bsl::string& EncoderOptions::tag() const
{
    return d_tag;
}

inline
int EncoderOptions::formattingMode() const
{
    return d_formattingMode;
}

inline
int EncoderOptions::initialIndentLevel() const
{
    return d_initialIndentLevel;
}

inline
int EncoderOptions::spacesPerLevel() const
{
    return d_spacesPerLevel;
}

inline
int EncoderOptions::wrapColumn() const
{
    return d_wrapColumn;
}

inline
const bdlb::NullableValue<int>& EncoderOptions::maxDecimalTotalDigits() const
{
    return d_maxDecimalTotalDigits;
}

inline
const bdlb::NullableValue<int>& EncoderOptions::maxDecimalFractionDigits() const
{
    return d_maxDecimalFractionDigits;
}

inline
const bdlb::NullableValue<int>& EncoderOptions::significantDoubleDigits() const
{
    return d_significantDoubleDigits;
}

inline
EncodingStyle::Value EncoderOptions::encodingStyle() const
{
    return d_encodingStyle;
}

inline
bool EncoderOptions::allowControlCharacters() const
{
    return d_allowControlCharacters;
}

inline
bool EncoderOptions::outputXMLHeader() const
{
    return d_outputXMLHeader;
}

inline
bool EncoderOptions::outputXSIAlias() const
{
    return d_outputXSIAlias;
}

inline
int EncoderOptions::datetimeFractionalSecondPrecision() const
{
    return d_datetimeFractionalSecondPrecision;
}

inline
bool EncoderOptions::useZAbbreviationForUtc() const
{
    return d_useZAbbreviationForUtc;
}

}  // close package namespace

// FREE FUNCTIONS

inline
bool balxml::operator==(
        const balxml::EncoderOptions& lhs,
        const balxml::EncoderOptions& rhs)
{
    return  lhs.objectNamespace() == rhs.objectNamespace()
         && lhs.schemaLocation() == rhs.schemaLocation()
         && lhs.tag() == rhs.tag()
         && lhs.formattingMode() == rhs.formattingMode()
         && lhs.initialIndentLevel() == rhs.initialIndentLevel()
         && lhs.spacesPerLevel() == rhs.spacesPerLevel()
         && lhs.wrapColumn() == rhs.wrapColumn()
         && lhs.maxDecimalTotalDigits() == rhs.maxDecimalTotalDigits()
         && lhs.maxDecimalFractionDigits() == rhs.maxDecimalFractionDigits()
         && lhs.significantDoubleDigits() == rhs.significantDoubleDigits()
         && lhs.encodingStyle() == rhs.encodingStyle()
         && lhs.allowControlCharacters() == rhs.allowControlCharacters()
         && lhs.outputXMLHeader() == rhs.outputXMLHeader()
         && lhs.outputXSIAlias() == rhs.outputXSIAlias()
         && lhs.datetimeFractionalSecondPrecision() == rhs.datetimeFractionalSecondPrecision()
         && lhs.useZAbbreviationForUtc() == rhs.useZAbbreviationForUtc();
}

inline
bool balxml::operator!=(
        const balxml::EncoderOptions& lhs,
        const balxml::EncoderOptions& rhs)
{
    return !(lhs == rhs);
}

inline
bsl::ostream& balxml::operator<<(
        bsl::ostream& stream,
        const balxml::EncoderOptions& rhs)
{
    return rhs.print(stream, 0, -1);
}

}  // close enterprise namespace
#endif

// GENERATED BY @BLP_BAS_CODEGEN_VERSION@
// USING bas_codegen.pl -m msg -p balxml -E --noExternalization --noAggregateConversion --noHashSupport balxml.xsd
// ----------------------------------------------------------------------------
// NOTICE:
//      Copyright 2023 Bloomberg Finance L.P. All rights reserved.
//      Property of Bloomberg Finance L.P. (BFLP)
//      This software is made available solely pursuant to the
//      terms of a BFLP license agreement which governs its use.
// ------------------------------- END-OF-FILE --------------------------------
