Is there a way to get OS (Windows or OSX) user as a std::string?

I want to add some functionality in my plugin but only if it is launched on my computer and I am logged in.

So is there a way to get OS (Windows or OSX) user as a string in the audio plugin?
Is there any macro or anything that contains such info?

Best Regards

SystemStats:: getOperatingSystemName()

String:: toStdString()


1 Like

You are asking specifically for your USER NAME, right? Which would mean your special features would be enabled if by chance any other user out there would have the same user name as you?

Not sure if this is a good design. Since you have full access to your code, I‘d rather consider a separate build target for your special version that enables the features of interest via a macro only set for that exporter target. Or enable features depending on a preference file that only exists on your machine

1 Like

Not sure if this is a good design

I will consider that. Now I am on experimenting stage. But thanks for your advice.

I just like to check for the existence of some special file (say, EnableSpecialFeature.txt) on your system to enable special features at runtime.

1 Like