27 typedef gdb::string_view::size_type csize_type;
28 typedef gdb::string_view::const_reference cref;
29 typedef gdb::string_view::reference ref;
30 csize_type npos = gdb::string_view::npos;
31 csize_type csz01, csz02;
33 const char str_lit01[] =
"mave";
34 const gdb::string_view str01(
"mavericks, santa cruz");
35 gdb::string_view str02(str_lit01);
36 gdb::string_view str03(
"s, s");
37 gdb::string_view str04;
40 csz01 = str01.find(str01);
42 csz01 = str01.find(str01, 4);
44 csz01 = str01.find(str02, 0);
46 csz01 = str01.find(str02, 3);
48 csz01 = str01.find(str03, 0);
50 csz01 = str01.find(str03, 3);
52 csz01 = str01.find(str03, 12);
58 csz01 = str01.find(str04, 0);
60 csz01 = str01.find(str04, 5);
62 csz01 = str01.find(str04, str01.size());
63 VERIFY( csz01 == str01.size() );
64 csz01 = str01.find(str04, str01.size()+1);
68 csz01 = str01.find(str_lit01, 0, 3);
70 csz01 = str01.find(str_lit01, 3, 0);
74 csz01 = str01.find(str_lit01);
76 csz01 = str01.find(str_lit01, 3);
80 csz01 = str01.find(
'z');
81 csz02 = str01.size() - 1;
83 csz01 = str01.find(
'/');
91 typedef std::string_view::size_type csize_type;
92 typedef std::string_view::const_reference cref;
93 typedef std::string_view::reference ref;
94 csize_type npos = std::string_view::npos;
95 csize_type csz01 = 0, csz02 = 0;
97 const char str_lit01[] =
"mave";
98 const std::string_view str01(
"mavericks, santa cruz");
99 std::string_view str02(str_lit01);
100 std::string_view str03(
"s, s");
101 std::string_view str04;
104#define VERIFY(x) if(!(x)) return false
107 csz01 = str01.find(str01);
109 csz01 = str01.find(str01, 4);
111 csz01 = str01.find(str02, 0);
113 csz01 = str01.find(str02, 3);
115 csz01 = str01.find(str03, 0);
117 csz01 = str01.find(str03, 3);
119 csz01 = str01.find(str03, 12);
125 csz01 = str01.find(str04, 0);
127 csz01 = str01.find(str04, 5);
129 csz01 = str01.find(str04, str01.size());
130 VERIFY( csz01 == str01.size() );
131 csz01 = str01.find(str04, str01.size()+1);
135 csz01 = str01.find(str_lit01, 0, 3);
137 csz01 = str01.find(str_lit01, 3, 0);
141 csz01 = str01.find(str_lit01);
143 csz01 = str01.find(str_lit01, 3);
147 csz01 = str01.find(
'z');
148 csz02 = str01.size() - 1;
150 csz01 = str01.find(
'/');