old quark gui: openOS is not osx only
[supercollider.git] / SCClassLibrary / Platform / iphone / extString.sc
blob069bdddafa0482f94e4ef25e6049ba61fadd1e6a
1 + String
3         loadPath { arg warnIfNotFound=true;
4                 var obj,path;
5                 path = this.standardizePath;
6                 if(File.exists(path),{
7                         {
8                                 obj = thisProcess.interpreter.executeFile(path);
9                                 //obj.didLoadFromPath(this);
10                         }.try({ arg err;
11                                 ("In file: " + this).postln;
12                                 err.throw;
13                         });
14                 },{
15                         if(warnIfNotFound,{
16                                 warn("String:loadPath file not found " + this + path);
17                         });
18                 });
19                 if(obj.isNil and: warnIfNotFound, {
20                         warn("String:loadPath found nil, empty contents or parse error in " + path);
22                         //^ObjectNotFound.new(path)
23                 });
24                 ^obj
25         }