ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
prefix.h
Go to the documentation of this file.
1
#ifndef CPROVER_UTIL_PREFIX_H
2
#define CPROVER_UTIL_PREFIX_H
3
4
#include <string_view>
5
6
inline
bool
has_prefix
(std::string_view s, std::string_view prefix)
7
{
8
size_t
n = prefix.size();
9
return
s.size() >= n && s.substr(0, n) == prefix;
10
}
11
12
inline
bool
has_suffix
(std::string_view s, std::string_view suffix)
13
{
14
size_t
n = suffix.size();
15
size_t
m = s.size();
16
return
m >= n && s.substr(m - n) == suffix;
17
}
18
19
#endif
has_prefix
bool has_prefix(std::string_view s, std::string_view prefix)
Definition
prefix.h:6
has_suffix
bool has_suffix(std::string_view s, std::string_view suffix)
Definition
prefix.h:12
src
util
base
prefix.h
Generated by
1.15.0