Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
wmem_strbuf.h File Reference
#include <ws_codepoints.h>
#include "wmem_core.h"

Go to the source code of this file.

Classes

struct  _wmem_strbuf_t
 Internal structure representing a wmem-allocated string buffer. More...
 

Macros

#define wmem_strbuf_create(allocator)    wmem_strbuf_new(allocator, "")
 Create a new wmem string buffer initialized with an empty string.
 
#define wmem_strbuf_append_unichar_repl(buf)    wmem_strbuf_append_unichar(buf, UNICODE_REPLACEMENT_CHARACTER)
 Append the Unicode replacement character (U+FFFD) to a wmem string buffer.
 

Typedefs

typedef struct _wmem_strbuf_t wmem_strbuf_t
 

Functions

WS_DLL_PUBLIC wmem_strbuf_twmem_strbuf_new_sized (wmem_allocator_t *allocator, size_t alloc_size) G_GNUC_MALLOC
 Create a new string buffer with a specified initial allocation size.
 
WS_DLL_PUBLIC wmem_strbuf_twmem_strbuf_new (wmem_allocator_t *allocator, const char *str) G_GNUC_MALLOC
 Create a new string buffer initialized with a copy of the given string.
 
WS_DLL_PUBLIC wmem_strbuf_twmem_strbuf_new_len (wmem_allocator_t *allocator, const char *str, size_t len) G_GNUC_MALLOC
 Create a new string buffer initialized with a substring of specified length.
 
WS_DLL_PUBLIC wmem_strbuf_twmem_strbuf_dup (wmem_allocator_t *allocator, const wmem_strbuf_t *strbuf) G_GNUC_MALLOC
 Duplicate an existing string buffer using the specified memory allocator.
 
WS_DLL_PUBLIC void wmem_strbuf_append (wmem_strbuf_t *strbuf, const char *str)
 Append a null-terminated string to the end of a string buffer.
 
WS_DLL_PUBLIC void wmem_strbuf_append_len (wmem_strbuf_t *strbuf, const char *str, size_t append_len)
 Append a specified number of bytes from a string to a string buffer.
 
WS_DLL_PUBLIC void wmem_strbuf_append_printf (wmem_strbuf_t *strbuf, const char *format,...) G_GNUC_PRINTF(2
 Append formatted text to a string buffer.
 
WS_DLL_PUBLIC void WS_DLL_PUBLIC void wmem_strbuf_append_vprintf (wmem_strbuf_t *strbuf, const char *fmt, va_list ap)
 Append formatted text to a string buffer using a va_list.
 
WS_DLL_PUBLIC void wmem_strbuf_append_c (wmem_strbuf_t *strbuf, const char c)
 Append a single character to a string buffer.
 
WS_DLL_PUBLIC void wmem_strbuf_append_c_count (wmem_strbuf_t *strbuf, const char c, size_t count)
 Append a character to a string buffer multiple times.
 
WS_DLL_PUBLIC void wmem_strbuf_append_unichar (wmem_strbuf_t *strbuf, const gunichar c)
 Append a Unicode character to a string buffer.
 
WS_DLL_PUBLIC void wmem_strbuf_append_unichar_validated (wmem_strbuf_t *strbuf, const gunichar c)
 Append a validated Unicode character to a string buffer.
 
WS_DLL_PUBLIC void wmem_strbuf_append_hex (wmem_strbuf_t *strbuf, uint8_t ch)
 Append a hexadecimal representation of a byte to a wmem string buffer.
 
WS_DLL_PUBLIC size_t wmem_strbuf_append_hex_unichar (wmem_strbuf_t *strbuf, gunichar ch)
 Append a hexadecimal representation of a Unicode character to a wmem string buffer.
 
WS_DLL_PUBLIC void wmem_strbuf_truncate (wmem_strbuf_t *strbuf, const size_t len)
 Truncate a wmem string buffer to a specified length.
 
WS_DLL_PUBLIC const char * wmem_strbuf_get_str (const wmem_strbuf_t *strbuf)
 Retrieve the current string content from a wmem string buffer.
 
WS_DLL_PUBLIC size_t wmem_strbuf_get_len (const wmem_strbuf_t *strbuf)
 Retrieve the current length of a wmem string buffer.
 
WS_DLL_PUBLIC int wmem_strbuf_strcmp (const wmem_strbuf_t *sb1, const wmem_strbuf_t *sb2)
 Compare the contents of two wmem string buffers.
 
WS_DLL_PUBLIC const char * wmem_strbuf_strstr (const wmem_strbuf_t *haystack, const wmem_strbuf_t *needle)
 Search for a substring within a wmem string buffer.
 
WS_DLL_PUBLIC char * wmem_strbuf_finalize (wmem_strbuf_t *strbuf)
 Finalize a wmem string buffer and extract its raw string.
 
WS_DLL_PUBLIC void wmem_strbuf_destroy (wmem_strbuf_t *strbuf)
 Destroy a wmem string buffer and release its associated memory.
 
WS_DLL_PUBLIC bool wmem_strbuf_utf8_validate (wmem_strbuf_t *strbuf, const char **endptr)
 Validate the contents of a wmem string buffer as UTF-8.
 
WS_DLL_PUBLIC void wmem_strbuf_utf8_make_valid (wmem_strbuf_t *strbuf)
 Ensure the contents of a wmem string buffer are valid UTF-8.
 

Detailed Description

Definitions for the Wireshark Memory Manager String Buffer Copyright 2012, Evan Huus eapac.nosp@m.he@g.nosp@m.mail..nosp@m.com

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later