summaryrefslogtreecommitdiff
path: root/src/string.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-07-14 13:47:51 +0100
committerMaxime Coste <frrrwww@gmail.com>2015-07-14 13:47:51 +0100
commitf87dbe410ff95a373e58e514c11171364352c826 (patch)
treeda1704a83a6f8d6935bec8ad6bdd935229e85194 /src/string.cc
parentc1b9ea4d1e53ba085f3125dc87c2b7a7f0c84e51 (diff)
Add missing support for Codepoint in format
Diffstat (limited to 'src/string.cc')
-rw-r--r--src/string.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/string.cc b/src/string.cc
index 2ed77156..e4b5c0e2 100644
--- a/src/string.cc
+++ b/src/string.cc
@@ -151,6 +151,15 @@ InplaceString<24> to_string(float val)
return res;
}
+InplaceString<8> to_string(Codepoint c)
+{
+ InplaceString<8> res;
+ char* ptr = res.m_data;
+ utf8::dump(ptr, c);
+ res.m_length = (int)(ptr - res.m_data);
+ return res;
+}
+
bool subsequence_match(StringView str, StringView subseq)
{
auto it = str.begin();