|
BDE 4.14.0 Production release
|
#include <bdljsn_writeoptions.h>
Public Member Functions | |
| WriteOptions () | |
| WriteOptions (const WriteOptions &original) | |
| ~WriteOptions () | |
| Destroy this object. | |
| WriteOptions & | operator= (const WriteOptions &rhs) |
| WriteOptions & | reset () |
| WriteOptions & | setInitialIndentLevel (int value) |
| WriteOptions & | setSortMembers (bool value) |
| WriteOptions & | setSpacesPerLevel (int value) |
| WriteOptions & | setStyle (bdljsn::WriteStyle::Enum value) |
| int | initialIndentLevel () const |
Return the initialIndentLevel attribute of this object. | |
| bool | sortMembers () const |
Return the sortMembers attribute of this object. | |
| int | spacesPerLevel () const |
Return the spacesPerLevel attribute of this object. | |
| bdljsn::WriteStyle::Enum | style () const |
Return the style attribute of this object. | |
| bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
Static Public Attributes | |
| static const int | s_DEFAULT_INITIALIZER_INITIAL_INDENT_LEVEL |
| static const bool | s_DEFAULT_INITIALIZER_SORT_MEMBERS |
| static const int | s_DEFAULT_INITIALIZER_SPACES_PER_LEVEL |
| static const bdljsn::WriteStyle::Enum | s_DEFAULT_INITIALIZER_STYLE |
This simply constrained (value-semantic) attribute class specifies options for writing a JSON document. See the {Attributes} section under {DESCRIPTION} in the component-level documentation for information on the class attributes. Note that the class invariants are identically the constraints on the individual attributes.
| bdljsn::WriteOptions::WriteOptions | ( | ) |
Create an object of type WriteOptions having the (default) attribute values:
|
inline |
Create an object of type WriteOptions having the value of the specified original object.
|
inline |
|
inline |
|
inline |
Assign to this object the value of the specified rhs object and return a non-const reference to this object.
| bsl::ostream & bdljsn::WriteOptions::print | ( | bsl::ostream & | stream, |
| int | level = 0, |
||
| int | spacesPerLevel = 4 |
||
| ) | const |
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.
| WriteOptions & bdljsn::WriteOptions::reset | ( | ) |
Reset this object to the default value (i.e., its value upon default construction) and return a non-const reference to this object.
|
inline |
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.
|
inline |
Set the sortMembers attribute of this object to the specified value and return a non-const reference to this object.
|
inline |
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.
|
inline |
Set the style attribute of this object to the specified value. and return a non-const reference to this object.
|
inline |
|
inline |
|
inline |
|
static |
|
static |
|
static |
|
static |