| 1 | // -*- C++ -*- |
|---|---|
| 2 | //===---------------------------------------------------------------------===// |
| 3 | // |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 7 | // |
| 8 | //===---------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef _LIBCPP___FWD_STRING_VIEW_H |
| 11 | #define _LIBCPP___FWD_STRING_VIEW_H |
| 12 | |
| 13 | #include <__config> |
| 14 | #include <__fwd/string.h> |
| 15 | |
| 16 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 17 | # pragma GCC system_header |
| 18 | #endif |
| 19 | |
| 20 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 21 | |
| 22 | template <class _CharT, class _Traits = char_traits<_CharT> > |
| 23 | class basic_string_view; |
| 24 | |
| 25 | typedef basic_string_view<char> string_view; |
| 26 | #if _LIBCPP_HAS_CHAR8_T |
| 27 | typedef basic_string_view<char8_t> u8string_view; |
| 28 | #endif |
| 29 | typedef basic_string_view<char16_t> u16string_view; |
| 30 | typedef basic_string_view<char32_t> u32string_view; |
| 31 | #if _LIBCPP_HAS_WIDE_CHARACTERS |
| 32 | typedef basic_string_view<wchar_t> wstring_view; |
| 33 | #endif |
| 34 | |
| 35 | // clang-format off |
| 36 | template <class _CharT, class _Traits> |
| 37 | class _LIBCPP_PREFERRED_NAME(string_view) |
| 38 | #if _LIBCPP_HAS_WIDE_CHARACTERS |
| 39 | _LIBCPP_PREFERRED_NAME(wstring_view) |
| 40 | #endif |
| 41 | #if _LIBCPP_HAS_CHAR8_T |
| 42 | _LIBCPP_PREFERRED_NAME(u8string_view) |
| 43 | #endif |
| 44 | _LIBCPP_PREFERRED_NAME(u16string_view) |
| 45 | _LIBCPP_PREFERRED_NAME(u32string_view) |
| 46 | basic_string_view; |
| 47 | // clang-format on |
| 48 | _LIBCPP_END_NAMESPACE_STD |
| 49 | |
| 50 | #endif // _LIBCPP___FWD_STRING_VIEW_H |
| 51 |