summaryrefslogtreecommitdiff
path: root/AK/StringBuilder.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-10-10 11:53:07 +0200
committerAndreas Kling <awesomekling@gmail.com>2018-10-10 11:53:07 +0200
commit5a300551574451fbf509685d11095bda4fcb20be (patch)
tree7bd68b5b0bc9daab6899be52dc694b7162dc6b89 /AK/StringBuilder.cpp
downloadserenity-5a300551574451fbf509685d11095bda4fcb20be.zip
Import all this stuff into a single repo called Serenity.
Diffstat (limited to 'AK/StringBuilder.cpp')
-rw-r--r--AK/StringBuilder.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/AK/StringBuilder.cpp b/AK/StringBuilder.cpp
new file mode 100644
index 0000000000..77677217da
--- /dev/null
+++ b/AK/StringBuilder.cpp
@@ -0,0 +1,25 @@
+#include "StringBuilder.h"
+
+namespace AK {
+
+void StringBuilder::append(String&& str)
+{
+ m_strings.append(std::move(str));
+}
+
+void StringBuilder::append(char ch)
+{
+ m_strings.append(StringImpl::create(&ch, 1));
+}
+
+String StringBuilder::build()
+{
+ auto strings = std::move(m_strings);
+ if (strings.isEmpty())
+ return String::empty();
+
+ return String();
+}
+
+}
+