From 39458ea56f19188f4437955ff489c6fbdf0b61df Mon Sep 17 00:00:00 2001 From: assiduous Date: Mon, 20 Nov 2023 11:20:26 -0800 Subject: [PATCH] Added GetMemorySizeString function --- Primitives/interface/FormatString.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Primitives/interface/FormatString.hpp b/Primitives/interface/FormatString.hpp index 8dda1925c..d3586eff6 100644 --- a/Primitives/interface/FormatString.hpp +++ b/Primitives/interface/FormatString.hpp @@ -107,6 +107,14 @@ StreamType& operator<<(StreamType& Stream, const MemorySizeFormatter& Arg) return Stream; } +template +std::string GetMemorySizeString(Type _size, int _precision = 0, Type _ref_size = 0) +{ + std::stringstream ss; + ss << FormatMemorySize(_size, _precision, _ref_size); + return ss.str(); +} + namespace TextColorCode { static constexpr char Default[] = "\033[39m";