2025-10-24 12:32:54 +01:00
|
|
|
#ifndef BLUE_CORE_STRINGSTREAM_H_
|
|
|
|
|
#define BLUE_CORE_STRINGSTREAM_H_
|
2024-08-03 07:54:28 +01:00
|
|
|
|
2025-10-24 12:32:54 +01:00
|
|
|
#include <blue/core/macros.h>
|
2024-11-14 16:56:12 +00:00
|
|
|
#include <blue/core/misc.h>
|
2025-06-27 21:42:53 +01:00
|
|
|
#include <blue/core/status.h>
|
|
|
|
|
#include <blue/core/stream.h>
|
2024-08-03 07:54:28 +01:00
|
|
|
#include <stddef.h>
|
|
|
|
|
|
2025-10-24 12:32:54 +01:00
|
|
|
B_DECLS_BEGIN;
|
2024-08-03 07:54:28 +01:00
|
|
|
|
2025-10-24 12:32:54 +01:00
|
|
|
#define B_TYPE_STRINGSTREAM (b_stringstream_get_type())
|
|
|
|
|
|
|
|
|
|
B_DECLARE_TYPE(b_stringstream);
|
|
|
|
|
|
|
|
|
|
B_TYPE_CLASS_DECLARATION_BEGIN(b_stringstream)
|
|
|
|
|
B_TYPE_CLASS_DECLARATION_END(b_stringstream)
|
|
|
|
|
|
|
|
|
|
BLUE_API b_type b_stringstream_get_type(void);
|
|
|
|
|
|
|
|
|
|
BLUE_API b_stringstream *b_stringstream_create(void);
|
|
|
|
|
BLUE_API b_stringstream *b_stringstream_create_with_buffer(char *buf, size_t max);
|
|
|
|
|
|
|
|
|
|
BLUE_API b_status b_stringstream_reset(b_stringstream *strv);
|
|
|
|
|
BLUE_API b_status b_stringstream_reset_with_buffer(
|
|
|
|
|
b_stringstream *strv, char *buf, size_t max);
|
|
|
|
|
|
|
|
|
|
BLUE_API const char *b_stringstream_ptr(const b_stringstream *strv);
|
|
|
|
|
BLUE_API char *b_stringstream_steal(b_stringstream *strv);
|
2024-08-03 07:54:28 +01:00
|
|
|
|
2025-06-27 21:42:53 +01:00
|
|
|
BLUE_API size_t b_stringstream_get_length(const b_stringstream *strv);
|
|
|
|
|
|
2025-10-24 12:32:54 +01:00
|
|
|
#if 0
|
2024-11-14 16:56:12 +00:00
|
|
|
BLUE_API void b_stringstream_push_indent(b_stringstream *strv, int indent);
|
|
|
|
|
BLUE_API void b_stringstream_pop_indent(b_stringstream *strv);
|
2024-10-24 19:24:54 +01:00
|
|
|
|
2024-11-14 16:56:12 +00:00
|
|
|
BLUE_API b_status b_stringstream_add(b_stringstream *strv, const char *str);
|
|
|
|
|
BLUE_API b_status b_stringstream_addf(b_stringstream *strv, const char *format, ...);
|
|
|
|
|
BLUE_API b_status b_stringstream_addv(b_stringstream *strv, const char **strs);
|
2025-07-28 22:14:34 +01:00
|
|
|
BLUE_API b_status b_stringstream_addvf(
|
|
|
|
|
b_stringstream *strv, const char *format, va_list arg);
|
2024-11-14 16:56:12 +00:00
|
|
|
BLUE_API b_status b_stringstream_addvl(
|
2024-10-24 19:24:54 +01:00
|
|
|
b_stringstream *strv, const char **strs, size_t count);
|
2024-11-14 16:56:12 +00:00
|
|
|
BLUE_API b_status b_stringstream_add_many(b_stringstream *strv, ...);
|
2025-10-24 12:32:54 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
B_DECLS_END;
|
2024-08-03 07:54:28 +01:00
|
|
|
|
|
|
|
|
#endif
|