public unsafe static uint _PATHLAST([MarshalAs(UnmanagedType.LPTStr)] StringBuilder sb) { // get current folder var path = TccCommands.ExpandVariables("%CD"); var parts = path.Split('\\'); sb.Replace(String.Join("/", parts.Reverse().Take(2).Reverse())); return(0); }
static TildeSupportPlugin() { TccEventManager.Register(new PluginInfo { Author = "James Treworgy", Description = "Add tilde support on some commands", Email = "*****@*****.**", ModuleName = "?", WebSite = "https://github.com/jamietre/tcc-plugin" }); Tcc = new TccCommands(); Tcc.MapPath = Helpers.MapPath; Loader = new ExternalLoader(Tcc); //LoadAssemblies(); }
public static string MapPath(string path) { if (path.StartsWith("~")) { path = TccCommands.ExpandVariables("%HOMEDRIVE%%HOMEPATH%") + path.Substring(1); } path = FixSlashes(path); if (path[0] == '\\' && path.Length > 1 && IsAlpha(path[1]) && (path.Length == 2 || (path.Length > 2 && path[2] == '\\'))) { path = path[1] + ":\\" + (path.Length > 3 ? path.Substring(3) : ""); } return(path); }
public ExternalLoader(TccCommands tcc) { Tcc = tcc; }
public ProcessInfo(TccCommands tcc) { Tcc = tcc; }