3
#include "org_xmlvm_runtime_XMLVMUtil.h"
6
//XMLVM_BEGIN_NATIVE_IMPLEMENTATION
9
#ifndef XMLVM_NEW_IOS_API
10
#include "org_xmlvm_iphone_NSString.h"
12
#include "org_xmlvm_ios_NSString.h"
15
//XMLVM_END_NATIVE_IMPLEMENTATION
17
JAVA_OBJECT org_xmlvm_runtime_XMLVMUtil_getCurrentWorkingDirectory__()
19
//XMLVM_BEGIN_NATIVE[org_xmlvm_runtime_XMLVMUtil_getCurrentWorkingDirectory__]
21
// Base directory is <App>/Documents/
22
// http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/FilesandNetworking/FilesandNetworking.html
23
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
24
NSString* path = [paths objectAtIndex:0];
25
JAVA_OBJECT jpath = fromNSString(path);
29
char* err = getcwd(buf, sizeof(buf));
31
XMLVM_INTERNAL_ERROR();
33
return xmlvm_create_java_string(buf);