Esempio n. 1
0
        public GrepSink(IMiniStreamSink dest, string regex, RegexOptions options)
        {
            this.dest = dest;

            this.regexes    = new Regex[1];
            this.regexes[0] = new Regex(regex, options);
        }
Esempio n. 2
0
		public GrepSink (IMiniStreamSink dest, string[] regexes, RegexOptions options) {
			this.dest = dest;

			this.regexes = new Regex[regexes.Length];
			for (int i = 0; i < regexes.Length; i++)
				this.regexes[i] = new Regex (regexes[i], options);
		}
Esempio n. 3
0
        public SubstSink(IMiniStreamSink dest, SubstStyles styles) : base(dest)
        {
            if ((int)styles == 0)
            {
                throw new ArgumentException("Can't have empty substitution style");
            }

            this.styles = styles;
        }
Esempio n. 4
0
        public GrepSink(IMiniStreamSink dest, string[] regexes, RegexOptions options)
        {
            this.dest = dest;

            this.regexes = new Regex[regexes.Length];
            for (int i = 0; i < regexes.Length; i++)
            {
                this.regexes[i] = new Regex(regexes[i], options);
            }
        }
Esempio n. 5
0
		public MiniStream (IMiniStreamSink sink, Encoding encoding, int buf_size) {
			if (sink == null)
				throw new ArgumentNullException ();

			this.sink = sink;
			this.sb = new StringBuilder ();
			this.decoder = encoding.GetDecoder ();

			this.buf = new char[buf_size];
		}
Esempio n. 6
0
		public void AddSink (IMiniStreamSink sink) {
			if (sink == null)
				throw new ArgumentNullException ();

			IMiniStreamSink[] newsinks = new IMiniStreamSink [sinks.Length + 1];
			sinks.CopyTo (newsinks, 0);
			newsinks[sinks.Length] = sink;
			
			sinks = newsinks;
		}
Esempio n. 7
0
		// static
	       
		public static void DrainStream (StreamReader reader, IMiniStreamSink sink) {
			if (reader == null)
				throw new ArgumentNullException ("reader");
			if (sink == null)
				throw new ArgumentNullException ("sink");

			string line;

			while ((line = reader.ReadLine ()) != null)
				sink.SendLine (line);

			sink.StreamDone ();
		}
Esempio n. 8
0
        public MiniStream(IMiniStreamSink sink, Encoding encoding, int buf_size)
        {
            if (sink == null)
            {
                throw new ArgumentNullException();
            }

            this.sink    = sink;
            this.sb      = new StringBuilder();
            this.decoder = encoding.GetDecoder();

            this.buf = new char[buf_size];
        }
Esempio n. 9
0
        public void AddSink(IMiniStreamSink sink)
        {
            if (sink == null)
            {
                throw new ArgumentNullException();
            }

            IMiniStreamSink[] newsinks = new IMiniStreamSink [sinks.Length + 1];
            sinks.CopyTo(newsinks, 0);
            newsinks[sinks.Length] = sink;

            sinks = newsinks;
        }
Esempio n. 10
0
        public static int Start(BinaryInfo info, string extra_args, TextReader stdin,
                                IMiniStreamSink stdout, IMiniStreamSink stderr, IBuildContext ctxt)
        {
            StreamWriter stdout_stream = null;
            StreamWriter stderr_stream = null;

            if (stdout != null)
            {
                stdout_stream = new StreamWriter(new MiniStream(stdout));
            }

            if (stderr != null)
            {
                stderr_stream = new StreamWriter(new MiniStream(stderr));
            }

            return(Start(info, extra_args, stdin, stdout_stream,
                         stderr_stream, ctxt));
        }
Esempio n. 11
0
        // static

        public static void DrainStream(StreamReader reader, IMiniStreamSink sink)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            if (sink == null)
            {
                throw new ArgumentNullException("sink");
            }

            string line;

            while ((line = reader.ReadLine()) != null)
            {
                sink.SendLine(line);
            }

            sink.StreamDone();
        }
Esempio n. 12
0
		public MiniStream (IMiniStreamSink sink) : this (sink, Encoding.Default) {}
Esempio n. 13
0
		public static void DrainStream (MBFile file, IBuildContext ctxt, IMiniStreamSink sink) {
			DrainStream (file.OpenRead (ctxt), sink);
		}
