Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions | Static Public Member Functions | Friends

baltzo::LocalDatetime Class Reference

#include <baltzo_localdatetime.h>

List of all members.

Public Types

typedef bsl::allocator< char > allocator_type

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (LocalDatetime, bslma::UsesBslmaAllocator)
 BSLMF_NESTED_TRAIT_DECLARATION (LocalDatetime, bslmf::IsBitwiseMoveable)
 LocalDatetime ()
 LocalDatetime (const allocator_type &allocator)
 LocalDatetime (const bdlt::DatetimeTz &datetimeTz, const bsl::string_view &timeZoneId, const allocator_type &allocator=allocator_type())
 LocalDatetime (const bdlt::DatetimeTz &datetimeTz, const char *timeZoneId, const allocator_type &allocator=allocator_type())
 LocalDatetime (const LocalDatetime &original, const allocator_type &allocator=allocator_type())
 LocalDatetime (bslmf::MovableRef< LocalDatetime > original) BSLS_KEYWORD_NOEXCEPT
 LocalDatetime (bslmf::MovableRef< LocalDatetime > original, const allocator_type &allocator)
 ~LocalDatetime ()
LocalDatetimeoperator= (const LocalDatetime &rhs)
LocalDatetimeoperator= (bslmf::MovableRef< LocalDatetime > rhs)
void setDatetimeTz (const bdlt::DatetimeTz &value)
void setTimeZoneId (const bsl::string_view &value)
void setTimeZoneId (const char *value)
template<class STREAM >
STREAM & bdexStreamIn (STREAM &stream, int version)
void swap (LocalDatetime &other)
const bdlt::DatetimeTzdatetimeTz () const
const bsl::stringtimeZoneId () const
bslma::Allocatorallocator () const
allocator_type get_allocator () const
template<class STREAM >
STREAM & bdexStreamOut (STREAM &stream, int version) const
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const

Static Public Member Functions

static int maxSupportedBdexVersion ()
static int maxSupportedBdexVersion (int versionSelector)

Friends

void swap (LocalDatetime &, LocalDatetime &)

Detailed Description

This unconstrained (value-semantic) attribute class characterizes a date time, offset from UTC, and a time zone identifier represented by a string. See the Attributes section under @DESCRIPTION in the component-level documentation.

See Component baltzo_localdatetime


Member Typedef Documentation


Constructor & Destructor Documentation

baltzo::LocalDatetime::LocalDatetime (  ) 
baltzo::LocalDatetime::LocalDatetime ( const allocator_type allocator  )  [explicit]

Create a LocalDatetime object having the (default) attribute values:

Optionally specify an allocator (e.g., the address of a bslma::Allocator object) to supply memory; otherwise, the default allocator is used.

baltzo::LocalDatetime::LocalDatetime ( const bdlt::DatetimeTz datetimeTz,
const bsl::string_view &  timeZoneId,
const allocator_type allocator = allocator_type() 
)
baltzo::LocalDatetime::LocalDatetime ( const bdlt::DatetimeTz datetimeTz,
const char *  timeZoneId,
const allocator_type allocator = allocator_type() 
)

Create a LocalDatetime object with attribute values set from the specified datetimeTz and timeZoneId. Optionally specify an allocator (e.g., the address of a bslma::Allocator object) to supply memory; otherwise, the default allocator is used. If timeZoneId is passed as a null pointer, it is treated as an empty string.

baltzo::LocalDatetime::LocalDatetime ( const LocalDatetime original,
const allocator_type allocator = allocator_type() 
)

Create a LocalDatetime object having the same value as the specified original object. Optionally specify an allocator (e.g., the address of a bslma::Allocator object) to supply memory; otherwise, the default allocator is used.

baltzo::LocalDatetime::LocalDatetime ( bslmf::MovableRef< LocalDatetime original  ) 

Create a LocalDatetime object having the same value and the same allocator as the specified original object. The value of original becomes unspecified but valid, and its allocator remains unchanged.

baltzo::LocalDatetime::LocalDatetime ( bslmf::MovableRef< LocalDatetime original,
const allocator_type allocator 
)

Create a LocalDatetime object having the same value as the specified original object, using the specified allocator (e.g., the address of a bslma::Allocator object) to supply memory. The allocator of original remains unchanged. If original and the newly created object have the same allocator then the value of original becomes unspecified but valid, and no exceptions will be thrown; otherwise original is unchanged and an exception may be thrown.

