annotate src/sys/osx/filesystem.mm @ 187:9613d72b097e

*: multiple performance improvements like marking `static const` when it makes sense... date: change old stupid heap-based method to a structure which should make copying the thing actually make a copy. also many performance-based changes, like removing the std::tie dependency and forward-declaring nlohmann json *: replace every instance of QString::fromUtf8 to Strings::ToQString. the main difference is that our function will always convert exactly what is in the string, while some other times it would only convert up to the nearest NUL byte
author Paper <mrpapersonic@gmail.com>
date Wed, 06 Dec 2023 13:43:54 -0500
parents 9c4645100fec
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3 #include <string>
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
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
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 namespace osx {
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 std::string GetApplicationSupportDirectory() {
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
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
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15 }
51ae25154b70 Fix OS X support code
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16
15
cde8f67a7c7d *: update, megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
17 } // namespace osx