4#include "Stroika/Foundation/StroikaPreComp.h"
6#include "Stroika/Foundation/Debug/Demangle.h"
7#include "Stroika/Foundation/Execution/Exceptions.h"
20String Characters::ToStringDefaults::ToString (
const exception_ptr& e)
22 static const String kExceptPrefix_{
"Exception: "sv};
23 static const String kUnknown_{
"Unknown Exception"sv};
28 rethrow_exception (e);
35 catch (
const exception& e) {
36 return kExceptPrefix_ + String::FromNarrowSDKString (e.what ());
44String Characters::ToStringDefaults::ToString (
const std::exception& t)
49 return String::FromNarrowSDKString (t.what ());
52String Characters::ToStringDefaults::ToString (
const type_info& t)
55 return Debug::Demangle (String::FromNarrowSDKString (t.name ()));
58String Characters::ToStringDefaults::ToString (
const type_index& t)
61 return Debug::Demangle (String::FromNarrowSDKString (t.name ()));
64String Characters::ToStringDefaults::ToString (
const thread::id& t)
66 return String{Execution::Thread::FormatThreadID_A (t)};
69String Characters::ToStringDefaults::ToString (
bool t)
71 static const String kTrue_{
"true"sv};
72 static const String kFalse{
"false"sv};
73 return t ? kTrue_ : kFalse;
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Duration is a chrono::duration<double> (=.