1+ // SPDX-License-Identifier: Apache-2.0
2+ // Copyright Apache Software Foundation 2019
13/* * @file
24
3- Utility overloads for @c std::string_view
4-
5- @section license License
6-
7- Licensed to the Apache Software Foundation (ASF) under one or more contributor license
8- agreements. See the NOTICE file distributed with this work for additional information regarding
9- copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0
10- (the "License"); you may not use this file except in compliance with the License. You may obtain
11- a copy of the License at
12-
13- http://www.apache.org/licenses/LICENSE-2.0
14-
15- Unless required by applicable law or agreed to in writing, software distributed under the License
16- is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
17- or implied. See the License for the specific language governing permissions and limitations under
18- the License.
19- */
5+ Additional handy utilities for @c string_view and hence also @c TextView.
6+ */
207
218#pragma once
9+ #include < bitset>
10+ #include < iosfwd>
11+ #include < memory.h>
12+ #include < string>
2213#include < string_view>
23- #include < string.h>
24- #include < strings.h>
14+ #include < limits>
2515
2616/* * Compare views with ordering, ignoring case.
2717 *
@@ -70,8 +60,7 @@ int memcmp(const std::string_view &lhs, const std::string_view &rhs);
7060 * @see memcmp
7161 */
7262inline int
73- strcmp (const std::string_view &lhs, const std::string_view &rhs)
74- {
63+ strcmp (const std::string_view &lhs, const std::string_view &rhs) {
7564 return memcmp (lhs, rhs);
7665}
7766
@@ -93,7 +82,6 @@ strcmp(const std::string_view &lhs, const std::string_view &rhs)
9382 *
9483 */
9584inline void *
96- memcpy (void *dst, const std::string_view &src)
97- {
85+ memcpy (void *dst, const std::string_view &src) {
9886 return memcpy (dst, src.data (), src.size ());
9987}
0 commit comments