BDE 4.14.0 Production release
Loading...
Searching...
No Matches
baltzo::LocalDatetime Class Reference

#include <baltzo_localdatetime.h>

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 ()
 Destroy this object.
 
LocalDatetimeoperator= (const LocalDatetime &rhs)
 
LocalDatetimeoperator= (bslmf::MovableRef< LocalDatetime > rhs)
 
void setDatetimeTz (const bdlt::DatetimeTz &value)
 Set the datetimeTz attribute of this object to the specified 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 for information on the class attributes.

See baltzo_localdatetime

Member Typedef Documentation

◆ allocator_type

Constructor & Destructor Documentation

◆ LocalDatetime() [1/7]

baltzo::LocalDatetime::LocalDatetime ( )
inline

◆ LocalDatetime() [2/7]

baltzo::LocalDatetime::LocalDatetime ( const allocator_type allocator)
inlineexplicit

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

timeZoneId() == ""
const bsl::string & timeZoneId() const
Definition baltzo_localdatetime.h:562
const bdlt::DatetimeTz & datetimeTz() const
Definition baltzo_localdatetime.h:556
Definition bdlt_datetimetz.h:308

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

◆ LocalDatetime() [3/7]

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

◆ LocalDatetime() [4/7]

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

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.

◆ LocalDatetime() [5/7]

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

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.

◆ LocalDatetime() [6/7]

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

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.

◆ LocalDatetime() [7/7]

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

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.

◆ ~LocalDatetime()

baltzo::LocalDatetime::~LocalDatetime ( )
inline

Member Function Documentation

◆ allocator()

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

Return get_allocator().mechanism().

@DEPRECATED Use get_allocator() instead.

◆ bdexStreamIn()

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.

◆ bdexStreamOut()

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.

◆ BSLMF_NESTED_TRAIT_DECLARATION() [1/2]

baltzo::LocalDatetime::BSLMF_NESTED_TRAIT_DECLARATION ( LocalDatetime  ,
bslma::UsesBslmaAllocator   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION() [2/2]

baltzo::LocalDatetime::BSLMF_NESTED_TRAIT_DECLARATION ( LocalDatetime  ,
bslmf::IsBitwiseMoveable   
)

◆ datetimeTz()

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

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

◆ get_allocator()

LocalDatetime::allocator_type baltzo::LocalDatetime::get_allocator ( ) const
inline

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.

◆ maxSupportedBdexVersion() [1/2]

int baltzo::LocalDatetime::maxSupportedBdexVersion ( )
inlinestatic

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

@DEPRECATED Use maxSupportedBdexVersion(int) instead.

◆ maxSupportedBdexVersion() [2/2]

int baltzo::LocalDatetime::maxSupportedBdexVersion ( int  versionSelector)
inlinestatic

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.

◆ operator=() [1/2]

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

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).

◆ operator=() [2/2]

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

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

◆ print()

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.

◆ setDatetimeTz()

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

◆ setTimeZoneId() [1/2]

void baltzo::LocalDatetime::setTimeZoneId ( const bsl::string_view value)
inline

◆ setTimeZoneId() [2/2]

void baltzo::LocalDatetime::setTimeZoneId ( const char *  value)
inline

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

◆ swap()

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

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.

◆ timeZoneId()

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

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

Friends And Related Symbol Documentation

◆ swap

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: