Mercurial > minori
annotate src/sys/osx/filesystem.mm @ 179:9c4645100fec
osx: clean up includes, we do not need cocoa
what we *do* need is the very basics that animia already depends on anyway.
these are basically guaranteed to be on any macos system, making it fairly portable
now... I haven't tested this :) I don't have a macos machine right now...
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 04 Dec 2023 12:03:36 -0500 |
parents | cde8f67a7c7d |
children |
rev | line source |
---|---|
179
9c4645100fec
osx: clean up includes, we do not need cocoa
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
1 #include "sys/osx/filesystem.h" |
9c4645100fec
osx: clean up includes, we do not need cocoa
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
2 |
5 | 3 #include <string> |
4 | |
179
9c4645100fec
osx: clean up includes, we do not need cocoa
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
5 #import <Foundation/Foundation.h> |
9c4645100fec
osx: clean up includes, we do not need cocoa
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
6 |
5 | 7 namespace osx { |
8 | |
9 std::string GetApplicationSupportDirectory() { | |
15 | 10 NSArray* strings = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, true); |
179
9c4645100fec
osx: clean up includes, we do not need cocoa
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
11 if (!strings || [strings count] < 1) |
9c4645100fec
osx: clean up includes, we do not need cocoa
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
12 return ""; // ack |
9c4645100fec
osx: clean up includes, we do not need cocoa
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
13 |
9c4645100fec
osx: clean up includes, we do not need cocoa
Paper <mrpapersonic@gmail.com>
parents:
15
diff
changeset
|
14 return [[strings objectAtIndex:0] UTF8String]; |
5 | 15 } |
16 | |
15 | 17 } // namespace osx |