| 204 | } |
| 205 | |
| 206 | AbstractString::size_type AbstractString::rfind(const_pointer s, const size_type pos) const |
| 207 | { |
| 208 | const size_type l = static_cast<size_type>(strlen(s)); |
| 209 | int lastpos = length() - l; |
| 210 | if (lastpos < 0) { |
| 211 | return npos; |
| 212 | } |
| 213 | if (pos < static_cast<size_type>(lastpos)) { |
| 214 | lastpos = pos; |
| 215 | } |
| 216 | const_pointer start = c_str(); |
| 217 | for (const_pointer endL = &start[lastpos]; endL >= start; --endL) |
| 218 | { |
| 219 | if (memcmp(endL, s, l) == 0) { |
| 220 | return endL - start; |
| 221 | } |
| 222 | } |
| 223 | return npos; |
| 224 | } |
| 225 | |
| 226 | AbstractString::size_type AbstractString::rfind(char_type c, const size_type pos) const |
| 227 | { |