/// <summary> /// Create a new TccCommand spec, defining all options available. When this method is used, /// the parser can automatically resolve paths starting with a forward slash. /// </summary> /// <param name="name"></param> /// <param name="winApiCmd"></param> /// <param name="options"></param> public TccCommand(string name, TccLib.TCAction winApiCmd, IEnumerable <TccArg> options) { Name = name.ToUpper(); var defaultOpts = EnumerableHelper.Enumerate(new TccArg("?")); _Options = new HashSet <TccArg>((options ?? defaultOpts).Concat(defaultOpts)); WinApiCmd = winApiCmd; }
/// <summary> /// Execute the specificied TCC commmand. /// </summary> /// <param name="action"></param> /// <param name="text"></param> /// <returns></returns> public uint Execute(TccLib.TCAction action, string text) { uint result; fixed(char *textPtr = TccCommands.GetBuffer(text)) { result = action(textPtr); } return(result); }
public TccCommand(string name, TccLib.TCAction winApiCmd) : this(name, winApiCmd, null) { CreatedWithoutOptions = true; }