Kiwano Engine v1.3.x
|
时间段 更多...
#include <Duration.h>
Public 成员函数 | |
Duration () | |
构造时间段 | |
Duration (int64_t milliseconds) | |
构造时间段 更多... | |
int64_t | GetMilliseconds () const |
获取毫秒数 | |
float | GetSeconds () const |
获取秒数 | |
float | GetMinutes () const |
获取分钟数 | |
float | GetHours () const |
获取小时数 | |
bool | IsZero () const |
时长是否是零 更多... | |
void | SetMilliseconds (int64_t ms) |
设置毫秒数 更多... | |
void | SetSeconds (float seconds) |
设置秒数 更多... | |
void | SetMinutes (float minutes) |
设置分钟数 更多... | |
void | SetHours (float hours) |
设置小时数 更多... | |
void | Sleep () const |
休眠 | |
String | ToString () const |
转为字符串 | |
bool | operator== (const Duration &) const |
bool | operator!= (const Duration &) const |
bool | operator> (const Duration &) const |
bool | operator>= (const Duration &) const |
bool | operator< (const Duration &) const |
bool | operator<= (const Duration &) const |
float | operator/ (const Duration &) const |
const Duration | operator+ (const Duration &) const |
const Duration | operator- (const Duration &) const |
const Duration | operator- () const |
const Duration | operator* (int) const |
const Duration | operator* (unsigned long long) const |
const Duration | operator* (float) const |
const Duration | operator* (double) const |
const Duration | operator* (long double) const |
const Duration | operator/ (int) const |
const Duration | operator/ (float) const |
const Duration | operator/ (double) const |
Duration & | operator+= (const Duration &) |
Duration & | operator-= (const Duration &) |
Duration & | operator*= (int) |
Duration & | operator*= (float) |
Duration & | operator*= (double) |
Duration & | operator/= (int) |
Duration & | operator/= (float) |
Duration & | operator/= (double) |
静态 Public 成员函数 | |
static Duration | Parse (StringView str) |
解析时间段字符串 更多... | |
友元 | |
const Duration | operator* (int, const Duration &) |
const Duration | operator* (float, const Duration &) |
const Duration | operator* (double, const Duration &) |
const Duration | operator* (long double, const Duration &) |
const Duration | operator/ (int, const Duration &) |
const Duration | operator/ (float, const Duration &) |
const Duration | operator/ (double, const Duration &) |
时间段
|
inline |
构造时间段
milliseconds | 毫秒数 |
|
inline |
时长是否是零
|
static |
解析时间段字符串
str | 时间段字符串 |
时间段字符串允许是有符号的浮点数, 并且带有时间单位后缀 例如: "300ms", "-1.5h", "2h45m" 允许的时间单位有 "ms", "s", "m", "h"
kiwano::RuntimeError | 传入一个不合法的格式时抛出 |
|
inline |
设置小时数
hours | 小时数 |
|
inline |
设置毫秒数
ms | 毫秒数 |
|
inline |
设置分钟数
minutes | 分钟数 |
|
inline |
设置秒数
seconds | 秒数 |