summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-11 18:58:33 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-11 18:58:33 +0200
commit5cd04a6ad835a2349a8ed2947cfb10f76a86d70d (patch)
treee14ecddfeb192d43191ae14bfe696d466fc8b612 /AK
parentae060d74500877b1d1432f438de0103d435d3b95 (diff)
downloadserenity-5cd04a6ad835a2349a8ed2947cfb10f76a86d70d.zip
AK: Add String::number(size_t) overload
Diffstat (limited to 'AK')
-rw-r--r--AK/String.cpp5
-rwxr-xr-xAK/String.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/AK/String.cpp b/AK/String.cpp
index 63cef36cdb..df8005bd85 100644
--- a/AK/String.cpp
+++ b/AK/String.cpp
@@ -184,6 +184,11 @@ unsigned String::to_uint(bool& ok) const
return value;
}
+String String::number(size_t value)
+{
+ return String::format("%zu", value);
+}
+
String String::number(unsigned value)
{
return String::format("%u", value);
diff --git a/AK/String.h b/AK/String.h
index 0325f3831d..2b299841b9 100755
--- a/AK/String.h
+++ b/AK/String.h
@@ -194,6 +194,7 @@ public:
}
static String format(const char*, ...);
+ static String number(size_t);
static String number(unsigned);
static String number(int);