MCPcopy Create free account
hub / github.com/apache/trafficserver / string

Class string

include/cripts/Lulu.hpp:282–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}; // End class cripts::StringViewMixin
281
282class string : public std::string
283{
284 using super_type = std::string;
285 using self_type = string;
286
287public:
288 using std::string::string;
289
290 // ToDo: This broke when switching to swoc::TextView
291 // using std::string::operator cripts::string_view;
292 using super_type::operator+=;
293 using super_type::operator[];
294
295 self_type &
296 operator=(const self_type &str)
297 {
298 super_type::operator=(str);
299 return *this;
300 }
301
302 self_type &
303 operator=(const cripts::string_view &str)
304 {
305 super_type::operator=(str);
306 return *this;
307 }
308
309 self_type &
310 operator=(const char *str)
311 {
312 super_type::operator=(str);
313 return *this;
314 }
315
316 string(const self_type &that) : super_type(that) {}
317
318 // This allows for a std::string to be moved to a cripts::string
319 string(super_type &&that) : super_type(std::move(that)) {}
320 string(self_type &&that) noexcept : super_type(that) {}
321
322 operator cripts::string_view() const { return {this->c_str(), this->size()}; }
323
324 // Make sure to keep these updated with C++20 ...
325 self_type &
326 ltrim(char c = ' ')
327 {
328 this->erase(0, this->find_first_not_of(c));
329 return *this;
330 }
331
332 self_type &
333 rtrim(char c = ' ')
334 {
335 this->erase(this->find_last_not_of(c) + 1);
336 return *this;
337 }
338
339 self_type &

Callers 15

dump_contextFunction · 0.85
TSPluginInitFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85
TEST_FFunction · 0.85
TESTFunction · 0.85
StrFunction · 0.85
EscapeFunction · 0.85
TokenClass · 0.85
ScanScalarFunction · 0.85

Calls 3

c_strMethod · 0.45
sizeMethod · 0.45
eraseMethod · 0.45

Tested by 15

TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TEST_FFunction · 0.68
TESTFunction · 0.68
messageMethod · 0.68
getHostStatusMethod · 0.68
setHostStatusMethod · 0.68
get_long_stringFunction · 0.68
mkunsigned_stringFunction · 0.68
testFormatMethod · 0.68