baltzo::LocalDatetime::~LocalDatetime (  ) 

Destroy this object.


Member Function Documentation

baltzo::LocalDatetime::BSLMF_NESTED_TRAIT_DECLARATION ( LocalDatetime  ,
bslma::UsesBslmaAllocator   
)
baltzo::LocalDatetime::BSLMF_NESTED_TRAIT_DECLARATION ( LocalDatetime  ,
bslmf::IsBitwiseMoveable   
)
static int baltzo::LocalDatetime::maxSupportedBdexVersion (  )  [static]

DEPRECATED: Use maxSupportedBdexVersion(int) instead.

Return the most current BDEX streaming version number supported by this class.

static int baltzo::LocalDatetime::maxSupportedBdexVersion ( int  versionSelector  )  [static]

Return the maximum valid BDEX format version, as indicated by the specified versionSelector, to be passed to the bdexStreamOut method. Note that it is highly recommended that versionSelector be formatted as "YYYYMMDD", a date representation. Also note that versionSelector should be a compile-time-chosen value that selects a format version supported by both externalizer and unexternalizer. See the bslx package-level documentation for more information on BDEX streaming of value-semantic types and containers.

LocalDatetime& baltzo::LocalDatetime::operator= ( const LocalDatetime rhs  ) 

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.

LocalDatetime& baltzo::LocalDatetime::operator= ( bslmf::MovableRef< LocalDatetime rhs  ) 

Assign to this object the value of the specified rhs object, and return a non-'const' reference to this object. The allocators of this object and rhs both remain unchanged. If rhs and this object have the same allocator then the value of rhs becomes unspecified but valid, and no exceptions will be thrown; otherwise rhs is unchanged (and an exception may be thrown).

void baltzo::LocalDatetime::setDatetimeTz ( const bdlt::DatetimeTz value  ) 

Set the datetimeTz attribute of this object to the specified value.

void baltzo::LocalDatetime::setTimeZoneId ( const bsl::string_view &  value  ) 
void baltzo::LocalDatetime::setTimeZoneId ( const char *  value  ) 

Set the timeZoneId attribute of this object to the specified value. If value is null, it is treated as an empty string.

template<class STREAM >
STREAM& baltzo::LocalDatetime::bdexStreamIn ( STREAM &  stream,
int  version 
)

Assign to this object the value read from the specified input stream using the specified version format, and return a reference to stream. If stream is initially invalid, this operation has no effect. If version is not supported, this object is unaltered and stream is invalidated, but otherwise unmodified. If version is supported but stream becomes invalid during this operation, this object has an undefined, but valid, state. Note that no version is read from stream. See the bslx package-level documentation for more information on BDEX streaming of value-semantic types and containers.

void baltzo::LocalDatetime::swap ( LocalDatetime other  ) 

Efficiently exchange the value of this object with the value of the specified other object. This method provides the no-throw exception-safety guarantee. The behavior is undefined unless this object was created with the same allocator as was other.

const bdlt::DatetimeTz& baltzo::LocalDatetime::datetimeTz (  )  const

Return a reference providing non-modifiable access to the datetimeTz attribute of this object.

const bsl::string& baltzo::LocalDatetime::timeZoneId (  )  const

Return a reference providing non-modifiable access to the timeZoneId attribute of this object.

bslma::Allocator* baltzo::LocalDatetime::allocator (  )  const

DEPRECATED: Use get_allocator() instead.

Return get_allocator().mechanism().

allocator_type baltzo::LocalDatetime::get_allocator (  )  const

Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the default allocator in effect at construction is used.

template<class STREAM >
STREAM& baltzo::LocalDatetime::bdexStreamOut ( STREAM &  stream,
int  version 
) const

Write the value of this object, using the specified version format, to the specified output stream, and return a reference to stream. If stream is initially invalid, this operation has no effect. If version is not supported, stream is invalidated, but otherwise unmodified. Note that version is not written to stream. See the bslx package-level documentation for more information on BDEX streaming of value-semantic types and containers.

bsl::ostream& baltzo::LocalDatetime::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 providing modifiable access to 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, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect. Note that the format is not fully specified, and can change without notice.


Friends And Related Function Documentation

void swap ( LocalDatetime ,
LocalDatetime  
) [friend]

Exchange the values of the specified a and b objects. This function provides the no-throw exception-safety guarantee if the two objects were created with the same allocator and the basic guarantee otherwise.


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