5 // extern CString ExplodeMin(CString str, CAtlList<CString>& sl, TCHAR sep, int limit = 0);
6 // extern CString Explode(CString str, CAtlList<CString>& sl, TCHAR sep, int limit = 0);
7 // extern CString Implode(CAtlList<CString>& sl, TCHAR sep);
9 template<class T
, typename SEP
>
10 T
Explode(T str
, CAtlList
<T
>& sl
, SEP sep
, int limit
= 0)
14 for(int i
= 0, j
= 0; ; i
= j
+1)
18 if(j
< 0 || sl
.GetCount() == limit
-1)
20 sl
.AddTail(str
.Mid(i
).Trim());
25 sl
.AddTail(str
.Mid(i
, j
-i
).Trim());
32 template<class T
, typename SEP
>
33 T
ExplodeMin(T str
, CAtlList
<T
>& sl
, SEP sep
, int limit
= 0)
35 Explode(str
, sl
, sep
, limit
);
36 POSITION pos
= sl
.GetHeadPosition();
40 if(sl
.GetNext(pos
).IsEmpty())
43 if(sl
.IsEmpty()) sl
.AddTail(T()); // eh
48 template<class T
, typename SEP
>
49 T
Implode(CAtlList
<T
>& sl
, SEP sep
)
52 POSITION pos
= sl
.GetHeadPosition();
55 ret
+= sl
.GetNext(pos
);
61 extern CString
ExtractTag(CString tag
, CMapStringToString
& attribs
, bool& fClosing
);
62 extern CStringA
ConvertMBCS(CStringA str
, DWORD SrcCharSet
, DWORD DstCharSet
);
63 extern CStringA
UrlEncode(CStringA str
, bool fRaw
= false);
64 extern CStringA
UrlDecode(CStringA str
, bool fRaw
= false);
65 extern DWORD
CharSetToCodePage(DWORD dwCharSet
);
66 extern CAtlList
<CString
>& MakeLower(CAtlList
<CString
>& sl
);
67 extern CAtlList
<CString
>& MakeUpper(CAtlList
<CString
>& sl
);
68 extern CAtlList
<CString
>& RemoveStrings(CAtlList
<CString
>& sl
, int minlen
, int maxlen
);