BloombergLP::bdljsn::WriteOptions

This simply constrained (value-semantic) attribute class specifies options for writing a JSON document. See the for information on the class attributes. Note that the class invariants are identically the constraints on the individual attributes.

Synopsis

Declared in <bdljsn_writeoptions.h>

class WriteOptions;

Member Functions

NameDescription
WriteOptions [constructor]Constructors
~WriteOptions [destructor]Destroy this object.
operator= Assign to this object the value of the specified rhs object and return a non-const reference to this object.
escapeForwardSlash Return the escapeForwardSlash attribute of this object.
initialIndentLevel Return the initialIndentLevel attribute of this object.
print 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. Also note that the format is not fully specified, and can change without notice.
reset Reset this object to the default value (i.e., its value upon default construction) and return a non-const reference to this object.
setEscapeForwardSlash Set the escapeForwardSlash attribute of this object to the specified value and return a non-const reference to this object.
setInitialIndentLevel Set the initialIndentLevel attribute of this object to the specified value and return a non-const reference to this object. The behavior is undefined unless 0 <= value.
setSortMembers Set the sortMembers attribute of this object to the specified value and return a non-const reference to this object.
setSpacesPerLevel Set the spacesPerLevel attribute of this object to the specified value and return a non-const reference to this object. The behavior is undefined unless 0 <= value.
setStyle Set the style attribute of this object to the specified value and return a non-const reference to this object.
sortMembers Return the sortMembers attribute of this object.
spacesPerLevel Return the spacesPerLevel attribute of this object.
style Return the style attribute of this object.

Static Data Members

NameDescription
s_DEFAULT_INITIALIZER_ESCAPE_FORWARD_SLASH Default value for the escapeForwardSlash attribute.
s_DEFAULT_INITIALIZER_INITIAL_INDENT_LEVEL Default value for the initialIndentLevel attribute.
s_DEFAULT_INITIALIZER_SORT_MEMBERS Default value for the sortMembers attribute.
s_DEFAULT_INITIALIZER_SPACES_PER_LEVEL Default value for the spacesPerLevel attribute.
s_DEFAULT_INITIALIZER_STYLE Default value for the style attribute.

Non-Member Functions

NameDescription
operator!=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.
operator==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.