From 2cfc22e1ea5140861499ee5b7142766fb8f754f7 Mon Sep 17 00:00:00 2001 From: yy1717 <fctom1215@outlook.com> Date: 星期二, 29 九月 2020 15:53:20 +0800 Subject: [PATCH] 坐标 --- lib/src/main/cpp/utils/xconvert.cpp | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/lib/src/main/cpp/utils/xconvert.cpp b/lib/src/main/cpp/utils/xconvert.cpp index 66869c0..b411ffb 100644 --- a/lib/src/main/cpp/utils/xconvert.cpp +++ b/lib/src/main/cpp/utils/xconvert.cpp @@ -5,6 +5,10 @@ #include "xconvert.h" #include <cstdint> #include <cstring> +#include <vector> +#include <string> + +using namespace std; #define SECONDS_PER_MINUTE 60 #define SECONDS_PER_HOUR 3600 @@ -141,3 +145,21 @@ 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; +} -- Gitblit v1.8.0