ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
T_Append< time::Ticks::Duration, TChar > Struct Template Reference

Description:

template<typename TChar>
struct alib::strings::APPENDABLES::T_Append< time::Ticks::Duration, TChar >

Specialization of functor T_Append for type Ticks::Duration .

Definition at line 710 of file calendar.hpp.

#include <calendar.hpp>

Public Method Index:

void operator() (TAString< TChar > &target, const time::Ticks::Duration duration)
 

Method Details:

◆ operator()()

template<typename TChar >
void operator() ( TAString< TChar > & target,
const time::Ticks::Duration duration )

Appends a human readable string representation of objects of templated inner type TimePointBase::Duration of type Ticks .

Depending on the length of the duration, a different human readable time unit or combination of it is used. The following rules are checked from top to bottom:

  • If zero, resource string "TS_ZERO" is written.
  • If negative, a minus sign '-' is written and the value is negated.
  • If greater than 10 days, writes the number of days as floating point number.
  • If between 1 and 10 days, writes the integral number of days and the additional hours as floating point number.
  • If greater than an hour, writes the integral number of hours and integral minutes.
  • If greater than a minute, writes the integral number of minutes and integral seconds.
  • If greater than a second, writes the number of seconds as floating point number.
  • If greater than a millisecond, writes the number of milliseconds as floating point number.
  • If greater than a microsecond, writes the number of microseconds as floating point number.
  • If greater than a nanosecond, writes the number of nanoseconds as floating point number.

All floating point numbers are written with two digits fractional precision.
The unit symbols are read from the resources of module class BaseCamp . The list is given with resource name UNITS.

Parameters
targetThe AString that Append was invoked on.
durationThe duration to append.

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