8#ifndef INCLUDED_BDLT_TIMETZFORMATTER
9#define INCLUDED_BDLT_TIMETZFORMATTER
77#include <bdlscm_version.h>
85#include <bsl_iosfwd.h>
86#include <bsl_string_view.h>
91class TimeTzFormatter_Cache;
100template <
class t_CHAR>
114 k_DEFAULT_PRECISION = 6,
115 k_DEFAULT_ISO8601_PRECISION = 3 };
118 Time_Formatter d_timeFormatter;
119 TimeZone_Formatter d_timeZoneFormatter;
168 template <
class t_ITERATOR>
175 template <
class t_ITERATOR>
180 template <
class t_ITERATOR>
223template <
class t_CHAR>
227, d_timeZoneFormatter()
231template <
class t_CHAR>
235 d_timeFormatter. parseDefault();
236 d_timeZoneFormatter.parseDefault();
239template <
class t_CHAR>
243 d_timeFormatter. parseIso8601();
244 d_timeZoneFormatter.parseIso8601();
247template <
class t_CHAR>
251 return d_timeFormatter. parseNextModifier(specInOut) ||
252 d_timeZoneFormatter.parseNextModifier(specInOut);
255template <
class t_CHAR>
261 if (t_CHAR(
'i') == specInOut->
front()) {
262 d_timeFormatter. parseIso8601();
263 d_timeZoneFormatter.parseIso8601();
269 return d_timeFormatter. parseNextSpecifier(specInOut) ||
270 d_timeZoneFormatter.parseNextSpecifier(specInOut);
273template <
class t_CHAR>
278 d_timeFormatter. postprocess(spec);
279 d_timeZoneFormatter.postprocess(spec);
283template <
class t_CHAR>
287 return d_timeFormatter.extraSections() |
288 d_timeZoneFormatter.extraSections();
291template <
class t_CHAR>
295 return d_timeFormatter.totalWidth(value.
time()) +
296 d_timeZoneFormatter.totalWidth(value.
offset());
299template <
class t_CHAR>
300template <
class t_ITERATOR>
309 if (t_CHAR(
'i') == specInOut->
front()) {
310 *outIt = formatIso8601(*outIt, value);
316 return d_timeFormatter. formatNextSpecifier(specInOut,
319 d_timeZoneFormatter.formatNextSpecifier(specInOut,
324template <
class t_CHAR>
325template <
class t_ITERATOR>
330 out = d_timeFormatter. formatDefault(out, value.
time());
331 return d_timeZoneFormatter.formatDefault(out, value.
offset());
334template <
class t_CHAR>
335template <
class t_ITERATOR>
340 out = d_timeFormatter. formatIso8601(out, value.
time());
341 return d_timeZoneFormatter.formatIso8601(out, value.
offset());
351: d_timeFormatCache(localTime)
359 return d_timeFormatCache;
374template <
class t_CHAR>
377 typedef BloombergLP::bdlt::TimeTz TimeTz;
378 typedef BloombergLP::bdlt::TimeTzFormatter_Cache FormatCache;
379 typedef BloombergLP::bdlt::Formatter<
380 BloombergLP::bdlt::TimeTzFormatter, t_CHAR> Formatter;
383 Formatter d_formatter;
389 template <
class t_PARSE_CONTEXT>
391 t_PARSE_CONTEXT& context)
393 return d_formatter.parse(context);
401 template <
class t_FORMAT_CONTEXT>
402 typename t_FORMAT_CONTEXT::iterator
format(
404 t_FORMAT_CONTEXT& formatContext)
const
406 const FormatCache formatCache(value.localTime(), value.offset());
407 return d_formatter.format(formatCache, formatContext);
Definition bdlt_timetz.h:190
Definition bdlt_time.h:195
Definition bslstl_stringview.h:471
BSLS_KEYWORD_CONSTEXPR_CPP14 const_reference front() const
Definition bslstl_stringview.h:1966
BSLS_KEYWORD_CONSTEXPR_CPP14 void remove_prefix(size_type numChars)
Definition bslstl_stringview.h:1800
BSLS_KEYWORD_CONSTEXPR bool empty() const BSLS_KEYWORD_NOEXCEPT
Return true if this view has length 0, and false otherwise.
Definition bslstl_stringview.h:1931
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1917
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#define BSLS_KEYWORD_CONSTEXPR_CPP20
Definition bsls_keyword.h:645
Definition bbldc_basicisma30360.h:112
Definition bdlat_valuetypefunctions.h:939