BloombergLP::balxml::Formatter::addAttribute

Add an attribute of the specified name and specified value to the currently open element. value can be of the following types: char, short, int, bsls::Types::Int64, float, double, bsl::string, bdlt::Datetime, bdlt::Date, and bdlt::Time. Precede this name="value" pair with a single space. Wrap line (write the attribute on next line with proper indentation), if the length of name="value" is too long. Optionally specify a formattingMode used to control the formatting of the value. If value is of type bsl::string or convertible to bsl::string_view, the presence of invalid input stops the transfer of data to the output specified on construction (see {Valid Strings}). If value is of type bsl::string or convertible to bsl::string_view, any special characters in value are escaped (see {Special Characters}). If value is of type char, it is cast to a signed byte value with a range [ -128 .. 127 ]. The behavior is undefined unless the last manipulator was openElement or addAttribute.

Synopsis

Declared in <balxml_formatter.h>

template<class TYPE>
void
addAttribute(
    std::string_view const& name,
    TYPE const& value,
    int formattingMode = 0);