[#BloombergLP-bdld-DatumError] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdld.adoc[bdld]::DatumError :relfileprefix: ../../ :mrdocs: This component `class` provides a _complex constrained_ attribute type, `bdld::DatumError`, that represents an error code with an optional descriptive error message. Note that this class holds a reference to the error message and does not make a copy of it. == Synopsis Declared in `<bdld_datumerror.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class DatumError; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdld/DatumError/2constructor-0b.adoc[`DatumError`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdld/DatumError/code.adoc[`code`] | Return the error code. | xref:BloombergLP/bdld/DatumError/message.adoc[`message`] | Return a reference to the non‐modifyable error message. The returned reference remains valid as long as the underlying message is not modified or destroyed ‐‐ irrespective of the state (or existence) of this object. The behavior is undefined unless the underlying error message has been modified or destroyed since this object was created. | xref:BloombergLP/bdld/DatumError/print.adoc[`print`] | Write the value of this object to the specified output `stream` in a human‐readable format, and return a reference to the modifyable `stream`. Optionally specify an initial indentation `level`, whose absolute value is incremented recursively for nested objects. If `level` is specified, optionally specify `spacesPerLevel`, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If `level` is negative, suppress indentation of the first line. If `spacesPerLevel` is negative, suppress all but the initial indentation (as governed by `level`). For readability the entire output is formatted on one line, regardless of the `spacesPerLevel` value. If `stream` is not valid on entry, this operation has no effect. Note that this human‐readable format is not fully specified, and can change without notice. | xref:BloombergLP/bdld/DatumError/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<DatumError, HasPrintMethod>`] | `DatumError` is trivially copyable. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdld/operator_not_eq-0f.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` have different values and `false` otherwise. Two `DatumError` objects have different values if they have different error code or message values. | xref:BloombergLP/bdld/operator_lt-03.adoc[`operator<`] | Return `true` if value of the specified `lhs` is less than value of the specified `rhs` and `false` otherwise. Value of `lhs` is less than value of `rhs` if error code value of `lhs` is less than error code value of `rhs`, or they have the same error code value and error message value of `lhs` is less than error message value of `rhs`. | xref:BloombergLP/bdld/operator_le-06.adoc[`operator<=`] | Return `true` if value of the specified `lhs` is less than or equal to value of the specified `rhs` and `false` otherwise. Value of `lhs` is less than or equal to value of `rhs` if error code value of `lhs` is less than or equal to error code value of `rhs`, or they have the same error code value and error message value of `lhs` is less than or equal to error message value of `rhs`. | xref:BloombergLP/bdld/operator_eq-0b.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` have the same value and `false` otherwise. Two `DatumError` objects have the same value if they have same error code and message values. | xref:BloombergLP/bdld/operator_gt-05.adoc[`operator>`] | Return `true` if value of the specified `lhs` is greater than value of the specified `rhs` and `false` otherwise. Value of `lhs` is greater than value of `rhs` if error code value of `lhs` is greater than error code value of `rhs`, or they have the same error code value and error message value of `lhs` is greater than error message value of `rhs`. | xref:BloombergLP/bdld/operator_ge-07.adoc[`operator>=`] | Return `true` if value of the specified `lhs` is greater than or equal to value of the specified `rhs` and `false` otherwise. Value of `lhs` is greater than or equal to value of `rhs` if error code value of `lhs` is greater than or equal to error code value of `rhs`, or they have the same error code value and error message value of `lhs` is greater than or equal to error message value of `rhs`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#