… | |
… | |
68 | int plen = strlen (prefix); |
68 | int plen = strlen (prefix); |
69 | |
69 | |
70 | return length () >= plen && !strncasecmp (s, prefix, plen); |
70 | return length () >= plen && !strncasecmp (s, prefix, plen); |
71 | } |
71 | } |
72 | |
72 | |
|
|
73 | // returns true if the substring is contained in the shstr |
|
|
74 | // if the shstr is 0, then this always returns false. |
|
|
75 | // the shstr is (theoretically) treated as a comma/colon/space etc. separated list. |
73 | bool contains (const char *substring) const |
76 | bool contains (const char *substring) const |
74 | { |
77 | { |
75 | return s != null () && strstr (s, substring); |
78 | return s != null () && strstr (s, substring); |
76 | } |
79 | } |
77 | |
80 | |
… | |
… | |
119 | inline bool operator !=(const shstr_tmp &a, const shstr_tmp &b) |
122 | inline bool operator !=(const shstr_tmp &a, const shstr_tmp &b) |
120 | { |
123 | { |
121 | return a.s != b.s; |
124 | return a.s != b.s; |
122 | } |
125 | } |
123 | |
126 | |
124 | inline int strlen (const shstr_tmp &sh) |
127 | inline int strlen (shstr_tmp sh) |
125 | { |
128 | { |
126 | return sh.length (); |
129 | return sh.length (); |
127 | } |
130 | } |
128 | |
131 | |
129 | static std::ostream &operator <<(std::ostream &o, shstr_tmp sh) |
132 | static std::ostream &operator <<(std::ostream &o, shstr_tmp sh) |