MCPcopy Create free account
hub / github.com/HumbleNet/HumbleNet / openDocument

Method openDocument

3rdparty/Amalgamate/juce_core_amalgam.cpp:27915–27953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27913}
27914
27915bool Process::openDocument (const String& fileName, const String& parameters)
27916{
27917 #if JUCE_IOS
27918 return [[UIApplication sharedApplication] openURL: [NSURL URLWithString: juceStringToNS (fileName)]];
27919 #else
27920 JUCE_AUTORELEASEPOOL
27921
27922 if (parameters.isEmpty())
27923 {
27924 return [[NSWorkspace sharedWorkspace] openFile: juceStringToNS (fileName)]
27925 || [[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: juceStringToNS (fileName)]];
27926 }
27927
27928 bool ok = false;
27929 const File file (fileName);
27930
27931 if (file.isBundle())
27932 {
27933 NSMutableArray* urls = [NSMutableArray array];
27934
27935 StringArray docs;
27936 docs.addTokens (parameters, true);
27937 for (int i = 0; i < docs.size(); ++i)
27938 [urls addObject: juceStringToNS (docs[i])];
27939
27940 ok = [[NSWorkspace sharedWorkspace] openURLs: urls
27941 withAppBundleIdentifier: [[NSBundle bundleWithPath: juceStringToNS (fileName)] bundleIdentifier]
27942 options: 0
27943 additionalEventParamDescriptor: nil
27944 launchIdentifiers: nil];
27945 }
27946 else if (file.exists())
27947 {
27948 ok = FileHelpers::launchExecutable ("\"" + fileName + "\" " + parameters);
27949 }
27950
27951 return ok;
27952 #endif
27953}
27954
27955void File::revealToUser() const
27956{

Callers

nothing calls this directly

Calls 15

juceStringToNSFunction · 0.85
launchExecutableFunction · 0.85
numElementsInArrayFunction · 0.85
StringClass · 0.85
exitFunction · 0.85
javaStringFunction · 0.85
isBundleMethod · 0.80
addTokensMethod · 0.80
existsMethod · 0.80
toWideCharPointerMethod · 0.80
replaceMethod · 0.80
startsWithIgnoreCaseMethod · 0.80

Tested by

no test coverage detected