summaryrefslogtreecommitdiffstats
path: root/base/mac_util.mm
diff options
context:
space:
mode:
Diffstat (limited to 'base/mac_util.mm')
-rw-r--r--base/mac_util.mm14
1 files changed, 12 insertions, 2 deletions
diff --git a/base/mac_util.mm b/base/mac_util.mm
index f4e988a..4e6b105 100644
--- a/base/mac_util.mm
+++ b/base/mac_util.mm
@@ -219,10 +219,12 @@ OSType CreatorCodeForApplication() {
return CreatorCodeForCFBundleRef(bundle);
}
-bool GetUserDirectory(NSSearchPathDirectory directory, FilePath* result) {
+bool GetSearchPathDirectory(NSSearchPathDirectory directory,
+ NSSearchPathDomainMask domain_mask,
+ FilePath* result) {
DCHECK(result);
NSArray* dirs =
- NSSearchPathForDirectoriesInDomains(directory, NSUserDomainMask, YES);
+ NSSearchPathForDirectoriesInDomains(directory, domain_mask, YES);
if ([dirs count] < 1) {
return false;
}
@@ -231,6 +233,14 @@ bool GetUserDirectory(NSSearchPathDirectory directory, FilePath* result) {
return true;
}
+bool GetLocalDirectory(NSSearchPathDirectory directory, FilePath* result) {
+ return GetSearchPathDirectory(directory, NSLocalDomainMask, result);
+}
+
+bool GetUserDirectory(NSSearchPathDirectory directory, FilePath* result) {
+ return GetSearchPathDirectory(directory, NSUserDomainMask, result);
+}
+
FilePath GetUserLibraryPath() {
FilePath user_library_path;
if (!GetUserDirectory(NSLibraryDirectory, &user_library_path)) {