-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdaye.cpp
More file actions
36 lines (29 loc) · 850 Bytes
/
daye.cpp
File metadata and controls
36 lines (29 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "daye.h"
int getStringBetweenAandB(const char* a,const char* A,const char* B,char *find)
{
//空字符串返回-1
if(!a || !A || !B)
return -1;
char source[strlen(a)+1];
strcpy(source,a);
char * startIndex=NULL;
if(!(startIndex=strstr(source,A)))
return -2;
startIndex=startIndex+strlen(A);
char *endIndex=NULL;
if(!(endIndex=strstr(startIndex,B)))
return -3;
strncpy(find,startIndex,endIndex-startIndex);
find[endIndex-startIndex]='\0';
return 0;
}
QString picLinkInfo2WpContent(QList<struct picLinkInfo> inPicLinkInfoList)
{
int tmpNum=inPicLinkInfoList.count();
QString contentRTN;
for(int i=0;i<tmpNum;i++)
{
contentRTN=contentRTN+QString("<img src=\"")+inPicLinkInfoList.at(i).picLink+QString("\" />");
}
return contentRTN;
}