Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
acc53a1c
Commit
acc53a1c
authored
12 years ago
by
Aura Linden
Browse files
Options
Downloads
Patches
Plain Diff
New VFS objects included in every bite!
parent
eca61998
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llvfs/llvfs_objc.h
+43
-0
43 additions, 0 deletions
indra/llvfs/llvfs_objc.h
indra/llvfs/llvfs_objc.mm
+93
-0
93 additions, 0 deletions
indra/llvfs/llvfs_objc.mm
with
136 additions
and
0 deletions
indra/llvfs/llvfs_objc.h
0 → 100644
+
43
−
0
View file @
acc53a1c
/**
* @file llvfs_objc.h
* @brief Definition of directory utilities class for Mac OS X
*
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#if !LL_DARWIN
#error This header must not be included when compiling for any target other than Mac OS. Consider including lldir.h instead.
#endif // !LL_DARWIN
#ifndef LL_LLVFS_OBJC_H
#define LL_LLVFS_OBJC_H
#include
<iostream>
std
::
string
*
getSystemTempFolder
();
std
::
string
*
getSystemCacheFolder
();
std
::
string
*
getSystemApplicationSupportFolder
();
std
::
string
*
getSystemResourceFolder
();
std
::
string
*
getSystemExecutableFolder
();
#endif LL_LLVFS_OBJC_H
This diff is collapsed.
Click to expand it.
indra/llvfs/llvfs_objc.mm
0 → 100644
+
93
−
0
View file @
acc53a1c
/**
* @file llvfs_objc.cpp
* @brief Cocoa implementation of directory utilities for Mac OS X
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#if LL_DARWIN
//WARNING: This file CANNOT use standard linden includes due to conflicts between definitions of BOOL
#include
"llvfs_objc.h"
#import <Cocoa/Cocoa.h>
std
::
string
*
getSystemTempFolder
()
{
NSString
*
tempDir
=
NSTemporaryDirectory
();
if
(
tempDir
==
nil
)
tempDir
=
@"/tmp"
;
return
(
new
std
::
string
([
tempDir
UTF8String
])
);
}
//findSystemDirectory scoped exclusively to this file.
std
::
string
*
findSystemDirectory
(
NSSearchPathDirectory
searchPathDirectory
,
NSSearchPathDomainMask
domainMask
)
{
std
::
string
*
result
;
NSString
*
path
=
nil
;
// Search for the path
NSArray
*
paths
=
NSSearchPathForDirectoriesInDomains
(
searchPathDirectory
,
domainMask
,
YES
);
if
([
paths
count
])
{
NSString
*
bundleName
=
[[[
NSBundle
mainBundle
]
infoDictionary
]
objectForKey
:
@"CFBundleIdentifier"
];
path
=
[[
paths
objectAtIndex
:
0
]
stringByAppendingPathComponent
:
bundleName
];
//SPATTERS HACK: Always attempt to create directory, ignore errors.
NSError
*
error
=
nil
;
[[
NSFileManager
defaultManager
]
createDirectoryAtPath
:
path
withIntermediateDirectories
:
YES
attributes
:
nil
error
:&
error
];
result
=
new
std
::
string
([
path
UTF8String
]);
}
return
result
;
}
std
::
string
*
getSystemExecutableFolder
()
{
NSString
*
bundlePath
=
[[
NSBundle
mainBundle
]
executablePath
];
return
(
new
std
::
string
([
bundlePath
UTF8String
]));
}
std
::
string
*
getSystemResourceFolder
()
{
NSString
*
bundlePath
=
[[
NSBundle
mainBundle
]
resourcePath
];
return
(
new
std
::
string
([
bundlePath
UTF8String
]));
}
std
::
string
*
getSystemCacheFolder
()
{
return
findSystemDirectory
(
NSCachesDirectory
,
NSUserDomainMask
);
}
std
::
string
*
getSystemApplicationSupportFolder
()
{
return
findSystemDirectory
(
NSApplicationSupportDirectory
,
NSUserDomainMask
);
}
#endif // LL_DARWIN
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment