view src/sys/osx/filesystem.mm @ 181:d26cd2c00270

dep/animia/fd/proc: use constexpr std::string_view for proc location this is probably a little slower, but it works Well Enough for what we need it for
author Paper <mrpapersonic@gmail.com>
date Mon, 04 Dec 2023 12:14:30 -0500
parents 9c4645100fec
children
line wrap: on
line source

#include "sys/osx/filesystem.h"

#include <string>

#import <Foundation/Foundation.h>

namespace osx {

std::string GetApplicationSupportDirectory() {
	NSArray* strings = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, true);
	if (!strings || [strings count] < 1)
		return ""; // ack

	return [[strings objectAtIndex:0] UTF8String];
}

} // namespace osx