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