You.i Engine
CYITimeConversion Class Reference

#include <utility/YiTimeConversion.h>

Public Types

enum  FORMAT {
  ZERO_PADDED,
  UNPADDED
}
 

Static Public Member Functions

static CYIString TimeIntervalToString (uint64_t uTimeSec, FORMAT eTimeSpanFormat)
 
static CYIString TimeIntervalToString (uint64_t uTimeSec, const CYIString &format)
 
static bool HasHours (uint64_t uTimeSec)
 
static bool HasMinutes (uint64_t uTimeSec)
 
static bool HasSeconds (uint64_t uTimeSec)
 
static bool StringToTimeInterval (const CYIString &timeSpan, FORMAT eTimeSpanFormat, uint64_t *puTimeSec)
 

Member Enumeration Documentation

Enumerator
ZERO_PADDED 

The time will be padded up to 00:00:00 (hh:mm:ss)

UNPADDED 

The time will be minimally expressed. i.e. 1:30:00 instead of 01:30:00

Member Function Documentation

static bool CYITimeConversion::HasHours ( uint64_t  uTimeSec)
static

Returns true if uTimeSec is at least one hour.

static bool CYITimeConversion::HasMinutes ( uint64_t  uTimeSec)
static

Returns true if uTimeSec is at least one minute.

static bool CYITimeConversion::HasSeconds ( uint64_t  uTimeSec)
static

Returns true if uTimeSec is at least one second.

static bool CYITimeConversion::StringToTimeInterval ( const CYIString timeSpan,
FORMAT  eTimeSpanFormat,
uint64_t *  puTimeSec 
)
static

Populates the given uTimeSec with the total seconds expressed by timeSpan (formatted as "hh:mm:ss").

returns false if the timeSpan is malformed, if eTimeSpanFormat is not ZERO_PADDED, or if puTimeSec is null.

static CYIString CYITimeConversion::TimeIntervalToString ( uint64_t  uTimeSec,
FORMAT  eTimeSpanFormat 
)
static
Deprecated:

The provided uTimeSec will be formatted as a time interval string of the form hh:mm:ss. You can specify zero-padding using eTimeSpanFormat.

static CYIString CYITimeConversion::TimeIntervalToString ( uint64_t  uTimeSec,
const CYIString format 
)
static

Returns a formatted string by taking the provided uTimeSec and a string, format. The format is composed from components, with h%, m%, and s%

as hours, minutes and seconds. Adding more "h", "m", "s" characters to add the numbers that will be zero-padded. "%hhh%:%mm%:%ss%" with a uTimSec of 3601 will return "001:00:01",

and "%m%:%ss%" with a uTimSec of 61 will return "1:01".


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