AWS IoT Device SDK C++ v2  1.34.0
AWS IoT Device SDK C++ v2
StringView.h
Go to the documentation of this file.
1 #pragma once
2 
11 #include <algorithm>
12 #include <cassert>
13 #include <iterator>
14 #include <limits>
15 #include <stddef.h>
16 #include <string>
17 #include <type_traits>
18 
19 #if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
20 # include <string_view>
21 #endif
22 
23 namespace Aws
24 {
25  namespace Crt
26  {
32  template <typename CharT, typename Traits = std::char_traits<CharT>> class basic_string_view
33  {
34  public:
35  // types
36  using traits_type = Traits;
37  using value_type = CharT;
38  using pointer = value_type *;
39  using const_pointer = const value_type *;
40  using reference = value_type &;
41  using const_reference = const value_type &;
42  using const_iterator = const value_type *;
44  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
46  using size_type = size_t;
47  using difference_type = ptrdiff_t;
48  static constexpr size_type npos = static_cast<size_type>(-1);
49 
50  // constructors and assignment
51 
52  constexpr basic_string_view() noexcept : m_size{0}, m_data{nullptr} {}
53 
54  constexpr basic_string_view(const basic_string_view &) noexcept = default;
55 
56  constexpr basic_string_view(const CharT *s) noexcept : m_size{traits_type::length(s)}, m_data{s} {}
57 
58  constexpr basic_string_view(const CharT *s, size_type count) noexcept : m_size{count}, m_data{s} {}
59 
60  basic_string_view &operator=(const basic_string_view &) noexcept = default;
61 
62 #if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
63  constexpr basic_string_view(const std::basic_string_view<CharT, Traits> &other) noexcept
64  : m_size(other.size()), m_data(other.data())
65  {
66  }
67 
68  basic_string_view &operator=(const std::basic_string_view<CharT, Traits> &other) noexcept
69  {
70  m_data = other->data();
71  m_size = other->size();
72  return *this;
73  }
74 #endif
75  // iterators
76 
77  constexpr const_iterator begin() const noexcept { return this->m_data; }
78 
79  constexpr const_iterator end() const noexcept { return this->m_data + this->m_size; }
80 
81  constexpr const_iterator cbegin() const noexcept { return this->m_data; }
82 
83  constexpr const_iterator cend() const noexcept { return this->m_data + this->m_size; }
84 
85  constexpr const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(this->end()); }
86 
87  constexpr const_reverse_iterator rend() const noexcept { return const_reverse_iterator(this->begin()); }
88 
89  constexpr const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(this->end()); }
90 
91  constexpr const_reverse_iterator crend() const noexcept { return const_reverse_iterator(this->begin()); }
92 
93  constexpr size_type size() const noexcept { return this->m_size; }
94 
95  constexpr size_type length() const noexcept { return this->m_size; }
96 
97  constexpr size_type max_size() const noexcept { return (std::numeric_limits<size_type>::max)(); }
98 
99  constexpr bool empty() const noexcept { return this->m_size == 0; }
100 
101  // element accessors
102 
104  {
105  assert(pos < m_size);
106  return *(this->m_data + pos);
107  }
108 
110  {
111  assert(pos < m_size);
112  return *(this->m_data + pos);
113  }
114 
115  const_reference front() const noexcept
116  {
117  assert(m_size > 0);
118  return *this->m_data;
119  }
120 
121  const_reference back() const noexcept
122  {
123  assert(m_size > 0);
124  return *(this->m_data + this->m_size - 1);
125  }
126 
127  constexpr const_pointer data() const noexcept { return this->m_data; }
128 
129  // modifiers
130  void remove_prefix(size_type n) noexcept
131  {
132  assert(this->m_size >= n);
133  this->m_data += n;
134  this->m_size -= n;
135  }
136 
137  void remove_suffix(size_type n) noexcept { this->m_size -= n; }
138 
139  void swap(basic_string_view &other) noexcept
140  {
141  auto tmp = *this;
142  *this = other;
143  other = tmp;
144  }
145 
146  // string operations
147  size_type copy(CharT *s, size_type n, size_type pos = 0) const
148  {
149  assert(pos <= size());
150  const size_type copyLen = (std::min)(n, m_size - pos);
151  traits_type::copy(s, data() + pos, copyLen);
152  return copyLen;
153  }
154 
155  basic_string_view substr(size_type pos = 0, size_type n = npos) const noexcept(false)
156  {
157  assert(pos <= size());
158  const size_type copyLen = (std::min)(n, m_size - pos);
159  return basic_string_view{m_data + pos, copyLen};
160  }
161 
162  int compare(const basic_string_view &s) const noexcept
163  {
164  const size_type compareLen = (std::min)(this->m_size, s.m_size);
165  int ret = traits_type::compare(this->m_data, s.m_data, compareLen);
166  if (ret == 0)
167  {
168  ret = _s_compare(this->m_size, s.m_size);
169  }
170  return ret;
171  }
172 
173  constexpr int compare(size_type pos1, size_type n1, const basic_string_view &s) const
174  {
175  return this->substr(pos1, n1).compare(s);
176  }
177 
178  constexpr int compare(
179  size_type pos1,
180  size_type n1,
181  const basic_string_view &s,
182  size_type pos2,
183  size_type n2) const
184  {
185  return this->substr(pos1, n1).compare(s.substr(pos2, n2));
186  }
187 
188  constexpr int compare(const CharT *s) const noexcept { return this->compare(basic_string_view{s}); }
189 
190  constexpr int compare(size_type pos1, size_type n1, const CharT *s) const
191  {
192  return this->substr(pos1, n1).compare(basic_string_view{s});
193  }
194 
195  constexpr int compare(size_type pos1, size_type n1, const CharT *s, size_type n2) const noexcept(false)
196  {
197  return this->substr(pos1, n1).compare(basic_string_view(s, n2));
198  }
199 
200  constexpr bool starts_with(const basic_string_view &other) const noexcept
201  {
202  return this->substr(0, other.size()) == other;
203  }
204 
205  constexpr bool starts_with(CharT c) const noexcept
206  {
207  return !this->empty() && traits_type::eq(this->front(), c);
208  }
209 
210  constexpr bool starts_with(const CharT *s) const noexcept
211  {
212  return this->starts_with(basic_string_view(s));
213  }
214 
215  constexpr bool ends_with(const basic_string_view &other) const noexcept
216  {
217  return this->m_size >= other.m_size && this->compare(this->m_size - other.m_size, npos, other) == 0;
218  }
219 
220  constexpr bool ends_with(CharT c) const noexcept
221  {
222  return !this->empty() && traits_type::eq(this->back(), c);
223  }
224 
225  constexpr bool ends_with(const CharT *s) const noexcept { return this->ends_with(basic_string_view(s)); }
226 
227  // find utilities
228  constexpr size_type find(const basic_string_view &s, size_type pos = 0) const noexcept
229  {
230  return this->find(s.m_data, pos, s.m_size);
231  }
232 
233  size_type find(CharT c, size_type pos = 0) const noexcept
234  {
235  if (pos >= m_size)
236  {
237  return npos;
238  }
239  const CharT *r = Traits::find(m_data + pos, m_size - pos, c);
240  if (r == nullptr)
241  {
242  return npos;
243  }
244  return static_cast<size_type>(r - m_data);
245  }
246 
247  size_type find(const CharT *s, size_type pos, size_type n) const noexcept
248  {
249  if (n && !s)
250  {
251  return npos;
252  }
253 
254  if (pos > m_size)
255  {
256  return npos;
257  }
258 
259  if (n == 0)
260  {
261  return pos;
262  }
263 
264  const CharT *r = _s_search_substr(m_data + pos, m_data + m_size, s, s + n);
265 
266  if (r == m_data + m_size)
267  {
268  return npos;
269  }
270  return static_cast<size_type>(r - m_data);
271  }
272 
273  constexpr size_type find(const CharT *s, size_type pos = 0) const noexcept
274  {
275  return this->find(s, pos, traits_type::length(s));
276  }
277 
278  size_type rfind(basic_string_view s, size_type pos = npos) const noexcept
279  {
280  if (s.m_size && !s.m_data)
281  {
282  return npos;
283  }
284  return this->rfind(s.m_data, pos, s.m_size);
285  }
286 
287  size_type rfind(CharT c, size_type pos = npos) const noexcept
288  {
289  if (m_size <= 0)
290  {
291  return npos;
292  }
293 
294  if (pos < m_size)
295  {
296  ++pos;
297  }
298  else
299  {
300  pos = m_size;
301  }
302 
303  for (const CharT *ptr = m_data + pos; ptr != m_data;)
304  {
305  if (Traits::eq(*--ptr, c))
306  {
307  return static_cast<size_type>(ptr - m_data);
308  }
309  }
310  return npos;
311  }
312 
313  size_type rfind(const CharT *s, size_type pos, size_type n) const noexcept
314  {
315  if (n && !s)
316  {
317  return npos;
318  }
319 
320  pos = (std::min)(pos, m_size);
321  if (n < m_size - pos)
322  {
323  pos += n;
324  }
325  else
326  {
327  pos = m_size;
328  }
329  const CharT *r = _s_find_end(m_data, m_data + pos, s, s + n);
330  if (n > 0 && r == m_data + pos)
331  {
332  return npos;
333  }
334  return static_cast<size_type>(r - m_data);
335  }
336 
337  constexpr size_type rfind(const CharT *s, size_type pos = npos) const noexcept
338  {
339  return this->rfind(s, pos, traits_type::length(s));
340  }
341 
342  constexpr size_type find_first_of(basic_string_view s, size_type pos = 0) const noexcept
343  {
344  return this->find_first_of(s.m_data, pos, s.m_size);
345  }
346 
347  constexpr size_type find_first_of(CharT c, size_type pos = 0) const noexcept { return this->find(c, pos); }
348 
349  size_type find_first_of(const CharT *s, size_type pos, size_type n) const noexcept
350  {
351  if (pos >= m_size || !n || !s)
352  {
353  return npos;
354  }
355 
356  const CharT *r = _s_find_first_of_ce(m_data + pos, m_data + m_size, s, s + n);
357 
358  if (r == m_data + m_size)
359  {
360  return npos;
361  }
362 
363  return static_cast<size_type>(r - m_data);
364  }
365 
366  constexpr size_type find_first_of(const CharT *s, size_type pos = 0) const noexcept
367  {
368  return this->find_first_of(s, pos, traits_type::length(s));
369  }
370 
371  constexpr size_type find_last_of(basic_string_view s, size_type pos = npos) const noexcept
372  {
373  return this->find_last_of(s.m_data, pos, s.m_size);
374  }
375 
376  constexpr size_type find_last_of(CharT c, size_type pos = npos) const noexcept
377  {
378  return this->rfind(c, pos);
379  }
380 
381  size_type find_last_of(const CharT *s, size_type pos, size_type n) const noexcept
382  {
383  if (!n || s == nullptr)
384  {
385  return npos;
386  }
387 
388  if (pos < m_size)
389  {
390  ++pos;
391  }
392  else
393  {
394  pos = m_size;
395  }
396 
397  for (const CharT *ptr = m_data + pos; ptr != m_data;)
398  {
399  const CharT *r = Traits::find(s, n, *--ptr);
400  if (r)
401  {
402  return static_cast<size_type>(ptr - m_data);
403  }
404  }
405 
406  return npos;
407  }
408 
409  constexpr size_type find_last_of(const CharT *s, size_type pos = npos) const noexcept
410  {
411  return this->find_last_of(s, pos, traits_type::length(s));
412  }
413 
415  {
416  if (s.m_size && !s.m_data)
417  {
418  return npos;
419  }
420  return this->find_first_not_of(s.m_data, pos, s.m_size);
421  }
422 
423  size_type find_first_not_of(CharT c, size_type pos = 0) const noexcept
424  {
425  if (!m_data || pos >= m_size)
426  {
427  return npos;
428  }
429 
430  const CharT *pend = m_data + m_size;
431  for (const CharT *ptr = m_data + pos; ptr != pend; ++ptr)
432  {
433  if (!Traits::eq(*ptr, c))
434  {
435  return static_cast<size_type>(ptr - m_data);
436  }
437  }
438 
439  return npos;
440  }
441 
442  size_type find_first_not_of(const CharT *s, size_type pos, size_type n) const noexcept
443  {
444  if (n && s == nullptr)
445  {
446  return npos;
447  }
448 
449  if (m_data == nullptr || pos >= m_size)
450  {
451  return npos;
452  }
453 
454  const CharT *pend = m_data + m_size;
455  for (const CharT *ptr = m_data + pos; ptr != pend; ++ptr)
456  {
457  if (Traits::find(s, n, *ptr) == 0)
458  {
459  return static_cast<size_type>(ptr - m_data);
460  }
461  }
462 
463  return npos;
464  }
465 
466  constexpr size_type find_first_not_of(const CharT *s, size_type pos = 0) const noexcept
467  {
468  return this->find_first_not_of(s, pos, traits_type::length(s));
469  }
470 
472  {
473  if (s.m_size && !s.m_data)
474  {
475  return npos;
476  }
477  return this->find_last_not_of(s.m_data, pos, s.m_size);
478  }
479 
480  size_type find_last_not_of(CharT c, size_type pos = npos) const noexcept
481  {
482  if (pos < m_size)
483  {
484  ++pos;
485  }
486  else
487  {
488  pos = m_size;
489  }
490 
491  for (const CharT *ptr = m_data + pos; ptr != m_data;)
492  {
493  if (!Traits::eq(*--ptr, c))
494  {
495  return static_cast<size_type>(ptr - m_data);
496  }
497  }
498  return npos;
499  }
500 
501  size_type find_last_not_of(const CharT *s, size_type pos, size_type n) const noexcept
502  {
503  if (n && !s)
504  {
505  return npos;
506  }
507 
508  if (pos < m_size)
509  {
510  ++pos;
511  }
512  else
513  {
514  pos = m_size;
515  }
516 
517  for (const CharT *ptr = m_data + pos; ptr != m_data;)
518  {
519  if (Traits::find(s, n, *--ptr) == 0)
520  {
521  return static_cast<size_type>(ptr - m_data);
522  }
523  }
524  return npos;
525  }
526 
527  constexpr size_type find_last_not_of(const CharT *s, size_type pos = npos) const noexcept
528  {
529  return this->find_last_not_of(s, pos, traits_type::length(s));
530  }
531 
532  private:
533  static int _s_compare(size_type n1, size_type n2) noexcept
534  {
535  const difference_type diff = n1 - n2;
536 
537  if (diff > (std::numeric_limits<int>::max)())
538  {
539  return (std::numeric_limits<int>::max)();
540  }
541 
542  if (diff < (std::numeric_limits<int>::min)())
543  {
544  return (std::numeric_limits<int>::min)();
545  }
546 
547  return static_cast<int>(diff);
548  }
549 
550  static const CharT *_s_search_substr(
551  const CharT *first1,
552  const CharT *last1,
553  const CharT *first2,
554  const CharT *last2)
555  {
556  const ptrdiff_t length2 = last2 - first2;
557  if (length2 == 0)
558  {
559  return first1;
560  }
561 
562  ptrdiff_t length1 = last1 - first1;
563  if (length1 < length2)
564  {
565  return last1;
566  }
567 
568  while (true)
569  {
570  length1 = last1 - first1;
571  if (length1 < length2)
572  {
573  return last1;
574  }
575 
576  first1 = Traits::find(first1, length1 - length2 + 1, *first2);
577  if (first1 == 0)
578  {
579  return last1;
580  }
581 
582  if (Traits::compare(first1, first2, length2) == 0)
583  {
584  return first1;
585  }
586 
587  ++first1;
588  }
589  }
590 
591  static const CharT *_s_find_end(
592  const CharT *first1,
593  const CharT *last1,
594  const CharT *first2,
595  const CharT *last2)
596  {
597  const CharT *r = last1;
598  if (first2 == last2)
599  {
600  return r;
601  }
602 
603  while (true)
604  {
605  while (true)
606  {
607  if (first1 == last1)
608  {
609  return r;
610  }
611  if (Traits::eq(*first1, *first2))
612  {
613  break;
614  }
615  ++first1;
616  }
617 
618  const CharT *m1 = first1;
619  const CharT *m2 = first2;
620  while (true)
621  {
622  if (++m2 == last2)
623  {
624  r = first1;
625  ++first1;
626  break;
627  }
628  if (++m1 == last1)
629  {
630  return r;
631  }
632  if (!Traits::eq(*m1, *m2))
633  {
634  ++first1;
635  break;
636  }
637  }
638  }
639  }
640 
641  static const CharT *_s_find_first_of_ce(
642  const CharT *first1,
643  const CharT *last1,
644  const CharT *first2,
645  const CharT *last2)
646  {
647  for (; first1 != last1; ++first1)
648  {
649  for (const CharT *ptr = first2; ptr != last2; ++ptr)
650  {
651  if (Traits::eq(*first1, *ptr))
652  {
653  return first1;
654  }
655  }
656  }
657  return last1;
658  }
659 
660  size_type m_size;
661  const CharT *m_data;
662  };
663 
664  // operator ==
665  template <class CharT, class Traits>
668  const basic_string_view<CharT, Traits> &rhs) noexcept
669  {
670  return (lhs.size() != rhs.size()) ? false : lhs.compare(rhs) == 0;
671  }
672 
673  template <class CharT, class Traits>
676  typename std::common_type<basic_string_view<CharT, Traits>>::type &rhs) noexcept
677  {
678  return (lhs.size() != rhs.size()) ? false : lhs.compare(rhs) == 0;
679  }
680 
681  template <class CharT, class Traits>
683  typename std::common_type<basic_string_view<CharT, Traits>>::type &lhs,
684  const basic_string_view<CharT, Traits> &rhs) noexcept
685  {
686  return (lhs.size() != rhs.size()) ? false : lhs.compare(rhs) == 0;
687  }
688 
689  // operator !=
690  template <class CharT, class Traits>
693  const basic_string_view<CharT, Traits> &rhs) noexcept
694  {
695  return (lhs.size() != rhs.size()) ? true : lhs.compare(rhs) != 0;
696  }
697 
698  template <class CharT, class Traits>
701  typename std::common_type<basic_string_view<CharT, Traits>>::type &rhs) noexcept
702  {
703  return (lhs.size() != rhs.size()) ? true : lhs.compare(rhs) != 0;
704  }
705 
706  template <class CharT, class Traits>
708  typename std::common_type<basic_string_view<CharT, Traits>>::type &lhs,
709  const basic_string_view<CharT, Traits> &rhs) noexcept
710  {
711  return (lhs.size() != rhs.size()) ? true : lhs.compare(rhs) != 0;
712  }
713 
714  // operator <
715  template <class CharT, class Traits>
716  bool operator<(
718  const basic_string_view<CharT, Traits> &rhs) noexcept
719  {
720  return lhs.compare(rhs) < 0;
721  }
722 
723  template <class CharT, class Traits>
724  constexpr bool operator<(
726  typename std::common_type<basic_string_view<CharT, Traits>>::type &rhs) noexcept
727  {
728  return lhs.compare(rhs) < 0;
729  }
730 
731  template <class CharT, class Traits>
732  constexpr bool operator<(
733  typename std::common_type<basic_string_view<CharT, Traits>>::type &lhs,
734  const basic_string_view<CharT, Traits> &rhs) noexcept
735  {
736  return lhs.compare(rhs) < 0;
737  }
738 
739  // operator >
740  template <class CharT, class Traits>
741  constexpr bool operator>(
743  const basic_string_view<CharT, Traits> &rhs) noexcept
744  {
745  return lhs.compare(rhs) > 0;
746  }
747 
748  template <class CharT, class Traits>
749  constexpr bool operator>(
751  typename std::common_type<basic_string_view<CharT, Traits>>::type &rhs) noexcept
752  {
753  return lhs.compare(rhs) > 0;
754  }
755 
756  template <class CharT, class Traits>
757  constexpr bool operator>(
758  typename std::common_type<basic_string_view<CharT, Traits>>::type &lhs,
759  const basic_string_view<CharT, Traits> &rhs) noexcept
760  {
761  return lhs.compare(rhs) > 0;
762  }
763 
764  // operator <=
765  template <class CharT, class Traits>
766  constexpr bool operator<=(
768  const basic_string_view<CharT, Traits> &rhs) noexcept
769  {
770  return lhs.compare(rhs) <= 0;
771  }
772 
773  template <class CharT, class Traits>
774  constexpr bool operator<=(
776  typename std::common_type<basic_string_view<CharT, Traits>>::type &rhs) noexcept
777  {
778  return lhs.compare(rhs) <= 0;
779  }
780 
781  template <class CharT, class Traits>
782  constexpr bool operator<=(
783  typename std::common_type<basic_string_view<CharT, Traits>>::type &lhs,
784  const basic_string_view<CharT, Traits> &rhs) noexcept
785  {
786  return lhs.compare(rhs) <= 0;
787  }
788 
789  // operator >=
790  template <class CharT, class Traits>
791  constexpr bool operator>=(
793  const basic_string_view<CharT, Traits> &rhs) noexcept
794  {
795  return lhs.compare(rhs) >= 0;
796  }
797 
798  template <class CharT, class Traits>
799  constexpr bool operator>=(
801  typename std::common_type<basic_string_view<CharT, Traits>>::type &rhs) noexcept
802  {
803  return lhs.compare(rhs) >= 0;
804  }
805 
806  template <class CharT, class Traits>
807  constexpr bool operator>=(
808  typename std::common_type<basic_string_view<CharT, Traits>>::type &lhs,
809  const basic_string_view<CharT, Traits> &rhs) noexcept
810  {
811  return lhs.compare(rhs) >= 0;
812  }
813 
818 
819  inline namespace literals
820  {
821  inline namespace string_view_literals
822  {
823  inline basic_string_view<char> operator"" _sv(const char *s, size_t length) noexcept
824  {
825  return basic_string_view<char>(s, length);
826  }
827 
828  inline basic_string_view<wchar_t> operator"" _sv(const wchar_t * s, size_t length) noexcept
829  {
830  return basic_string_view<wchar_t>(s, length);
831  }
832 
833  inline basic_string_view<char16_t> operator"" _sv(const char16_t *s, size_t length) noexcept
834  {
835  return basic_string_view<char16_t>(s, length);
836  }
837 
838  inline basic_string_view<char32_t> operator"" _sv(const char32_t *s, size_t length) noexcept
839  {
840  return basic_string_view<char32_t>(s, length);
841  }
842  } // namespace string_view_literals
843 
844  } // namespace literals
845 
847  } // namespace Crt
848 } // namespace Aws
849 
850 // hash
851 namespace std
852 {
853  template <class CharT, class Traits> struct hash<Aws::Crt::basic_string_view<CharT, Traits>>
854  {
855  size_t operator()(const Aws::Crt::basic_string_view<CharT, Traits> &val) const noexcept;
856  };
857 
858  template <class CharT, class Traits>
859  size_t hash<Aws::Crt::basic_string_view<CharT, Traits>>::operator()(
860  const Aws::Crt::basic_string_view<CharT, Traits> &val) const noexcept
861  {
862  auto str = std::basic_string<CharT, Traits>(val.data(), val.size());
863  return std::hash<std::basic_string<CharT, Traits>>{}(str);
864  }
865 } // namespace std
Aws::Crt::basic_string_view::find_first_of
constexpr size_type find_first_of(basic_string_view s, size_type pos=0) const noexcept
Definition: StringView.h:342
Aws::Crt::basic_string_view::difference_type
ptrdiff_t difference_type
Definition: StringView.h:47
Aws::Crt::operator>=
constexpr bool operator>=(const basic_string_view< CharT, Traits > &lhs, const basic_string_view< CharT, Traits > &rhs) noexcept
Definition: StringView.h:791
Aws::Crt::basic_string_view::find_last_not_of
size_type find_last_not_of(const CharT *s, size_type pos, size_type n) const noexcept
Definition: StringView.h:501
Aws::Crt::basic_string_view::const_pointer
const value_type * const_pointer
Definition: StringView.h:39
Aws::Crt::basic_string_view::find
constexpr size_type find(const CharT *s, size_type pos=0) const noexcept
Definition: StringView.h:273
Aws::Crt::basic_string_view::find_last_of
constexpr size_type find_last_of(const CharT *s, size_type pos=npos) const noexcept
Definition: StringView.h:409
Aws::Crt::u32string_view
basic_string_view< char32_t > u32string_view
Definition: StringView.h:816
Aws::Crt::basic_string_view::const_reference
const value_type & const_reference
Definition: StringView.h:41
Aws::Crt::basic_string_view::ends_with
constexpr bool ends_with(const CharT *s) const noexcept
Definition: StringView.h:225
Aws::Crt::basic_string_view::rfind
size_type rfind(CharT c, size_type pos=npos) const noexcept
Definition: StringView.h:287
Aws::Crt::basic_string_view::remove_suffix
void remove_suffix(size_type n) noexcept
Definition: StringView.h:137
Aws::Crt::basic_string_view::compare
int compare(const basic_string_view &s) const noexcept
Definition: StringView.h:162
Aws::Crt::operator==
bool operator==(const basic_string_view< CharT, Traits > &lhs, const basic_string_view< CharT, Traits > &rhs) noexcept
Definition: StringView.h:666
Aws::Crt::basic_string_view::find_last_not_of
constexpr size_type find_last_not_of(const CharT *s, size_type pos=npos) const noexcept
Definition: StringView.h:527
Aws::Crt::basic_string_view::npos
static constexpr size_type npos
Definition: StringView.h:48
Aws::Crt::basic_string_view::at
const_reference at(size_type pos) const
Definition: StringView.h:109
Aws::Crt::basic_string_view::substr
basic_string_view substr(size_type pos=0, size_type n=npos) const noexcept(false)
Definition: StringView.h:155
Aws::Crt::basic_string_view::basic_string_view
constexpr basic_string_view(const CharT *s, size_type count) noexcept
Definition: StringView.h:58
Aws::Crt::basic_string_view::remove_prefix
void remove_prefix(size_type n) noexcept
Definition: StringView.h:130
Aws::Crt::basic_string_view::front
const_reference front() const noexcept
Definition: StringView.h:115
Aws::Crt::basic_string_view::find_first_not_of
size_type find_first_not_of(basic_string_view s, size_type pos=0) const noexcept
Definition: StringView.h:414
Aws::Crt::basic_string_view::ends_with
constexpr bool ends_with(const basic_string_view &other) const noexcept
Definition: StringView.h:215
Aws::Crt::basic_string_view::back
const_reference back() const noexcept
Definition: StringView.h:121
Aws::Crt::basic_string_view::empty
constexpr bool empty() const noexcept
Definition: StringView.h:99
Aws::Crt::operator>
constexpr bool operator>(const basic_string_view< CharT, Traits > &lhs, const basic_string_view< CharT, Traits > &rhs) noexcept
Definition: StringView.h:741
Aws::Crt::basic_string_view::traits_type
Traits traits_type
Definition: StringView.h:36
Aws::Crt::wstring_view
basic_string_view< wchar_t > wstring_view
Definition: StringView.h:817
Aws::Crt::basic_string_view::starts_with
constexpr bool starts_with(const CharT *s) const noexcept
Definition: StringView.h:210
Aws::Crt::operator!=
bool operator!=(const basic_string_view< CharT, Traits > &lhs, const basic_string_view< CharT, Traits > &rhs) noexcept
Definition: StringView.h:691
Aws::Crt::basic_string_view::find_first_not_of
size_type find_first_not_of(CharT c, size_type pos=0) const noexcept
Definition: StringView.h:423
Aws::Crt::basic_string_view::starts_with
constexpr bool starts_with(CharT c) const noexcept
Definition: StringView.h:205
Aws::Crt::basic_string_view::find_last_not_of
size_type find_last_not_of(CharT c, size_type pos=npos) const noexcept
Definition: StringView.h:480
Aws::Crt::basic_string_view::cend
constexpr const_iterator cend() const noexcept
Definition: StringView.h:83
Aws::Crt::basic_string_view::size_type
size_t size_type
Definition: StringView.h:46
Aws::Crt::basic_string_view::find_first_not_of
constexpr size_type find_first_not_of(const CharT *s, size_type pos=0) const noexcept
Definition: StringView.h:466
Aws::Crt::basic_string_view::starts_with
constexpr bool starts_with(const basic_string_view &other) const noexcept
Definition: StringView.h:200
Aws::Crt::basic_string_view::compare
constexpr int compare(size_type pos1, size_type n1, const CharT *s) const
Definition: StringView.h:190
Aws::Crt::basic_string_view::find_first_not_of
size_type find_first_not_of(const CharT *s, size_type pos, size_type n) const noexcept
Definition: StringView.h:442
Aws::Crt::basic_string_view::compare
constexpr int compare(size_type pos1, size_type n1, const basic_string_view &s, size_type pos2, size_type n2) const
Definition: StringView.h:178
Aws::Crt::basic_string_view::data
constexpr const_pointer data() const noexcept
Definition: StringView.h:127
Aws::Crt::basic_string_view::basic_string_view
constexpr basic_string_view(const CharT *s) noexcept
Definition: StringView.h:56
Aws::Crt::basic_string_view::find
constexpr size_type find(const basic_string_view &s, size_type pos=0) const noexcept
Definition: StringView.h:228
Aws::Crt::basic_string_view::operator=
basic_string_view & operator=(const basic_string_view &) noexcept=default
Aws::Crt::basic_string_view::find_last_not_of
size_type find_last_not_of(basic_string_view s, size_type pos=npos) const noexcept
Definition: StringView.h:471
Aws::Crt::basic_string_view::basic_string_view
constexpr basic_string_view(const basic_string_view &) noexcept=default
Aws::Crt::basic_string_view::rend
constexpr const_reverse_iterator rend() const noexcept
Definition: StringView.h:87
Aws::Crt::basic_string_view::rfind
size_type rfind(basic_string_view s, size_type pos=npos) const noexcept
Definition: StringView.h:278
Aws::Crt::basic_string_view::ends_with
constexpr bool ends_with(CharT c) const noexcept
Definition: StringView.h:220
Aws::Crt::basic_string_view::find_first_of
constexpr size_type find_first_of(const CharT *s, size_type pos=0) const noexcept
Definition: StringView.h:366
Aws::Crt::basic_string_view::find
size_type find(const CharT *s, size_type pos, size_type n) const noexcept
Definition: StringView.h:247
Aws::Crt::u16string_view
basic_string_view< char16_t > u16string_view
Definition: StringView.h:815
Aws::Crt::basic_string_view::rbegin
constexpr const_reverse_iterator rbegin() const noexcept
Definition: StringView.h:85
Aws::Crt::basic_string_view
Definition: StringView.h:33
Aws::Crt::basic_string_view::length
constexpr size_type length() const noexcept
Definition: StringView.h:95
std
Definition: StringView.h:852
Aws::Crt::basic_string_view::compare
constexpr int compare(const CharT *s) const noexcept
Definition: StringView.h:188
Aws::Crt::basic_string_view::compare
constexpr int compare(size_type pos1, size_type n1, const CharT *s, size_type n2) const noexcept(false)
Definition: StringView.h:195
Aws::Crt::basic_string_view::reference
value_type & reference
Definition: StringView.h:40
Aws::Crt::operator<
bool operator<(const basic_string_view< CharT, Traits > &lhs, const basic_string_view< CharT, Traits > &rhs) noexcept
Definition: StringView.h:716
Aws::Crt::basic_string_view::find
size_type find(CharT c, size_type pos=0) const noexcept
Definition: StringView.h:233
Aws
Definition: Allocator.h:11
Aws::Crt::basic_string_view::operator[]
const_reference operator[](size_type pos) const noexcept
Definition: StringView.h:103
Aws::Crt::basic_string_view::begin
constexpr const_iterator begin() const noexcept
Definition: StringView.h:77
Aws::Crt::basic_string_view::reverse_iterator
const_reverse_iterator reverse_iterator
Definition: StringView.h:45
Aws::Crt::string_view
basic_string_view< char > string_view
Definition: StringView.h:814
Aws::Crt::basic_string_view::find_last_of
size_type find_last_of(const CharT *s, size_type pos, size_type n) const noexcept
Definition: StringView.h:381
Aws::Crt::basic_string_view::basic_string_view
constexpr basic_string_view() noexcept
Definition: StringView.h:52
Aws::Crt::basic_string_view::compare
constexpr int compare(size_type pos1, size_type n1, const basic_string_view &s) const
Definition: StringView.h:173
Aws::Crt::basic_string_view::iterator
const_iterator iterator
Definition: StringView.h:43
Aws::Crt::basic_string_view::max_size
constexpr size_type max_size() const noexcept
Definition: StringView.h:97
Aws::Crt::basic_string_view::swap
void swap(basic_string_view &other) noexcept
Definition: StringView.h:139
Aws::Crt::basic_string_view::crbegin
constexpr const_reverse_iterator crbegin() const noexcept
Definition: StringView.h:89
Aws::Crt::basic_string_view::find_first_of
constexpr size_type find_first_of(CharT c, size_type pos=0) const noexcept
Definition: StringView.h:347
Aws::Crt::basic_string_view::pointer
value_type * pointer
Definition: StringView.h:38
Aws::Crt::basic_string_view::find_first_of
size_type find_first_of(const CharT *s, size_type pos, size_type n) const noexcept
Definition: StringView.h:349
Aws::Crt::basic_string_view::cbegin
constexpr const_iterator cbegin() const noexcept
Definition: StringView.h:81
Aws::Crt::basic_string_view::const_iterator
const value_type * const_iterator
Definition: StringView.h:42
Aws::Crt::basic_string_view::rfind
constexpr size_type rfind(const CharT *s, size_type pos=npos) const noexcept
Definition: StringView.h:337
Aws::Crt::basic_string_view::find_last_of
constexpr size_type find_last_of(CharT c, size_type pos=npos) const noexcept
Definition: StringView.h:376
Aws::Crt::basic_string_view::rfind
size_type rfind(const CharT *s, size_type pos, size_type n) const noexcept
Definition: StringView.h:313
Aws::Crt::basic_string_view::value_type
CharT value_type
Definition: StringView.h:37
Aws::Crt::operator<=
constexpr bool operator<=(const basic_string_view< CharT, Traits > &lhs, const basic_string_view< CharT, Traits > &rhs) noexcept
Definition: StringView.h:766
Aws::Crt::basic_string_view::find_last_of
constexpr size_type find_last_of(basic_string_view s, size_type pos=npos) const noexcept
Definition: StringView.h:371
Aws::Crt::basic_string_view::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: StringView.h:44
Aws::Crt::basic_string_view::size
constexpr size_type size() const noexcept
Definition: StringView.h:93
Aws::Crt::basic_string_view::end
constexpr const_iterator end() const noexcept
Definition: StringView.h:79
Aws::Crt::basic_string_view::copy
size_type copy(CharT *s, size_type n, size_type pos=0) const
Definition: StringView.h:147
Aws::Crt::basic_string_view::crend
constexpr const_reverse_iterator crend() const noexcept
Definition: StringView.h:91