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);
125 const String& _beginOfLine,
126 const String& _endOfLine
133 const wchar_t* pStart = _str.data();
134 const wchar_t* pCurrent = pStart;
139 if (pStart < pCurrent)
140 r.append(pStart, pCurrent - pStart);
142 if (_tab2Space > 0) {
144 int nSpace = _tab2Space;
145 while(*(++pCurrent)) {
146 if (*pCurrent == L
' ')
148 else if (*pCurrent == L
'\t')
149 nSpace += _tab2Space;
153 r += __GetSpace(nSpace);
163 if (pStart < pCurrent)
164 r.append(pStart, pCurrent - pStart);
166 if (_tab2Space > 0) {
168 while(*(++pCurrent)) {
169 if (*pCurrent == L
' ')
171 else if (*pCurrent == L
'\t')
172 nSpace += _tab2Space;
176 r += __GetSpace(nSpace);
181 while(*(++pCurrent) == L
' ')
183 r += __GetSpace(nSpace);
188 if (pStart < pCurrent)
189 r.append(pStart, pCurrent - pStart);
194 if (pStart < pCurrent)
195 r.append(pStart, pCurrent - pStart);
197 r.append(L
"\r\n", 2);
202 if (__exists(L
"<>&", *pCurrent)
203 && (pEntity = __special(*pCurrent))) {
205 if (pStart < pCurrent)
206 r.append(pStart, pCurrent - pStart);
207 r.append(pEntity->
psz, pEntity->
n);
215 if (pStart < pCurrent)
216 r.append(pStart, pCurrent - pStart);
232 const wchar_t* _elementNames
242 _elementNames, _elementNames + String::length(_elementNames),
245 for( StringArray::Iterator it = a.begin();
246 it != a.end(); it++) {
248 if (!(*it).isEmpty())
250 if (!pattern.isEmpty())
252 sb += L
"(<+[ \t\r\n]*/*[ \t\r\n]*";
254 sb += L
"[ \t\r\n]*/*[^>]*>+)";
257 pattern = sb.toString();
261 pattern = L
"(<+[^>]*>+)|(&[a-z]+;)";
266 const wchar_t* begin = _str.data();
267 const wchar_t* end = begin + _str.length();
268 while(begin < end && re.
search(begin, end, match)) {
270 r.append(begin, match[0].first);
271 begin = match[0].second;
275 r.append(begin, end);