| | |
| | | #include "xconvert.h" |
| | | #include <cstdint> |
| | | #include <cstring> |
| | | #include <vector> |
| | | #include <string> |
| | | |
| | | using namespace std; |
| | | |
| | | #define SECONDS_PER_MINUTE 60 |
| | | #define SECONDS_PER_HOUR 3600 |
| | |
| | | TimeMakeComposite(hour2, minute2, second2, msecond2)) % (SECONDS_PER_DAY * 1000); |
| | | } |
| | | |
| | | vector<string> split(string str, string pattern) |
| | | { |
| | | string::size_type pos; |
| | | vector<string> result; |
| | | str += pattern; |
| | | |
| | | int size=str.size(); |
| | | |
| | | for(int i=0; i<size; i++) { |
| | | pos=str.find(pattern,i); |
| | | if(pos<size) { |
| | | string s=str.substr(i,pos-i); |
| | | result.push_back(s); |
| | | i=pos+pattern.size()-1; |
| | | } |
| | | } |
| | | return result; |
| | | } |