string_view.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #ifndef _LIBCPP___FWD_STRING_VIEW_H
  10. #define _LIBCPP___FWD_STRING_VIEW_H
  11. #include <__config>
  12. #include <iosfwd> // char_traits
  13. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  14. # pragma GCC system_header
  15. #endif
  16. _LIBCPP_BEGIN_NAMESPACE_STD
  17. template<class _CharT, class _Traits = char_traits<_CharT> >
  18. class _LIBCPP_TEMPLATE_VIS basic_string_view;
  19. typedef basic_string_view<char> string_view;
  20. #ifndef _LIBCPP_HAS_NO_CHAR8_T
  21. typedef basic_string_view<char8_t> u8string_view;
  22. #endif
  23. typedef basic_string_view<char16_t> u16string_view;
  24. typedef basic_string_view<char32_t> u32string_view;
  25. #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  26. typedef basic_string_view<wchar_t> wstring_view;
  27. #endif
  28. // clang-format off
  29. template <class _CharT, class _Traits>
  30. class _LIBCPP_PREFERRED_NAME(string_view)
  31. #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  32. _LIBCPP_PREFERRED_NAME(wstring_view)
  33. #endif
  34. #ifndef _LIBCPP_HAS_NO_CHAR8_T
  35. _LIBCPP_PREFERRED_NAME(u8string_view)
  36. #endif
  37. _LIBCPP_PREFERRED_NAME(u16string_view)
  38. _LIBCPP_PREFERRED_NAME(u32string_view)
  39. basic_string_view;
  40. // clang-format on
  41. _LIBCPP_END_NAMESPACE_STD
  42. #endif // _LIBCPP___FWD_STRING_VIEW_H