diff --git a/BAN/include/BAN/String.h b/BAN/include/BAN/String.h index 797da03a92..1782dd9b77 100644 --- a/BAN/include/BAN/String.h +++ b/BAN/include/BAN/String.h @@ -20,6 +20,9 @@ namespace BAN String(const char*, size_type = -1); ~String(); + template + static String Formatted(const char* format, const Args&... args); + String& operator=(const String&); String& operator=(String&&); @@ -63,6 +66,14 @@ namespace BAN size_type m_size = 0; }; + template + String String::Formatted(const char* format, const Args&... args) + { + String result; + BAN::Formatter::print([&](char c){ result.PushBack(c); }, format, args...); + return result; + } + } namespace BAN::Formatter