13 if (absPath.
Length() < 2)
return;
17 if (absPath[1] !=
":")
21 absPath = cwd +
"/" + absPath;
24 int index = absPath.
IndexOf(
"/");
25 int last_index = index;
33 if (last_index == -1)
return;
47 Workbench.
ScriptDialog(
"Configure OpenDir",
"Usage: \n$path - will be replaced with file name",
this);
override void Configure()
proto external bool GetCurrentFile(out string filename)
static proto native int RunCmd(string command, bool wait=false)
static proto void GetCwd(out string currentDir)
static proto native WBModuleDef GetModule(string type)
static proto int ScriptDialog(string caption, string text, Class data)
static proto bool GetAbsolutePath(string relativePath, out string absPath)
proto native int Length()
Returns length of string.
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.
proto string Substring(int start, int len)
Substring of 'str' from 'start' position 'len' number of characters.
proto native int IndexOfFrom(int start, string sample)
Finds 'sample' in 'str' from 'start' position. Returns -1 when not found.
proto native int IndexOf(string sample)
Finds 'sample' in 'str'. Returns -1 when not found.