Kernel: Add an error propagating KString::number() API

This is simply a thin wrapper around the already existing
KString::formatted() API.
This commit is contained in:
Idan Horowitz 2022-01-11 21:03:33 +02:00
parent 809870d519
commit aa1f7060af
Notes: sideshowbarker 2024-07-17 21:04:18 +09:00

View file

@ -30,6 +30,11 @@ public:
return vformatted(fmtstr.view(), variadic_format_parameters);
}
[[nodiscard]] static ErrorOr<NonnullOwnPtr<KString>> number(Arithmetic auto value)
{
return formatted("{}", value);
}
void operator delete(void*);
ErrorOr<NonnullOwnPtr<KString>> try_clone() const;