Toolbox snapshot
The Reactive C++ Toolbox
Loading...
Searching...
No Matches
String.ut.cpp
Go to the documentation of this file.
1// The Reactive C++ Toolbox.
2// Copyright (C) 2013-2019 Swirly Cloud Limited
3// Copyright (C) 2023 Reactive Markets Limited
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17#include "String.hpp"
18
19#include <boost/test/unit_test.hpp>
20
21#include <filesystem>
22
23namespace std {
24template <typename T, typename U>
25ostream& operator<<(ostream& os, const pair<T, U>& p)
26{
27 return os << '(' << p.first << ',' << p.second << ')';
28}
29} // namespace std
30
31using namespace std;
32using namespace toolbox;
33
35
37{
38 // Make sure the string is not optimised away.
39 const auto s = to_string(time(nullptr));
40
41 // Ensure that std::string_view iterators are equivalent across copies of the std::string_view.
42 const string_view a{s};
43 const string_view b{a};
44
45 // Best effort to detect broken assumption.
46 const void* aptr = a.data();
47 const void* bptr = b.data();
49}
50
52{
53 BOOST_CHECK_EQUAL(to_string("foo"sv), "foo"s);
54 BOOST_CHECK_EQUAL(stoi(to_string(12345)), 12345);
55 BOOST_CHECK_EQUAL(stod(to_string(12345.67)), 12345.67);
56}
57
59{
61 BOOST_CHECK_EQUAL(ltrim_copy(" \t\n\v\f\r"sv), ""sv);
62 BOOST_CHECK_EQUAL(ltrim_copy(" \t\n\v\f\rfoo "sv), "foo "sv);
63 BOOST_CHECK_EQUAL(ltrim_copy("foo"sv), "foo"sv);
64
66 BOOST_CHECK_EQUAL(ltrim_copy(" \t\n\v\f\r"s), ""s);
67 BOOST_CHECK_EQUAL(ltrim_copy(" \t\n\v\f\rfoo "s), "foo "s);
68 BOOST_CHECK_EQUAL(ltrim_copy("foo"s), "foo"s);
69}
70
72{
74 BOOST_CHECK_EQUAL(rtrim_copy(" \t\n\v\f\r"sv), ""sv);
75 BOOST_CHECK_EQUAL(rtrim_copy(" foo \t\n\v\f\r"sv), " foo"sv);
76 BOOST_CHECK_EQUAL(rtrim_copy("foo"sv), "foo"sv);
77
79 BOOST_CHECK_EQUAL(rtrim_copy(" \t\n\v\f\r"s), ""s);
80 BOOST_CHECK_EQUAL(rtrim_copy(" foo \t\n\v\f\r"s), " foo"s);
81 BOOST_CHECK_EQUAL(rtrim_copy("foo"s), "foo"s);
82}
83
85{
87 BOOST_CHECK_EQUAL(trim_copy(" \t\n\v\f\r"sv), ""sv);
88 BOOST_CHECK_EQUAL(trim_copy(" \t\n\v\f\rfoo \t\n\v\f\r"sv), "foo"sv);
89 BOOST_CHECK_EQUAL(trim_copy("foo"sv), "foo"sv);
90
92 BOOST_CHECK_EQUAL(trim_copy(" \t\n\v\f\r"s), ""s);
93 BOOST_CHECK_EQUAL(trim_copy(" \t\n\v\f\rfoo \t\n\v\f\r"s), "foo"s);
94 BOOST_CHECK_EQUAL(trim_copy("foo"s), "foo"s);
95}
96
98{
100 BOOST_CHECK_EQUAL(split_pair("="sv, '='), make_pair(""sv, ""sv));
101 BOOST_CHECK_EQUAL(split_pair("a"sv, '='), make_pair("a"sv, ""sv));
102 BOOST_CHECK_EQUAL(split_pair("a="sv, '='), make_pair("a"sv, ""sv));
103 BOOST_CHECK_EQUAL(split_pair("=b"sv, '='), make_pair(""sv, "b"sv));
104 BOOST_CHECK_EQUAL(split_pair("a=b"sv, '='), make_pair("a"sv, "b"sv));
105 BOOST_CHECK_EQUAL(split_pair("a:b"sv, ':'), make_pair("a"sv, "b"sv));
106 BOOST_CHECK_EQUAL(split_pair(" a = b "sv, '='), make_pair(" a "sv, " b "sv));
107
108 BOOST_CHECK_EQUAL(split_pair(""s, '='), make_pair(""s, ""s));
109 BOOST_CHECK_EQUAL(split_pair("="s, '='), make_pair(""s, ""s));
110 BOOST_CHECK_EQUAL(split_pair("a"s, '='), make_pair("a"s, ""s));
111 BOOST_CHECK_EQUAL(split_pair("a="s, '='), make_pair("a"s, ""s));
112 BOOST_CHECK_EQUAL(split_pair("=b"s, '='), make_pair(""s, "b"s));
113 BOOST_CHECK_EQUAL(split_pair("a=b"s, '='), make_pair("a"s, "b"s));
114 BOOST_CHECK_EQUAL(split_pair("a:b"s, ':'), make_pair("a"s, "b"s));
115 BOOST_CHECK_EQUAL(split_pair(" a = b "s, '='), make_pair(" a "s, " b "s));
116}
117
119{
120 constexpr char ZeroPad[] = "foo";
121 BOOST_CHECK_EQUAL(pstrlen<'\0'>(ZeroPad, ~0), 3UL);
122 BOOST_CHECK_EQUAL(pstrlen<'\0'>(ZeroPad, 2), 2UL);
123 BOOST_CHECK_EQUAL(pstrlen<'\0'>(ZeroPad), 3UL);
124
125 constexpr char SpacePad[] = "foo ";
126 BOOST_CHECK_EQUAL(pstrlen<' '>(SpacePad, ~0), 3UL);
127 BOOST_CHECK_EQUAL(pstrlen<' '>(SpacePad, 2), 2UL);
129}
130
132{
133 struct TOOLBOX_PACKED {
134 char data[8];
135 char canary;
136 } buf{};
137
138 auto clear = [&]() { memset(buf.data, '#', sizeof(buf.data) + 1); };
139
140 clear();
141 BOOST_CHECK_EQUAL(memcmp(buf.data, "########", sizeof(buf.data)), 0);
142 BOOST_CHECK_EQUAL(buf.canary, '#');
143
144 // Zero / C-String / Explicit Length.
145 clear();
146 BOOST_CHECK_EQUAL(pstrcpy<'\0'>(buf.data, "foobar", sizeof(buf.data)), 6UL);
147 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobar\0\0", sizeof(buf.data)), 0);
148 BOOST_CHECK_EQUAL(buf.canary, '#');
149
150 clear();
151 BOOST_CHECK_EQUAL(pstrcpy<'\0'>(buf.data, "foobarbaz", sizeof(buf.data)), 8UL);
152 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
153 BOOST_CHECK_EQUAL(buf.canary, '#');
154
155 // Zero / C-String / Implied Length.
156 clear();
157 BOOST_CHECK_EQUAL(pstrcpy<'\0'>(buf.data, "foobar"), 6UL);
158 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobar\0\0", sizeof(buf.data)), 0);
159 BOOST_CHECK_EQUAL(buf.canary, '#');
160
161 clear();
162 BOOST_CHECK_EQUAL(pstrcpy<'\0'>(buf.data, "foobarbaz"), 8UL);
163 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
164 BOOST_CHECK_EQUAL(buf.canary, '#');
165
166 // Zero / String View / Explicit Length.
167 clear();
168 BOOST_CHECK_EQUAL(pstrcpy<'\0'>(buf.data, "foobar"sv, sizeof(buf.data)), 6UL);
169 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobar\0\0", sizeof(buf.data)), 0);
170 BOOST_CHECK_EQUAL(buf.canary, '#');
171
172 clear();
173 BOOST_CHECK_EQUAL(pstrcpy<'\0'>(buf.data, "foobarbaz"sv, sizeof(buf.data)), 8UL);
174 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
175 BOOST_CHECK_EQUAL(buf.canary, '#');
176
177 // Zero / String View / Implied Length.
178 clear();
179 BOOST_CHECK_EQUAL(pstrcpy<'\0'>(buf.data, "foobar"sv), 6UL);
180 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobar\0\0", sizeof(buf.data)), 0);
181 BOOST_CHECK_EQUAL(buf.canary, '#');
182
183 clear();
184 BOOST_CHECK_EQUAL(pstrcpy<'\0'>(buf.data, "foobarbaz"sv), 8UL);
185 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
186 BOOST_CHECK_EQUAL(buf.canary, '#');
187
188 // Space / C-String / Explicit Length.
189 clear();
190 BOOST_CHECK_EQUAL(pstrcpy<' '>(buf.data, "foobar", sizeof(buf.data)), 6UL);
191 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobar ", sizeof(buf.data)), 0);
192 BOOST_CHECK_EQUAL(buf.canary, '#');
193
194 clear();
195 BOOST_CHECK_EQUAL(pstrcpy<' '>(buf.data, "foobarbaz", sizeof(buf.data)), 8UL);
196 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
197 BOOST_CHECK_EQUAL(buf.canary, '#');
198
199 // Space / C-String / Implied Length.
200 clear();
201 BOOST_CHECK_EQUAL(pstrcpy<' '>(buf.data, "foobar"), 6UL);
202 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobar ", sizeof(buf.data)), 0);
203 BOOST_CHECK_EQUAL(buf.canary, '#');
204
205 clear();
206 BOOST_CHECK_EQUAL(pstrcpy<' '>(buf.data, "foobarbaz"), 8UL);
207 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
208 BOOST_CHECK_EQUAL(buf.canary, '#');
209
210 // Space / String View / Explicit Length.
211 clear();
212 BOOST_CHECK_EQUAL(pstrcpy<' '>(buf.data, "foobar"sv, sizeof(buf.data)), 6UL);
213 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobar ", sizeof(buf.data)), 0);
214 BOOST_CHECK_EQUAL(buf.canary, '#');
215
216 clear();
217 BOOST_CHECK_EQUAL(pstrcpy<' '>(buf.data, "foobarbaz"sv, sizeof(buf.data)), 8UL);
218 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
219 BOOST_CHECK_EQUAL(buf.canary, '#');
220
221 // Space / String View / Implied Length.
222 clear();
223 BOOST_CHECK_EQUAL(pstrcpy<' '>(buf.data, "foobar"sv), 6UL);
224 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobar ", sizeof(buf.data)), 0);
225 BOOST_CHECK_EQUAL(buf.canary, '#');
226
227 clear();
228 BOOST_CHECK_EQUAL(pstrcpy<' '>(buf.data, "foobarbaz"sv), 8UL);
229 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
230 BOOST_CHECK_EQUAL(buf.canary, '#');
231}
232
234{
235 struct TOOLBOX_PACKED {
236 char data[8];
237 char canary;
238 } buf{};
239
240 auto clear = [&]() { memset(buf.data, '#', sizeof(buf.data) + 1); };
241
242 clear();
243 BOOST_CHECK_EQUAL(memcmp(buf.data, "########", sizeof(buf.data)), 0);
244 BOOST_CHECK_EQUAL(buf.canary, '#');
245
246 // Zero / Explicit Length.
247 clear();
248 BOOST_CHECK_EQUAL(pstrcpyid<'\0'>(buf.data, 123456, sizeof(buf.data)), 6UL);
249 BOOST_CHECK_EQUAL(memcmp(buf.data, "123456\0\0", sizeof(buf.data)), 0);
250 BOOST_CHECK_EQUAL(buf.canary, '#');
251
252 clear();
253 BOOST_CHECK_EQUAL(pstrcpyid<'\0'>(buf.data, -1234567, sizeof(buf.data)), 8UL);
254 BOOST_CHECK_EQUAL(memcmp(buf.data, "-1234567", sizeof(buf.data)), 0);
255 BOOST_CHECK_EQUAL(buf.canary, '#');
256
257 clear();
258 BOOST_CHECK_EQUAL(pstrcpyid<'\0'>(buf.data, 123456789, sizeof(buf.data)), 0UL);
259 BOOST_CHECK_EQUAL(memcmp(buf.data, "########", sizeof(buf.data)), 0);
260 BOOST_CHECK_EQUAL(buf.canary, '#');
261
262 // Space / Explicit Length.
263 clear();
264 BOOST_CHECK_EQUAL(pstrcpyid<' '>(buf.data, 123456, sizeof(buf.data)), 6UL);
265 BOOST_CHECK_EQUAL(memcmp(buf.data, "123456 ", sizeof(buf.data)), 0);
266 BOOST_CHECK_EQUAL(buf.canary, '#');
267
268 clear();
269 BOOST_CHECK_EQUAL(pstrcpyid<' '>(buf.data, -1234567, sizeof(buf.data)), 8UL);
270 BOOST_CHECK_EQUAL(memcmp(buf.data, "-1234567", sizeof(buf.data)), 0);
271 BOOST_CHECK_EQUAL(buf.canary, '#');
272
273 clear();
274 BOOST_CHECK_EQUAL(pstrcpyid<' '>(buf.data, 123456789, sizeof(buf.data)), 0UL);
275 BOOST_CHECK_EQUAL(memcmp(buf.data, "########", sizeof(buf.data)), 0);
276 BOOST_CHECK_EQUAL(buf.canary, '#');
277
278 // Zero / Implied Length.
279 clear();
280 BOOST_CHECK_EQUAL(pstrcpyid<'\0'>(buf.data, 123456), 6UL);
281 BOOST_CHECK_EQUAL(memcmp(buf.data, "123456\0\0", sizeof(buf.data)), 0);
282 BOOST_CHECK_EQUAL(buf.canary, '#');
283
284 clear();
285 BOOST_CHECK_EQUAL(pstrcpyid<'\0'>(buf.data, -1234567), 8UL);
286 BOOST_CHECK_EQUAL(memcmp(buf.data, "-1234567", sizeof(buf.data)), 0);
287 BOOST_CHECK_EQUAL(buf.canary, '#');
288
289 clear();
290 BOOST_CHECK_EQUAL(pstrcpyid<'\0'>(buf.data, 123456789), 0UL);
291 BOOST_CHECK_EQUAL(memcmp(buf.data, "########", sizeof(buf.data)), 0);
292 BOOST_CHECK_EQUAL(buf.canary, '#');
293
294 // Space / Implied Length.
295 clear();
296 BOOST_CHECK_EQUAL(pstrcpyid<' '>(buf.data, 123456), 6UL);
297 BOOST_CHECK_EQUAL(memcmp(buf.data, "123456 ", sizeof(buf.data)), 0);
298 BOOST_CHECK_EQUAL(buf.canary, '#');
299
300 clear();
301 BOOST_CHECK_EQUAL(pstrcpyid<' '>(buf.data, -1234567), 8UL);
302 BOOST_CHECK_EQUAL(memcmp(buf.data, "-1234567", sizeof(buf.data)), 0);
303 BOOST_CHECK_EQUAL(buf.canary, '#');
304
305 clear();
306 BOOST_CHECK_EQUAL(pstrcpyid<' '>(buf.data, 123456789), 0UL);
307 BOOST_CHECK_EQUAL(memcmp(buf.data, "########", sizeof(buf.data)), 0);
308 BOOST_CHECK_EQUAL(buf.canary, '#');
309}
310
312{
313 constexpr char ZeroPad[4] = {'\0', 'f', 'o', 'o'};
314 BOOST_CHECK_EQUAL(lpstrlen<'\0'>(ZeroPad, sizeof(ZeroPad)), 3UL);
315 BOOST_CHECK_EQUAL(lpstrlen<'\0'>(ZeroPad, 3), 2UL);
317
318 constexpr char SpacePad[4] = {' ', 'f', 'o', 'o'};
319 BOOST_CHECK_EQUAL(lpstrlen<' '>(SpacePad, sizeof(ZeroPad)), 3UL);
320 BOOST_CHECK_EQUAL(lpstrlen<' '>(SpacePad, 3), 2UL);
322}
323
325{
326 struct TOOLBOX_PACKED {
327 char data[8];
328 char canary;
329 } buf{};
330
331 auto clear = [&]() { memset(buf.data, '#', sizeof(buf.data) + 1); };
332
333 clear();
334 BOOST_CHECK_EQUAL(memcmp(buf.data, "########", sizeof(buf.data)), 0);
335 BOOST_CHECK_EQUAL(buf.canary, '#');
336
337 // Zero / C-String / Explicit Length.
338 clear();
339 BOOST_CHECK_EQUAL(lpstrcpy<'\0'>(buf.data, "foobar", sizeof(buf.data)), 6UL);
340 BOOST_CHECK_EQUAL(memcmp(buf.data, "\0\0foobar", sizeof(buf.data)), 0);
341 BOOST_CHECK_EQUAL(buf.canary, '#');
342
343 clear();
344 BOOST_CHECK_EQUAL(lpstrcpy<'\0'>(buf.data, "foobarbaz", sizeof(buf.data)), 8UL);
345 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
346 BOOST_CHECK_EQUAL(buf.canary, '#');
347
348 // Zero / C-String / Implied Length.
349 clear();
350 BOOST_CHECK_EQUAL(lpstrcpy<'\0'>(buf.data, "foobar"), 6UL);
351 BOOST_CHECK_EQUAL(memcmp(buf.data, "\0\0foobar", sizeof(buf.data)), 0);
352 BOOST_CHECK_EQUAL(buf.canary, '#');
353
354 clear();
355 BOOST_CHECK_EQUAL(lpstrcpy<'\0'>(buf.data, "foobarbaz"), 8UL);
356 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
357 BOOST_CHECK_EQUAL(buf.canary, '#');
358
359 // Zero / String View / Explicit Length.
360 clear();
361 BOOST_CHECK_EQUAL(lpstrcpy<'\0'>(buf.data, "foobar"sv, sizeof(buf.data)), 6UL);
362 BOOST_CHECK_EQUAL(memcmp(buf.data, "\0\0foobar", sizeof(buf.data)), 0);
363 BOOST_CHECK_EQUAL(buf.canary, '#');
364
365 clear();
366 BOOST_CHECK_EQUAL(lpstrcpy<'\0'>(buf.data, "foobarbaz"sv, sizeof(buf.data)), 8UL);
367 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
368 BOOST_CHECK_EQUAL(buf.canary, '#');
369
370 // Zero / String View / Implied Length.
371 clear();
372 BOOST_CHECK_EQUAL(lpstrcpy<'\0'>(buf.data, "foobar"sv), 6UL);
373 BOOST_CHECK_EQUAL(memcmp(buf.data, "\0\0foobar", sizeof(buf.data)), 0);
374 BOOST_CHECK_EQUAL(buf.canary, '#');
375
376 clear();
377 BOOST_CHECK_EQUAL(lpstrcpy<'\0'>(buf.data, "foobarbaz"sv), 8UL);
378 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
379 BOOST_CHECK_EQUAL(buf.canary, '#');
380
381 // Space / C-String / Explicit Length.
382 clear();
383 BOOST_CHECK_EQUAL(lpstrcpy<' '>(buf.data, "foobar", sizeof(buf.data)), 6UL);
384 BOOST_CHECK_EQUAL(memcmp(buf.data, " foobar", sizeof(buf.data)), 0);
385 BOOST_CHECK_EQUAL(buf.canary, '#');
386
387 clear();
388 BOOST_CHECK_EQUAL(lpstrcpy<' '>(buf.data, "foobarbaz", sizeof(buf.data)), 8UL);
389 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
390 BOOST_CHECK_EQUAL(buf.canary, '#');
391
392 // Space / C-String / Implied Length.
393 clear();
394 BOOST_CHECK_EQUAL(lpstrcpy<' '>(buf.data, "foobar"), 6UL);
395 BOOST_CHECK_EQUAL(memcmp(buf.data, " foobar", sizeof(buf.data)), 0);
396 BOOST_CHECK_EQUAL(buf.canary, '#');
397
398 clear();
399 BOOST_CHECK_EQUAL(lpstrcpy<' '>(buf.data, "foobarbaz"), 8UL);
400 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
401 BOOST_CHECK_EQUAL(buf.canary, '#');
402
403 // Space / String View / Explicit Length.
404 clear();
405 BOOST_CHECK_EQUAL(lpstrcpy<' '>(buf.data, "foobar"sv, sizeof(buf.data)), 6UL);
406 BOOST_CHECK_EQUAL(memcmp(buf.data, " foobar", sizeof(buf.data)), 0);
407 BOOST_CHECK_EQUAL(buf.canary, '#');
408
409 clear();
410 BOOST_CHECK_EQUAL(lpstrcpy<' '>(buf.data, "foobarbaz"sv, sizeof(buf.data)), 8UL);
411 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
412 BOOST_CHECK_EQUAL(buf.canary, '#');
413
414 // Space / String View / Implied Length.
415 clear();
416 BOOST_CHECK_EQUAL(lpstrcpy<' '>(buf.data, "foobar"sv), 6UL);
417 BOOST_CHECK_EQUAL(memcmp(buf.data, " foobar", sizeof(buf.data)), 0);
418 BOOST_CHECK_EQUAL(buf.canary, '#');
419
420 clear();
421 BOOST_CHECK_EQUAL(lpstrcpy<' '>(buf.data, "foobarbaz"sv), 8UL);
422 BOOST_CHECK_EQUAL(memcmp(buf.data, "foobarba", sizeof(buf.data)), 0);
423 BOOST_CHECK_EQUAL(buf.canary, '#');
424}
425
427{
428 auto res = make_string(1, 1.2, "foo");
429 BOOST_CHECK_EQUAL(res, "11.2foo");
430}
431
433{
438 std::filesystem::path("/toolbox"));
440 == std::filesystem::path("/toolbox"));
441}
442
#define TOOLBOX_PACKED
Definition Config.h:29
BOOST_CHECK_EQUAL(v.size(), 10U)
BOOST_AUTO_TEST_CASE(StringViewCase)
Definition String.ut.cpp:36
STL namespace.
ostream & operator<<(ostream &os, const pair< T, U > &p)
Definition Parser.ut.cpp:29
const DataT & data(const MsgEvent &ev) noexcept
Definition Event.hpp:54
void clear(timeval &tv) noexcept
Definition Time.hpp:294
std::string to_string(ValueT &&val)
Definition String.hpp:54
pair< string_view, string_view > split_pair(string_view s, char delim) noexcept
Definition String.cpp:51
constexpr std::size_t lpstrlen(const char *src, std::size_t n) noexcept
Definition String.hpp:268
std::string make_string(ArgsT &&... args)
Definition String.hpp:351
std::string_view ltrim_copy(std::string_view s) noexcept
Definition String.hpp:96
std::string_view rtrim_copy(std::string_view s) noexcept
Definition String.hpp:108
constexpr std::size_t pstrlen(const char *src, std::size_t n) noexcept
Definition String.hpp:143
std::string_view sv
Definition Tokeniser.hpp:26
std::string_view trim_copy(std::string_view s) noexcept
Definition String.hpp:120
constexpr std::size_t pstrcpy(char *dst, const char *src, std::size_t n) noexcept
Definition String.hpp:175
constexpr std::size_t pstrcpyid(char *dst, std::int64_t id, std::size_t n) noexcept
Definition String.hpp:243
constexpr std::size_t lpstrcpy(char *dst, const char *src, std::size_t n) noexcept
Definition String.hpp:295
double stod(std::string_view sv, double dfl) noexcept
Definition Utility.cpp:89
constexpr auto bind() noexcept
Definition Slot.hpp:92
BOOST_CHECK(isnan(stod(""sv, numeric_limits< double >::quiet_NaN())))