Esempio n. 14
0
 public override void Close()
 {
     base.Close();
     sink.StreamDone();
     sink = null;
 }
Esempio n. 15
0
		public override void Close () {
			base.Close ();
			sink.StreamDone ();
			sink = null;
		}
Esempio n. 16
0
		public static void DrainStream (Stream stream, IMiniStreamSink sink) {
			using (StreamReader reader = new StreamReader (stream)) {
				DrainStream (reader, sink);
			}
		}
Esempio n. 17
0
		public MiniStream (IMiniStreamSink sink, Encoding encoding)
			: this (sink, encoding, 2048) {}
Esempio n. 18
0
		public TeeSink (IMiniStreamSink sink) {
			this.sinks = new IMiniStreamSink[1];
			this.sinks[0] = sink;
		}
Esempio n. 19
0
		public GrepSink (IMiniStreamSink dest, string regex, RegexOptions options) {
			this.dest = dest;

			this.regexes = new Regex[1];
			this.regexes[0] = new Regex (regex, options);
		}
Esempio n. 20
0
 public GrepSink(IMiniStreamSink dest, Regex[] regexes)
 {
     this.regexes = new Regex[regexes.Length];
     regexes.CopyTo(this.regexes, 0);
 }
Esempio n. 21
0
 public GrepSink(IMiniStreamSink dest, string[] regexes) :
     this(dest, regexes, RegexOptions.None)
 {
 }
Esempio n. 22
0
		public SubstSink (IMiniStreamSink dest) : this (dest, SubstStyles.Autoconf) {}
Esempio n. 23
0
 public TeeSink(IMiniStreamSink sink)
 {
     this.sinks    = new IMiniStreamSink[1];
     this.sinks[0] = sink;
 }
Esempio n. 24
0
 protected SedSink(IMiniStreamSink dest)
 {
     this.dest    = dest;
     this.regexes = new ArrayList();
     this.repls   = new ArrayList();
 }
Esempio n. 25
0
		protected SedSink (IMiniStreamSink dest) {
			this.dest = dest;
			this.regexes = new ArrayList ();
			this.repls = new ArrayList ();
		}
Esempio n. 26
0
 public MiniStream(IMiniStreamSink sink, Encoding encoding)
     : this(sink, encoding, 2048)
 {
 }
Esempio n. 27
0
		public GrepSink (IMiniStreamSink dest, Regex[] regexes) {
			this.regexes = new Regex[regexes.Length];
			regexes.CopyTo (this.regexes, 0);
		}
Esempio n. 28
0
 public MiniStream(IMiniStreamSink sink) : this(sink, Encoding.Default)
 {
 }
Esempio n. 29
0
		public GrepSink (IMiniStreamSink dest, string[] regexes) : 
			this (dest, regexes, RegexOptions.None) {}
Esempio n. 30
0
		public static int Start (BinaryInfo info, string extra_args, TextReader stdin,
					 IMiniStreamSink stdout, IMiniStreamSink stderr, IBuildContext ctxt) {
			StreamWriter stdout_stream = null;
			StreamWriter stderr_stream = null;

			if (stdout != null)
				stdout_stream = new StreamWriter (new MiniStream (stdout));

			if (stderr != null)
				stderr_stream = new StreamWriter (new MiniStream (stderr));

			return Start (info, extra_args, stdin, stdout_stream,
				      stderr_stream, ctxt);
		}
Esempio n. 31
0
		public TeeSink (IMiniStreamSink[] sinks) {
			this.sinks = new IMiniStreamSink[sinks.Length];
			sinks.CopyTo (this.sinks, 0);
		}
Esempio n. 32
0
 public static void DrainStream(Stream stream, IMiniStreamSink sink)
 {
     using (StreamReader reader = new StreamReader(stream)) {
         DrainStream(reader, sink);
     }
 }
Esempio n. 33
0
 public static void DrainStream(MBFile file, IBuildContext ctxt, IMiniStreamSink sink)
 {
     DrainStream(file.OpenRead(ctxt), sink);
 }
Esempio n. 34
0
 public SubstSink(IMiniStreamSink dest) : this(dest, SubstStyles.Autoconf)
 {
 }
Esempio n. 35
0
		public SubstSink (IMiniStreamSink dest, SubstStyles styles) : base (dest) {
			if ((int) styles == 0)
				throw new ArgumentException ("Can't have empty substitution style");

			this.styles = styles;
		}