blob: 5a81978df6a3953923ee7ea87c76924d45972cdd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
// Copyright (c) 2023 Klemens D. Morgenstern
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_SQLITE_STRING_HPP
#define BOOST_SQLITE_STRING_HPP
#include <boost/sqlite/detail/config.hpp>
#include <boost/sqlite/cstring_ref.hpp>
BOOST_SQLITE_BEGIN_NAMESPACE
inline
bool like(
cstring_ref lhs,
cstring_ref rhs,
char escape = '\0')
{
return sqlite3_strlike(lhs.c_str(), rhs.c_str(), escape) != 0;
}
inline
bool glob(
cstring_ref lhs,
cstring_ref rhs)
{
return sqlite3_strglob(lhs.c_str(), rhs.c_str()) != 0;
}
inline
int icmp(
cstring_ref lhs,
cstring_ref rhs)
{
return sqlite3_stricmp(lhs.c_str(), rhs.c_str());
}
inline
int icmp(
core::string_view lhs,
core::string_view rhs,
std::size_t n)
{
return sqlite3_strnicmp(lhs.data(), rhs.data(), static_cast<int>(n));
}
BOOST_SQLITE_END_NAMESPACE
#endif //BOOST_SQLITE_STRING_HPP
|