78 const wchar_t* pStart = _str.data();
79 const wchar_t* pCurrent = pStart;
83 if (__exists(_chars, *pCurrent)
84 && (pEntity = __special(*pCurrent)))
86 if (pStart < pCurrent)
87 r.append(pStart, pCurrent - pStart);
88 r.append(pEntity->
psz, pEntity->
n);
95 if (pStart < pCurrent)
96 r.append(pStart, pCurrent - pStart);
126 const String& _beginOfLine,
127 const String& _endOfLine
134 const wchar_t* pStart = _str.data();
135 const wchar_t* pCurrent = pStart;
140 if (pStart < pCurrent)
141 r.append(pStart, pCurrent - pStart);
143 if (_tab2Space > 0) {
145 int nSpace = _tab2Space;
146 while(*(++pCurrent)) {
147 if (*pCurrent == L
' ')
149 else if (*pCurrent == L
'\t')
150 nSpace += _tab2Space;
154 r += __GetSpace(nSpace);
164 if (pStart < pCurrent)
165 r.append(pStart, pCurrent - pStart);
167 if (_tab2Space > 0) {
169 while(*(++pCurrent)) {
170 if (*pCurrent == L
' ')
172 else if (*pCurrent == L
'\t')
173 nSpace += _tab2Space;
177 r += __GetSpace(nSpace);
182 while(*(++pCurrent) == L
' ')
184 r += __GetSpace(nSpace);
189 if (pStart < pCurrent)
190 r.append(pStart, pCurrent - pStart);
195 if (pStart < pCurrent)
196 r.append(pStart, pCurrent - pStart);
198 r.append(L
"\r\n", 2);
203 if (__exists(L
"<>&", *pCurrent)
204 && (pEntity = __special(*pCurrent))) {
206 if (pStart < pCurrent)
207 r.append(pStart, pCurrent - pStart);
208 r.append(pEntity->
psz, pEntity->
n);
216 if (pStart < pCurrent)
217 r.append(pStart, pCurrent - pStart);
233 const wchar_t* _elementNames
243 _elementNames, _elementNames + String::length(_elementNames),
246 for( StringArray::Iterator it = a.begin();
247 it != a.end(); it++) {
249 if (!(*it).isEmpty())
251 if (!pattern.isEmpty())
253 sb += L
"(<+[ \t\r\n]*/*[ \t\r\n]*";
255 sb += L
"[ \t\r\n]*/*[^>]*>+)";
258 pattern = sb.toString();
262 pattern = L
"(<+[^>]*>+)|(&[a-z]+;)";
267 const wchar_t* begin = _str.data();
268 const wchar_t* end = begin + _str.length();
269 while(begin < end && re.
search(begin, end, match)) {
271 r.append(begin, match[0].first);
272 begin = match[0].second;
276 r.append(begin, end);