mirror of
https://github.com/SerenityOS/serenity
synced 2024-11-05 17:46:52 +00:00
0dc9af5f7e
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
32 lines
568 B
C++
32 lines
568 B
C++
#pragma once
|
|
|
|
#include "AKString.h"
|
|
#include "Vector.h"
|
|
#include <LibC/stdarg.h>
|
|
|
|
namespace AK {
|
|
|
|
class StringBuilder {
|
|
public:
|
|
explicit StringBuilder(ssize_t initial_capacity = 16);
|
|
~StringBuilder() {}
|
|
|
|
void append(const String&);
|
|
void append(char);
|
|
void append(const char*, ssize_t);
|
|
void appendf(const char*, ...);
|
|
void appendvf(const char*, va_list);
|
|
|
|
String to_string();
|
|
ByteBuffer to_byte_buffer();
|
|
|
|
private:
|
|
void will_append(ssize_t);
|
|
|
|
ByteBuffer m_buffer;
|
|
ssize_t m_length { 0 };
|
|
};
|
|
|
|
}
|
|
|
|
using AK::StringBuilder;
|