Skip to content

Commit dda9efb

Browse files
smowtonpeterschrammel
authored andcommitted
Add string-infix utility
1 parent ca45a2b commit dda9efb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/util/infix.h

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*******************************************************************\
2+
3+
Module: String infix shorthand
4+
5+
Author: Chris Smowton, [email protected]
6+
7+
\*******************************************************************/
8+
9+
#ifndef CPROVER_UTIL_INFIX_H
10+
#define CPROVER_UTIL_INFIX_H
11+
12+
#include <string>
13+
14+
inline bool has_infix(
15+
const std::string &s,
16+
const std::string &infix,
17+
size_t offset)
18+
{
19+
return s.compare(offset, infix.size(), infix)==0;
20+
}
21+
22+
#endif

0 commit comments

Comments
 (0)