12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #include <Foundation/Foundation.h>
- #include "common.h"
- #include "SDL_filesystem.h"
- LPCSTR
- UTIL_IOS_BasePath(
- VOID
- )
- {
- static char buf[4096] = "";
- if (buf[0] == '\0')
- {
- #ifdef CYDIA
- char *p = SDL_GetBasePath();
- if (p != NULL)
- {
- strcpy(buf, p);
- free(p);
- }
- #else
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
- NSString *documentsDirectory = [[paths objectAtIndex:0] stringByAppendingString:@"/"];
- strcpy(buf, [documentsDirectory UTF8String]);
- #endif
- }
- return buf;
- }
- LPCSTR
- UTIL_IOS_SavePath(
- VOID
- )
- {
- static char buf[4096] = "";
- if (buf[0] == '\0')
- {
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
- NSString *documentsDirectory = [[paths objectAtIndex:0] stringByAppendingString:@"/"];
- strcpy(buf, [documentsDirectory UTF8String]);
- }
- return buf;
- }
|