4#include "Stroika/Foundation/StroikaPreComp.h"
6#if qStroika_Foundation_Common_Platform_Windows
10#include "Stroika/Foundation/Characters/SDKChar.h"
11#if qStroika_Foundation_Common_Platform_Windows
12#include "Stroika/Foundation/Execution/Platform/Windows/Exception.h"
16#if qStroika_Foundation_Common_Platform_POSIX
17#include "Platform/POSIX/Users.h"
33String Execution::GetCurrentUserName ([[maybe_unused]] UserNameFormat format)
35#if qStroika_Foundation_Common_Platform_Windows && 0
36 EXTENDED_NAME_FORMAT useFormat = NameDisplay;
38 ::GetUserNameEx (useFormat,
nullptr, &sz);
39 StackBuffer<Characters::SDKChar> buf{Memory::eUninitialized, sz + 1};
40 Execution::ThrowIfZeroGetLastError (::GetUserNameEx (useFormat, buf, &sz));
41 return String::FromSDKString (buf);
42#elif qStroika_Foundation_Common_Platform_Windows
44 ::GetUserName (
nullptr, &sz);
45 StackBuffer<Characters::SDKChar> buf{Memory::eUninitialized, sz + 1};
47 return String::FromSDKString (buf);
48#elif qStroika_Foundation_Common_Platform_POSIX
49 return Platform::POSIX::uid_t2UserName (Platform::POSIX::GetUID ());
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Logically halfway between std::array and std::vector; Smart 'direct memory array' - which when needed...