mirror of
https://github.com/ksherlock/ample.git
synced 2024-11-19 02:11:08 +00:00
57a7e24d21
also log path/working directory to the log window.
43 lines
1.2 KiB
Objective-C
43 lines
1.2 KiB
Objective-C
//
|
|
// Ample.m
|
|
// Ample
|
|
//
|
|
// Created by Kelvin Sherlock on 9/1/2020.
|
|
// Copyright © 2020 Kelvin Sherlock. All rights reserved.
|
|
//
|
|
|
|
#include "Ample.h"
|
|
|
|
NSURL *SupportDirectory(void) {
|
|
static NSURL *cached = nil;
|
|
|
|
if (!cached) {
|
|
NSFileManager *fm = [NSFileManager defaultManager];
|
|
NSError *error = nil;
|
|
|
|
NSURL *url = [fm URLForDirectory: NSApplicationSupportDirectory inDomain: NSUserDomainMask appropriateForURL: nil create: YES error: &error];
|
|
cached = [url URLByAppendingPathComponent: @"Ample"];
|
|
|
|
[fm createDirectoryAtURL: cached withIntermediateDirectories: YES attributes: nil error: &error];
|
|
}
|
|
return cached;
|
|
|
|
}
|
|
|
|
NSString *SupportDirectoryPath(void) {
|
|
static NSString *cached = nil;
|
|
|
|
if (!cached) {
|
|
NSURL *url = SupportDirectory();
|
|
cached = [NSString stringWithCString: [url fileSystemRepresentation] encoding: NSUTF8StringEncoding];
|
|
}
|
|
return cached;
|
|
}
|
|
|
|
|
|
NSString *kUseCustomMame = @"UseCustomMame";
|
|
NSString *kMamePath = @"MamePath";
|
|
NSString *kMameWorkingDirectory = @"MameWorkingDirectory";
|
|
NSString *kAutoCloseLogWindow = @"AutoCloseLogWindow";
|
|
NSString *kMameComponentsDate = @"MameComponentsDate";
|