String
This commit is contained in:
@@ -145,6 +145,17 @@ void c_StringBuffer_Clear(c_StringBuffer_t* self) {
|
||||
|
||||
/* --- Explicit String-Wrapper Interfaces --- */
|
||||
|
||||
c_err_t c_StringBuffer_PopBack(c_StringBuffer_t* self) {
|
||||
if (!self) return C_ERR_PARAM;
|
||||
if (self->size == 0) return C_ERR_EMPTY;
|
||||
return c_StringBuffer_RemoveAt(self, self->size-1, 1);
|
||||
}
|
||||
|
||||
c_err_t c_StringBuffer_AppendChar(c_StringBuffer_t* self, char ch) {
|
||||
if (!self || !self->buffer) return C_ERR_PARAM;
|
||||
return c_StringBuffer_Append(self, (char*)&ch, 1);
|
||||
}
|
||||
|
||||
c_err_t c_StringBuffer_AppendStr(c_StringBuffer_t* self, const char* string) {
|
||||
if (!string) return C_ERR_PARAM;
|
||||
return c_StringBuffer_Append(self, string, strlen(string));
|
||||
|
||||
Reference in New Issue
Block a user