blob: 3344601137b8fdb3ae42594dae1b121513bde824 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include "URL.h"
#include "Foundation/Foundation.h"
#ifdef __has_feature
# if __has_feature(objc_arc)
# define(HAS_AUTORELEASE_POOL)
# endif
#endif
namespace uscxml {
std::string URL::getResourceDir() {
#if HAS_AUTORELEASE_POOL
@autoreleasepool {
#else
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
#endif
NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
return std::string([resourcePath cStringUsingEncoding:NSUTF8StringEncoding]);
#if HAS_AUTORELEASE_POOL
}
#else
[pool drain];
#endif
}
}
|