ds: string: add function to copy string data from a b_stringstream

unlike b_stringstream_ptr(), this function supports copying strings
that contain null bytes.
This commit is contained in:
2025-10-25 00:04:38 +01:00
parent 7afc398f68
commit a1b177a5a1
2 changed files with 25 additions and 0 deletions

View File

@@ -5,6 +5,7 @@
#include <blue/core/iterator.h>
#include <blue/core/macros.h>
#include <blue/core/status.h>
#include <blue/core/stringstream.h>
#include <ctype.h>
B_DECLS_BEGIN;
@@ -70,6 +71,8 @@ BLUE_API b_status b_string_reserve(b_string *str, size_t capacity);
BLUE_API b_status b_string_replace(
b_string *str, size_t start, size_t length, const char *new_data);
BLUE_API b_status b_string_replace_all(b_string *str, const char *new_data);
BLUE_API b_status b_string_replace_all_with_stringstream(
b_string *str, const b_stringstream *new_data);
BLUE_API b_status b_string_remove(b_string *str, size_t start, size_t length);
BLUE_API b_status b_string_transform(b_string *str, int (*transformer)(int));
BLUE_API b_status b_string_trim(b_string *str);