|
0
|
1 |
#include "mystring.h"
|
|
|
2 |
#include <string.h>
|
|
|
3 |
|
|
|
4 |
int mystring::find_first_of(const char* setstr, size_t setlen,
|
|
|
5 |
size_t offset) const
|
|
|
6 |
{
|
|
|
7 |
for(; offset < rep->length; offset++) {
|
|
|
8 |
if(memchr(setstr, rep->buf[offset], setlen))
|
|
|
9 |
return offset;
|
|
|
10 |
}
|
|
|
11 |
return -1;
|
|
|
12 |
}
|
|
|
13 |
|
|
|
14 |
int mystring::find_first_of(const char* setstr, size_t offset) const
|
|
|
15 |
{
|
|
|
16 |
return find_first_of(setstr, strlen(setstr), offset);
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
int mystring::find_first_of(const mystring& setstr, size_t offset) const
|
|
|
20 |
{
|
|
|
21 |
return find_first_of(setstr.rep->buf, setstr.rep->length, offset);
|
|
|
22 |
}
|