Exemplo n.º 1
0
        // The pipe's compile errors are gathered here.

        /// <summary>
        /// Constructs a pipe from a script and references the pipe's file
        /// on disk in order to identify the pipe when generating compile
        /// errors.  If the pipe is not yet saved to disk, specify Folder
        /// and Name as "".
        /// </summary>
        public Pipe(string script, Engine eng, string folder, string name,
                    bool loggingEnabled, bool replacingDelims)
        {
            if (eng != null)
            {
                Name           = name;
                Eng            = eng;
                LoggingEnabled = loggingEnabled;
                Debugging      = false;
                DebugFile      = null;
                LogWrite("Pipe.Pipe: replacingDelims: " + replacingDelims.ToString());

                if (replacingDelims)
                {
                    Script = script.Replace(Engine.PipeDelim.ToString(), System.Environment.NewLine);
                }
                else
                {
                    Script = script;
                }

                if (folder != string.Empty)
                {
                    Folder = System.IO.Path.GetFullPath(folder);
                }
                else
                {
                    Folder = folder;
                }

                DivTextStack = new Stack <string>();
                LogWriteText(Script, "Pipe.Pipe Script... ", "Line[[]]: ");
                LogWrite("Pipe.Pipe: Folder = \"" + folder + "\"");
                LogWrite("Pipe.Pipe: Name = \"" + name + "\"");
                Template = GetKeywordValue("TEMPLATE", Script);
                LogWrite("Pipe.Pipe: Template = \"" + Template + "\"");
                Filters = new List <Filter>();
                CmdLine = new CommandLine(Template, eng.Log, loggingEnabled);
                CmdLine.IgnoringExtraneousText = false;
                Errors = new CompileErrors();
            }
            else
            {
                throw new PipeWrenchEngineException("Engine parameter cannot be null");
            }
        }
Exemplo n.º 2
0
        // The pipe's compile errors are gathered here.
        /// <summary>
        /// Constructs a pipe from a script and references the pipe's file
        /// on disk in order to identify the pipe when generating compile
        /// errors.  If the pipe is not yet saved to disk, specify Folder
        /// and Name as "".
        /// </summary>
        public Pipe(string script, Engine eng, string folder, string name,
      bool loggingEnabled, bool replacingDelims)
        {
            if (eng != null)
             {
            Name = name;
            Eng = eng;
            LoggingEnabled = loggingEnabled;
            Debugging = false;
            DebugFile = null;
            LogWrite("Pipe.Pipe: replacingDelims: " + replacingDelims.ToString());

            if (replacingDelims)
               Script = script.Replace(Engine.PipeDelim.ToString(), System.Environment.NewLine);
            else
               Script = script;

            if (folder != string.Empty)
               Folder = System.IO.Path.GetFullPath(folder);
            else
               Folder = folder;

            DivTextStack = new Stack<string>();
            LogWriteText(Script, "Pipe.Pipe Script... ", "Line[[]]: ");
            LogWrite("Pipe.Pipe: Folder = \"" + folder + "\"");
            LogWrite("Pipe.Pipe: Name = \"" + name + "\"");
            Template = GetKeywordValue("TEMPLATE", Script);
            LogWrite("Pipe.Pipe: Template = \"" + Template + "\"");
            Filters = new List<Filter>();
            CmdLine = new CommandLine(Template, eng.Log, loggingEnabled);
            CmdLine.IgnoringExtraneousText = false;
            Errors = new CompileErrors();
             }
             else
             {
            throw new PipeWrenchEngineException("Engine parameter cannot be null");
             }
        }