no message
parent
170597e656
commit
6b9e50c566
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-07-23 23:39:57
|
||||
* @LastEditTime: 2021-08-06 01:07:45
|
||||
* @LastEditTime: 2021-08-09 01:09:14
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @Description: In User Settings Edit
|
||||
* @FilePath: \generallib\general\src\function\daemon.c
|
||||
|
@ -17,6 +17,7 @@ void _process_start(string path){
|
|||
}
|
||||
pclose(file);
|
||||
}
|
||||
|
||||
vector<string> StripList(const char *in,const char* d){
|
||||
vector<string> ret;
|
||||
vector<uint16_t> pos;
|
||||
|
@ -40,7 +41,6 @@ vector<string> StripList(const char *in,const char* d){
|
|||
return ret;
|
||||
|
||||
for(int i = 0;i < (len - strlen(d)) ; i++){
|
||||
std::cout<<i<<std::endl;
|
||||
bool found = true;
|
||||
for(int j = 0;j < strlen(d);j++){
|
||||
if(in[i + j] != d[j]){
|
||||
|
@ -48,7 +48,7 @@ vector<string> StripList(const char *in,const char* d){
|
|||
}
|
||||
}
|
||||
if(found){
|
||||
printf("pos start %d\r\n",i);
|
||||
// printf("pos start %d\r\n",i);
|
||||
i += sublen - 1;
|
||||
pos.push_back(i);
|
||||
continue;
|
||||
|
@ -56,12 +56,16 @@ vector<string> StripList(const char *in,const char* d){
|
|||
}
|
||||
for(int i = 0; i < pos.size() - 1;i++){
|
||||
if(pos[i + 1] != (pos[i] + sublen)){
|
||||
pos_strip_continue.push_back(pos[i]);
|
||||
pos_strip_continue.push_back(pos[i + 1]);
|
||||
pos_strip_continue.push_back(pos[i] + 1);
|
||||
pos_strip_continue.push_back(pos[i + 1] - 1);
|
||||
}
|
||||
}
|
||||
pos_strip_continue.push_back(strlen(in) - 1);
|
||||
|
||||
if(pos_strip_continue[pos_strip_continue.size() - 1] != (strlen(in) - 1)){
|
||||
pos_strip_continue.push_back(pos_strip_continue[pos_strip_continue.size() - 1] + 1);
|
||||
pos_strip_continue.push_back(strlen(in) - 1);
|
||||
}
|
||||
std::cout<<pos_strip_continue.size()<<std::endl;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue