From f96f9ef5a878aa8a580f0a71b84693bbd9447b25 Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Sun, 22 Sep 2013 22:36:48 -0700 Subject: [PATCH] Added string append. --- include/tinystl/string.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/tinystl/string.h b/include/tinystl/string.h index 9bccc09..c878531 100644 --- a/include/tinystl/string.h +++ b/include/tinystl/string.h @@ -50,6 +50,7 @@ namespace tinystl { void resize(size_t size); void append(const char* first, const char* last); + void append(const char* str); void swap(string& other); @@ -156,6 +157,10 @@ namespace tinystl { *m_last = 0; } + inline void string::append(const char* str) { + append(str, str + strlen(str) ); + } + inline void string::swap(string& other) { const pointer tfirst = m_first, tlast = m_last, tcapacity = m_capacity; m_first = other.m_first, m_last = other.m_last, m_capacity = other.m_capacity;