开始设计

This commit is contained in:
2026-08-10 01:21:15 +08:00
commit e45398991f
228 changed files with 20827 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
#ifndef INCLUDED_C_STRINGBUFFER_H
#define INCLUDED_C_STRINGBUFFER_H
#ifndef INCLUDED_C_BASE_H
#include <c_Base.h>
#endif /*INCLUDED_C_BASE_H*/
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
typedef struct {
char* buffer;
c_size_t capacity;
c_size_t size;
}c_StringBuffer_t;
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
c_err_t c_StringBuffer_Init(c_StringBuffer_t* self, c_size_t capacity);
void c_StringBuffer_Destroy(c_StringBuffer_t* self);
c_err_t c_StringBuffer_Append(c_StringBuffer_t* self, const char* string, c_size_t length);
c_err_t c_StringBuffer_Prepend(c_StringBuffer_t* self, const char* string, c_size_t length);
c_err_t c_StringBuffer_InsertAt(c_StringBuffer_t* self, c_size_t index, const char* string, c_size_t length);
c_err_t c_StringBuffer_RemoveAt(c_StringBuffer_t* self, c_size_t index, c_size_t length);
void c_StringBuffer_Clear(c_StringBuffer_t* self);
c_err_t c_StringBuffer_AppendStr(c_StringBuffer_t* self, const char* string);
c_err_t c_StringBuffer_PrependStr(c_StringBuffer_t* self, const char* string);
c_err_t c_StringBuffer_InsertStrAt(c_StringBuffer_t* self, const char* string, c_size_t index);
c_err_t c_StringBuffer_CopyTo(c_StringBuffer_t* self, c_size_t index, c_size_t length, char* buffer, c_size_t buffer_length);
#endif /*INCLUDED_C_STRINGBUFFER_H*/