summaryrefslogtreecommitdiff
path: root/subprojects/boost-sqlite/include/boost/sqlite/string.hpp
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2025-09-14 00:16:10 -0400
committerJohn Turner <jturner.usa@gmail.com>2025-09-14 00:16:10 -0400
commit13e0821fd783a1d5083d825af53cf20e8dcbfd76 (patch)
tree1ea363b0f13b3e87d177100e6ae6b9f30a2de1b8 /subprojects/boost-sqlite/include/boost/sqlite/string.hpp
parentaa55cb93036a89c64c08e08f4e1de4fa1fd5a775 (diff)
parentefcea3a80da7c4479d5fe168435ecc9fd06bdc72 (diff)
downloadsqlite-kv-bench-13e0821fd783a1d5083d825af53cf20e8dcbfd76.tar.gz
Merge commit 'efcea3a80da7c4479d5fe168435ecc9fd06bdc72' as 'subprojects/boost-sqlite'
Diffstat (limited to 'subprojects/boost-sqlite/include/boost/sqlite/string.hpp')
-rw-r--r--subprojects/boost-sqlite/include/boost/sqlite/string.hpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/subprojects/boost-sqlite/include/boost/sqlite/string.hpp b/subprojects/boost-sqlite/include/boost/sqlite/string.hpp
new file mode 100644
index 0000000..5a81978
--- /dev/null
+++ b/subprojects/boost-sqlite/include/boost/sqlite/string.hpp
@@ -0,0 +1,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