PonyPlayer
utils.h
浏览该文件的文档.
1//******************************************
2// Author : Yuwei Huang
3// Created On : Sat Feb 10 2018
4// File : utils.h
5//******************************************
6
7#ifndef LIBLRC_UTILS_H
8#define LIBLRC_UTILS_H
9
10#include <cstdint>
11#include <string>
12#include <vector>
13
14namespace lrc {
15
16namespace utils {
17
18// Converts strings like "mm:ss" and "mm:ss.ccc" to milliseconds. Returns -1
19// if |time| is not valid time string.
20int32_t TimeStringToMilliseconds(const std::string& time_str);
21
22// Converts time in milliseconds to a string in "mm:ss.ccc" format.
23std::string MillisecondsToTimeString(int32_t milliseconds);
24
25} // namespace utils
26
27} // namespace lrc
28
29#endif // LIBLRC_UTILS_H
int32_t TimeStringToMilliseconds(const std::string &time_str)
Definition: utils.cc:20
std::string MillisecondsToTimeString(int32_t milliseconds)
Definition: utils.cc:33
Definition: lrc_parser.h:15