RESTinio
string_algo.hpp
Go to the documentation of this file.
1/*
2 * RESTinio
3 */
4
12#pragma once
13
16
17namespace restinio
18{
19
20namespace string_algo
21{
22
25 const string_view_t & where,
26 const string_view_t & what ) noexcept
27{
28 return where.size() >= what.size() &&
29 0 == where.compare(0u, what.size(), what);
30}
31
34 const string_view_t & where,
35 const string_view_t & what ) noexcept
36{
37 return where.size() >= what.size() && 0 == where.compare(
38 where.size() - what.size(), what.size(), what);
39}
40
41} /* namespace string_algo */
42
43} /* namespace restinio */
44
Detection of compiler version and absence of various features.
#define RESTINIO_NODISCARD
RESTINIO_NODISCARD bool ends_with(const string_view_t &where, const string_view_t &what) noexcept
Definition: string_algo.hpp:33
RESTINIO_NODISCARD bool starts_with(const string_view_t &where, const string_view_t &what) noexcept
Definition: string_algo.hpp:24
nonstd::string_view string_view_t
Definition: string_view.hpp:19