Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bdld::DatumError Class Reference

#include <bdld_datumerror.h>

List of all members.

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (DatumError, bsl::is_trivially_copyable)
 BSLMF_NESTED_TRAIT_DECLARATION (DatumError, bdlb::HasPrintMethod)
 DatumError ()
 DatumError (int code)
 DatumError (int code, const bslstl::StringRef &message)
 DatumError (const DatumError &origin)
 ~DatumError ()
DatumErroroperator= (const DatumError &rhs)
int code () const
bslstl::StringRef message () const
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const

Detailed Description

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.

See Component bdld_datumerror


Constructor & Destructor Documentation

bdld::DatumError::DatumError (  ) 

Create a DatumError object having the default error code of 0 and an empty error message.

bdld::DatumError::DatumError ( int  code  )  [explicit]

Create a DatumError object having the specified error code value and and empty error message.

bdld::DatumError::DatumError ( int  code,
const bslstl::StringRef message 
)

Create a DatumError object having the specified error code value and the specified error message value. Note that the message is held by the reference and not copied.

bdld::DatumError::DatumError ( const DatumError origin  ) 
bdld::DatumError::~DatumError (  ) 

Member Function Documentation

bdld::DatumError::BSLMF_NESTED_TRAIT_DECLARATION ( DatumError  ,
bsl::is_trivially_copyable   
)
bdld::DatumError::BSLMF_NESTED_TRAIT_DECLARATION ( DatumError  ,
bdlb::HasPrintMethod   
)
DatumError& bdld::DatumError::operator= ( const DatumError rhs  ) 
int bdld::DatumError::code (  )  const

Return the error code.

bslstl::StringRef bdld::DatumError::message (  )  const

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.

bsl::ostream& bdld::DatumError::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

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.


The documentation for this class was generated from the following file: