#include "StringBuilder.h" void StringBuilder::append(const char* s) { char* tail = buffer + length; strncpy(tail, s, capacity - length); length += strlen(tail); } void StringBuilder::appendEscaped(const char* s) { if (length > capacity - 3) return; buffer[length++] = '"'; // keep one slot for the end quote capacity--; while (*s && length