29#ifndef RTTR_STRING_VIEW_H_
30#define RTTR_STRING_VIEW_H_
32#include "rttr/detail/base/core_prerequisites.h"
47template<
typename CharT,
typename Traits = std::
char_traits<CharT> >
95 template<typename Allocator>
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;
296template<typename CharT, typename Traits>
300template<typename CharT, typename Traits>
301RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator==(const
char* lhs,
304template<typename CharT, typename Traits>
306 const
char* rhs) RTTR_NOEXCEPT;
308template<typename CharT, typename Traits>
309RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator==(const std::basic_string<CharT, Traits>& lhs,
312template<typename CharT, typename Traits>
314 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
325template<typename CharT, typename Traits>
329template<typename CharT, typename Traits>
330RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator!=(const
char* lhs,
333template<typename CharT, typename Traits>
335 const
char* rhs) RTTR_NOEXCEPT;
337template<typename CharT, typename Traits>
338RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator!=(const std::basic_string<CharT, Traits>& lhs,
341template<typename CharT, typename Traits>
343 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
354template<typename CharT, typename Traits>
358template<typename CharT, typename Traits>
359RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<=(const
char* lhs,
362template<typename CharT, typename Traits>
364 const
char* rhs) RTTR_NOEXCEPT;
366template<typename CharT, typename Traits>
367RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<=(const std::basic_string<CharT, Traits>& lhs,
370template<typename CharT, typename Traits>
372 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
383template<typename CharT, typename Traits>
387template<typename CharT, typename Traits>
388RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>=(const
char* lhs,
391template<typename CharT, typename Traits>
393 const
char* rhs) RTTR_NOEXCEPT;
395template<typename CharT, typename Traits>
396RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>=(const std::basic_string<CharT, Traits>& lhs,
399template<typename CharT, typename Traits>
401 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
412template<typename CharT, typename Traits>
416template<typename CharT, typename Traits>
417RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>(const
char* lhs,
420template<typename CharT, typename Traits>
422 const
char* rhs) RTTR_NOEXCEPT;
424template<typename CharT, typename Traits>
425RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator>(const std::basic_string<CharT, Traits>& lhs,
428template<typename CharT, typename Traits>
430 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
441template<typename CharT, typename Traits>
445template<typename CharT, typename Traits>
446RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<(const
char* lhs,
449template<typename CharT, typename Traits>
451 const
char* rhs) RTTR_NOEXCEPT;
453template<typename CharT, typename Traits>
454RTTR_INLINE RTTR_CXX14_CONSTEXPR
bool operator<(const std::basic_string<CharT, Traits>& lhs,
457template<typename CharT, typename Traits>
459 const std::basic_string<CharT, Traits>& rhs) RTTR_NOEXCEPT;
463template<typename CharT, typename Traits>
465 const std::basic_string<CharT, Traits>& rhs);
467template<typename CharT, typename Traits>
468RTTR_INLINE std::basic_string<CharT, Traits> operator+(const std::basic_string<CharT, Traits>& lhs,
471template<typename CharT, typename Traits>
473 std::basic_string<CharT, Traits>&& rhs);
475template<typename CharT, typename Traits>
476RTTR_INLINE std::basic_string<CharT, Traits> operator+(std::basic_string<CharT, Traits>&& lhs,
486template <typename CharT, typename Traits>
487std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
498#include "rttr/detail/impl/string_view_impl.h"
The class template basic_string_view describes an non-owning reference to a constant contiguous seque...
Definition string_view.h:49
constexpr const_reference back() const
Returns reference to the last character in the view.
constexpr void remove_suffix(size_type n) noexcept
Moves the end of the view back by n characters.
constexpr const_iterator cbegin() const noexcept
Returns an iterator to the beginning of the view.
const_pointer const_iterator
Definition string_view.h:57
constexpr int compare(basic_string_view v) const noexcept
The function compares the two views by calling Traits::compare(data(), v.data(), length),...
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition string_view.h:59
const_reverse_iterator crbegin() const noexcept
Returns a reverse iterator to the first character of the reversed view.
constexpr const_iterator end() const noexcept
Returns an iterator to the character following the last character of the view.
constexpr basic_string_view() noexcept
Default constructor.
std::size_t size_type
Definition string_view.h:61
CharT value_type
Definition string_view.h:52
constexpr const_iterator begin() const noexcept
Returns an iterator to the beginning of the view.
CharT * pointer
Definition string_view.h:53
constexpr size_type length() const noexcept
Returns the number of CharT elements in the view, i.e.
const_iterator iterator
Definition string_view.h:58
const_reverse_iterator reverse_iterator
Definition string_view.h:60
const CharT & const_reference
Definition string_view.h:56
std::basic_string< CharT, Traits > to_string(const Allocator &a=Allocator()) const
Creates a basic_string with a copy of the content of the current view.
constexpr size_type max_size() const noexcept
The largest possible number of char-like objects that can be referred to by a basic_string_view.
const_reverse_iterator rend() const noexcept
Returns a reverse iterator to the character following the last character of the reversed view.
constexpr const_iterator cend() const noexcept
Returns an iterator to the character following the last character of the view.
const_reverse_iterator crend() const noexcept
Returns a reverse iterator to the character following the last character of the reversed view.
Traits traits_type
Definition string_view.h:51
const_reverse_iterator rbegin() const noexcept
Returns a reverse iterator to the first character of the reversed view.
std::ptrdiff_t difference_type
Definition string_view.h:62
constexpr const_pointer data() const noexcept
Returns a pointer to the underlying character array.
constexpr const_reference front() const
Returns reference to the first character in the view.
CharT & reference
Definition string_view.h:55
constexpr bool empty() const noexcept
Checks if the view has no characters, i.e.
const CharT * const_pointer
Definition string_view.h:54
static size_type npos
Definition string_view.h:63
constexpr size_type size() const noexcept
Returns the number of CharT elements in the view, i.e.
constexpr void swap(basic_string_view &s) noexcept
constexpr void remove_prefix(size_type n) noexcept
Moves the start of the view forward by n characters.
Definition access_levels.h:34