164 result = [applicationSupportDirectory UTF8String]; 165 return result; 166 } 167 168 TString MacPlatform::GetBundledJVMLibraryFileName(TString RuntimePath) { 169 TString result; 170 171 result = FilePath::IncludeTrailingSeparater(RuntimePath) + _T("Contents/Home/jre/lib/jli/libjli.dylib"); 172 173 if (FilePath::FileExists(result) == false) { 174 result = FilePath::IncludeTrailingSeparater(RuntimePath) + _T("Contents/Home/lib/jli/libjli.dylib"); 175 176 if (FilePath::FileExists(result) == false) { 177 result = _T(""); 178 } 179 } 180 181 return result; 182 } 183 184 185 TString MacPlatform::GetSystemJRE() { 186 if (GetAppCDSState() != cdsDisabled) { 187 //TODO throw exception 188 return _T(""); 189 } 190 191 return _T("/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/libjli.dylib"); 192 } 193 194 TString MacPlatform::GetSystemJVMLibraryFileName() { 195 TString result = GetSystemJRE(); 196 197 if (FilePath::FileExists(result) == false) { 198 result = _T(""); 199 } 200 201 return result; 202 } 203 204 TString MacPlatform::GetAppName() { 205 NSString *appName = [[NSProcessInfo processInfo] processName]; 206 TString result = [appName UTF8String]; 207 return result; 208 } 209 210 void AppendPListArrayToIniFile(NSDictionary *infoDictionary, IniFile *result, TString Section) { 211 NSString *sectionKey = [NSString stringWithUTF8String:PlatformString(Section).toMultibyte()]; 212 NSDictionary *array = [infoDictionary objectForKey:sectionKey]; 213 214 for (id option in array) { 215 if ([option isKindOfClass:[NSString class]]) { 216 TString arg = [option UTF8String]; 217 218 TString name; 219 TString value; 220 221 if (Helpers::SplitOptionIntoNameValue(arg, name, value) == true) { 222 result->Append(Section, name, value); 223 } | 164 result = [applicationSupportDirectory UTF8String]; 165 return result; 166 } 167 168 TString MacPlatform::GetBundledJVMLibraryFileName(TString RuntimePath) { 169 TString result; 170 171 result = FilePath::IncludeTrailingSeparater(RuntimePath) + _T("Contents/Home/jre/lib/jli/libjli.dylib"); 172 173 if (FilePath::FileExists(result) == false) { 174 result = FilePath::IncludeTrailingSeparater(RuntimePath) + _T("Contents/Home/lib/jli/libjli.dylib"); 175 176 if (FilePath::FileExists(result) == false) { 177 result = _T(""); 178 } 179 } 180 181 return result; 182 } 183 184 TString MacPlatform::GetAppName() { 185 NSString *appName = [[NSProcessInfo processInfo] processName]; 186 TString result = [appName UTF8String]; 187 return result; 188 } 189 190 void AppendPListArrayToIniFile(NSDictionary *infoDictionary, IniFile *result, TString Section) { 191 NSString *sectionKey = [NSString stringWithUTF8String:PlatformString(Section).toMultibyte()]; 192 NSDictionary *array = [infoDictionary objectForKey:sectionKey]; 193 194 for (id option in array) { 195 if ([option isKindOfClass:[NSString class]]) { 196 TString arg = [option UTF8String]; 197 198 TString name; 199 TString value; 200 201 if (Helpers::SplitOptionIntoNameValue(arg, name, value) == true) { 202 result->Append(Section, name, value); 203 } |