Add ToStdString and ToStdStringView to ZeekString

This commit is contained in:
Tim Wojtulewicz 2025-05-29 13:50:15 -07:00
parent f96ce6727f
commit d570486f36
3 changed files with 17 additions and 4 deletions

View file

@ -91,6 +91,17 @@ public:
*/
std::pair<const char*, size_t> CheckStringWithSize() const;
/**
* Returns the string data as a std::string. This makes a copy of the
* string data.
*/
std::string ToStdString() const;
/**
* Returns the string data as a std::string_view.
*/
std::string_view ToStdStringView() const;
enum render_style {
ESC_NONE = 0,
ESC_ESC = (1 << 1), // '\' -> "\\"