ALib C++ Framework
by
Library Version: 2605 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::strings::APPENDABLES::AppendableTraits< time::Ticks::Duration, TChar, TAllocator > Struct Template Reference

Description:

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

Specialization of functor AppendableTraits for type Ticks::Duration.

Definition at line 288 of file appendables.hpp.

#include <appendables.hpp>

Public Method Index:

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

Method Details:

◆ operator()()

template<typename TChar, typename TAllocator>
void alib::strings::APPENDABLES::AppendableTraits< time::Ticks::Duration, TChar, TAllocator >::operator() ( TAString< TChar, TAllocator > & target,
const time::Ticks::Duration duration )

Appends a human-readable string representation of objects of templated inner type 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 alib::BASECAMP. The list is given with resource name UNITS.

Parameters
targetThe AString that Append(const TAppendable&) was invoked on.
durationThe duration to append.

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