29 #ifndef RTTR_STRING_VIEW_H_
30 #define RTTR_STRING_VIEW_H_
32 #include "rttr/detail/base/core_prerequisites.h"
47 template<
typename CharT,
typename Traits = std::
char_traits<CharT> >
48 class basic_string_view
95 template<typename Allocator>
96 basic_string_view(const std::basic_string<CharT, Traits, Allocator>& str) RTTR_NOEXCEPT;
194 RTTR_CONSTEXPR
bool empty() const RTTR_NOEXCEPT;
247 template<typename Allocator>
248 explicit operator std::basic_string<CharT, Traits, Allocator>() const;
255 template<typename Allocator = std::allocator<CharT> >
256 std::basic_string<CharT, Traits>
to_string(const Allocator& a = Allocator()) const;
275 RTTR_CXX14_CONSTEXPR
int compare(const CharT* c) const RTTR_NOEXCEPT;
296 template<typename CharT, typename Traits>
297 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator==(
basic_string_view<CharT, Traits> lhs,
300 template<typename CharT, typename Traits>
301 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator==(const
char* lhs,
304 template<typename CharT, typename Traits>
305 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator==(
basic_string_view<CharT, Traits> lhs,
306 const
char* rhs) RTTR_NOEXCEPT;
308 template<typename CharT, typename Traits>
309 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator==(const std::basic_string<CharT, Traits>& lhs,
312 template<typename CharT, typename Traits>
313 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator==(
basic_string_view<CharT, Traits> lhs,
314 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
325 template<typename CharT, typename Traits>
326 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator!=(
basic_string_view<CharT, Traits> lhs,
329 template<typename CharT, typename Traits>
330 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator!=(const
char* lhs,
333 template<typename CharT, typename Traits>
334 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator!=(
basic_string_view<CharT, Traits> lhs,
335 const
char* rhs) RTTR_NOEXCEPT;
337 template<typename CharT, typename Traits>
338 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator!=(const std::basic_string<CharT, Traits>& lhs,
341 template<typename CharT, typename Traits>
342 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator!=(
basic_string_view<CharT, Traits> lhs,
343 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
354 template<typename CharT, typename Traits>
355 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<=(
basic_string_view<CharT, Traits> lhs,
358 template<typename CharT, typename Traits>
359 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<=(const
char* lhs,
362 template<typename CharT, typename Traits>
363 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<=(
basic_string_view<CharT, Traits> lhs,
364 const
char* rhs) RTTR_NOEXCEPT;
366 template<typename CharT, typename Traits>
367 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<=(const std::basic_string<CharT, Traits>& lhs,
370 template<typename CharT, typename Traits>
371 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<=(
basic_string_view<CharT, Traits> lhs,
372 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
383 template<typename CharT, typename Traits>
384 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>=(
basic_string_view<CharT, Traits> lhs,
387 template<typename CharT, typename Traits>
388 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>=(const
char* lhs,
391 template<typename CharT, typename Traits>
392 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>=(
basic_string_view<CharT, Traits> lhs,
393 const
char* rhs) RTTR_NOEXCEPT;
395 template<typename CharT, typename Traits>
396 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>=(const std::basic_string<CharT, Traits>& lhs,
399 template<typename CharT, typename Traits>
400 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>=(
basic_string_view<CharT, Traits> lhs,
401 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
412 template<typename CharT, typename Traits>
413 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>(
basic_string_view<CharT, Traits> lhs,
416 template<typename CharT, typename Traits>
417 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>(const
char* lhs,
420 template<typename CharT, typename Traits>
421 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>(
basic_string_view<CharT, Traits> lhs,
422 const
char* rhs) RTTR_NOEXCEPT;
424 template<typename CharT, typename Traits>
425 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>(const std::basic_string<CharT, Traits>& lhs,
428 template<typename CharT, typename Traits>
429 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>(
basic_string_view<CharT, Traits> lhs,
430 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
441 template<typename CharT, typename Traits>
442 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<(
basic_string_view<CharT, Traits> lhs,
445 template<typename CharT, typename Traits>
446 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<(const
char* lhs,
449 template<typename CharT, typename Traits>
450 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<(
basic_string_view<CharT, Traits> lhs,
451 const
char* rhs) RTTR_NOEXCEPT;
453 template<typename CharT, typename Traits>
454 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<(const std::basic_string<CharT, Traits>& lhs,
457 template<typename CharT, typename Traits>
458 RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<(
basic_string_view<CharT, Traits> lhs,
459 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
463 template<typename CharT, typename Traits>
464 RTTR_INLINE std::basic_string<CharT, Traits> operator+(
basic_string_view<CharT, Traits> lhs,
465 const std::basic_string<CharT, Traits>& rhs);
467 template<typename CharT, typename Traits>
468 RTTR_INLINE std::basic_string<CharT, Traits> operator+(const std::basic_string<CharT, Traits>& lhs,
471 template<typename CharT, typename Traits>
472 RTTR_INLINE std::basic_string<CharT, Traits> operator+(
basic_string_view<CharT, Traits> lhs,
473 std::basic_string<CharT, Traits>&& rhs);
475 template<typename CharT, typename Traits>
476 RTTR_INLINE std::basic_string<CharT, Traits> operator+(std::basic_string<CharT, Traits>&& lhs,
486 template <typename CharT, typename Traits>
487 std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
498 #include "rttr/detail/impl/string_view_impl.h"
500 #endif // RTTR_STRING_VIEW_H_