# std::time_put< CharT, OutIter > Class Template Reference

Facet for outputting dates and times. More...

`#include <locale_facets.h>`

Inheritance diagram for std::time_put< CharT, OutIter >:

[legend]
Collaboration diagram for std::time_put< CharT, OutIter >:

[legend]
List of all members.

## Public Types

typedef CharT | char_type
| Public typedefs.
typedef OutIter | iter_type
| Public typedefs.

## Public Member Functions

| time_put (size_t __refs=0)
| Constructor performs initialization.
iter_type | put (iter_type s, ios_base &__io, char_type __fill, const tm *__tm, const CharT *__beg, const CharT *__end) const
| Format and output a time or date.
iter_type | put (iter_type s, ios_base &__io, char_type __fill, const tm *__tm, char __format, char __mod=0) const
| Format and output a time or date.

## Static Public Attributes

locale::id | id
| Numpunct facet id.

## Protected Member Functions

virtual | ~time_put ()
| Destructor.
virtual iter_type | do_put (iter_type s, ios_base &__io, char_type __fill, const tm *__tm, char __format, char __mod) const
| Format and output a time or date.

## Detailed Description

### template<typename CharT, typename OutIter>
class std::time_put< CharT, OutIter >

Facet for outputting dates and times.

This facet encapsulates the code to format and output dates and times according to formats used by strftime().

The time_put template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the time_put facet.

Definition at line 3322 of file locale_facets.h.

## Member Typedef Documentation

template<typename CharT, typename OutIter>
typedef CharT std::time_put< CharT, OutIter >::char_type

| Public typedefs. Definition at line 3328 of file locale_facets.h. Referenced by std::time_put< CharT, OutIter >::do_put().

template<typename CharT, typename OutIter>
typedef OutIter std::time_put< CharT, OutIter >::iter_type

| Public typedefs. Definition at line 3329 of file locale_facets.h.

## Constructor & Destructor Documentation

template<typename CharT, typename OutIter>
std::time_put< CharT, OutIter >::time_put | ( | size_t | __refs = `0` | ) | `[inline, explicit]`

Constructor performs initialization.

This is the constructor provided by the standard.

Parameters:

  | refs | Passed to the base facet class.

Definition at line 3343 of file locale_facets.h.

template<typename CharT, typename OutIter>
virtual std::time_put< CharT, OutIter >::~time_put | ( |  | ) | `[inline, protected, virtual]`

| Destructor. Definition at line 3389 of file locale_facets.h.

## Member Function Documentation

template<typename CharT, typename OutIter>
OutIter std::time_put< CharT, OutIter >::do_put | ( | iter_type | s,
|  | ios_base & | __io,
|  | char_type | __fill,
|  | const tm * | __tm,
|  | char | __format,
|  | char | __mod
| ) | const`[protected, virtual]`

Format and output a time or date.

This function formats the data in struct tm according to the provided format char and optional modifier. This function is a hook for derived classes to change the value returned.

See also:
  put() for more details.

Parameters:

  | s | The stream to write to.
  | io | Source of locale.
  | fill | char_type to use for padding.
  | tm | Struct tm with date and time info to format.
  | format | Format char.
  | mod | Optional modifier char.

Returns:
  Iterator after writing.

Definition at line 2243 of file locale_facets.tcc.

References std::time_put< CharT, OutIter >::char_type, and std::ctype_abstract_base< CharT >::widen().

Referenced by std::time_put< CharT, OutIter >::put().

template<typename CharT, typename OutIter>
iter_type std::time_put< CharT, OutIter >::put | ( | iter_type | s,
|  | ios_base & | __io,
|  | char_type | __fill,
|  | const tm * | __tm,
|  | char | __format,
|  | char | __mod = `0`
| ) | const`[inline]`

Format and output a time or date.

This function formats the data in struct tm according to the provided format char and optional modifier. The format and modifier are interpreted as by strftime(). It does so by returning time_put::do_put().

Parameters:

  | s | The stream to write to.
  | io | Source of locale.
  | fill | char_type to use for padding.
  | tm | Struct tm with date and time info to format.
  | format | Format char.
  | mod | Optional modifier char.

Returns:
  Iterator after writing.

Definition at line 3382 of file locale_facets.h.

template<typename CharT, typename OutIter>
OutIter std::time_put< CharT, OutIter >::put | ( | iter_type | s,
|  | ios_base & | __io,
|  | char_type | __fill,
|  | const tm * | __tm,
|  | const CharT * | __beg,
|  | const CharT * | __end
| ) | const

Format and output a time or date.

This function formats the data in struct tm according to the provided format string. The format string is interpreted as by strftime().

Parameters:

  | s | The stream to write to.
  | io | Source of locale.
  | fill | char_type to use for padding.
  | tm | Struct tm with date and time info to format.
  | beg | Start of format string.
  | end | End of format string.

Returns:
  Iterator after writing.

Definition at line 2208 of file locale_facets.tcc.

References std::time_put< CharT, OutIter >::do_put(), and std::ctype_abstract_base< CharT >::narrow().

## Member Data Documentation

template<typename CharT, typename OutIter>
locale::id std::time_put< CharT, OutIter >::id `[static]`

| Numpunct facet id. Definition at line 3414 of file locale_facets.h.

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

- locale_facets.h
- locale_facets.tcc