当前位置: 首页>>代码示例>>C#>>正文


C# IO.TextReader类代码示例

本文整理汇总了C#中System.IO.TextReader的典型用法代码示例。如果您正苦于以下问题:C# System.IO.TextReader类的具体用法?C# System.IO.TextReader怎么用?C# System.IO.TextReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


System.IO.TextReader类属于命名空间,在下文中一共展示了System.IO.TextReader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Load

 public virtual void Load( TextReader r, int size, int readChunkSize )
 {
     if ( r == null )
     {
         return;
     }
     if ( size <= 0 )
     {
         size = InitialBufferSize;
     }
     if ( readChunkSize <= 0 )
     {
         readChunkSize = ReadBufferSize;
     }
     // System.out.println("load "+size+" in chunks of "+readChunkSize);
     try
     {
         data = r.ReadToEnd().ToCharArray();
         base.n = data.Length;
     }
     finally
     {
         r.Dispose();
     }
 }
开发者ID:sklose,项目名称:NCalc2,代码行数:25,代码来源:ANTLRReaderStream.cs

示例2: Load

 public virtual void Load( TextReader r, int size, int readChunkSize )
 {
     if ( r == null )
     {
         return;
     }
     if ( size <= 0 )
     {
         size = INITIAL_BUFFER_SIZE;
     }
     if ( readChunkSize <= 0 )
     {
         readChunkSize = READ_BUFFER_SIZE;
     }
     // System.out.println("load "+size+" in chunks of "+readChunkSize);
     try
     {
         data = r.ReadToEnd().ToCharArray();
         base.n = data.Length;
     }
     finally
     {
         r.Close();
     }
 }
开发者ID:ksmyth,项目名称:antlr,代码行数:25,代码来源:ANTLRReaderStream.cs

示例3: Lexer

 public Lexer(System.IO.TextReader rdr)
 {
     this.rdr = rdr;
     st = State.StartOfLine;
     lookahead = new Token(TokenType.EOFile);
     sb = new StringBuilder();
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:Lexer.cs

示例4: Parse

        public Feature Parse(TextReader featureFileReader)
        {
            var gherkinParser = new Gherkin.Parser();
            Gherkin.Ast.Feature feature = gherkinParser.Parse(featureFileReader);
            Feature result = new Mapper(feature.Language).MapToFeature(feature);

            return result;
        }
开发者ID:MikeThomas64,项目名称:pickles,代码行数:8,代码来源:FeatureParser.cs

示例5: CreateGroup

 /// <summary>
 /// Creates a StringTemplateGroup instance that manages a set of
 /// templates defined in a "group file".
 /// </summary>
 /// <param name="reader">Input stream for group file data</param>
 /// <param name="lexer">Lexer to use for breaking up templates into chunks</param>
 /// <param name="errorListener">Error message sink</param>
 /// <param name="superGroup">Parent (or super/base) group</param>
 /// <returns>A StringTemplateGroup instance or null if no group is found</returns>
 public StringTemplateGroup CreateGroup(
     TextReader reader,
     Type lexer,
     IStringTemplateErrorListener errorListener,
     StringTemplateGroup superGroup)
 {
     return new StringTemplateGroup(reader, lexer, errorListener, superGroup);
 }
开发者ID:david-mcneil,项目名称:stringtemplate,代码行数:17,代码来源:DefaultGroupFactory.cs

示例6: CharBuffer

        public CharBuffer(System.IO.TextReader reader, Int32 bufferSize)
        {
            _baseReader = reader;
            _bufferPtrBegin = 0;
            _bufferPtrEnd = 0;
            _bufferSize = Math.Max(bufferSize, MinBufferSize);
            _buffer = new Char[bufferSize];

            this.FillBuffer();
        }
开发者ID:takeshik,项目名称:parseq,代码行数:10,代码来源:CharBuffer.cs

示例7: PosEventReader

 public PosEventReader(System.IO.TextReader data, IPosContextGenerator contextGenerator)
 {
     mContextGenerator = contextGenerator;
     mTextReader = data;
     string nextLine = mTextReader.ReadLine();
     if (nextLine != null)
     {
         AddEvents(nextLine);
     }
 }
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:10,代码来源:PosEventReader.cs

示例8: Parse

        public Feature Parse(TextReader featureFileReader)
        {
            string fileContent = featureFileReader.ReadToEnd();

            var parser = new PicklesParser(this.languageService.GetLanguage());
            Lexer lexer = this.languageService.GetNativeLexer(parser);
            lexer.scan(fileContent);

            return parser.GetFeature();
        }
开发者ID:Narmical,项目名称:pickles,代码行数:10,代码来源:FeatureParser.cs

示例9: Main

 public void Main(string[] args, 
     System.IO.TextReader In,
     System.IO.TextWriter Out,
     System.IO.TextWriter Error)
 {
     //this version of Main allows alternate streams
     this.In = In;
     this.Out = Out;
     this.Error = Error;
     this.Main(args);
 }
开发者ID:yuri-danilchenko,项目名称:vssbindingremover,代码行数:11,代码来源:ConsoleEngineBase.cs

示例10: SimpleCharStream

 public SimpleCharStream(System.IO.TextReader dstream, int startline,
     int startcolumn, int buffersize)
 {
     inputStream = dstream;
     line = startline;
     column = startcolumn - 1;
     available = bufsize = buffersize;
     buffer = new char[buffersize];
     bufline = new int[buffersize];
     bufcolumn = new int[buffersize];
 }
开发者ID:RoganMatrivski,项目名称:Math-Problem-Generator,代码行数:11,代码来源:SimpleCharStream.cs

示例11: Initialize

		public void Initialize(System.IO.TextReader reader, LexicalStates lexicalState, bool atBol)
		{
			this.expanding_token = false;
			this.token_start = 0;
			this.chars_read = 0;
			this.lookahead_index = 0;
			this.token_chunk_start = 0;
			this.token_end = 0;
			this.reader = reader;
			this.yy_at_bol = atBol;
			this.current_lexical_state = lexicalState;
		}
开发者ID:dw4dev,项目名称:Phalanger,代码行数:12,代码来源:jsonLexer.cs

示例12: Parse

        public Feature Parse(TextReader featureFileReader)
        {
            var language = this.DetermineLanguage();
            var gherkinParser = new Gherkin.Parser();

            Gherkin.Ast.Feature feature = gherkinParser.Parse(
                new Gherkin.TokenScanner(featureFileReader),
                new Gherkin.TokenMatcher(language));

            Feature result = new Mapper(feature.Language).MapToFeature(feature);

            return result;
        }
开发者ID:iamkoch,项目名称:pickles,代码行数:13,代码来源:FeatureParser.cs

示例13: Parse

        public Feature Parse(TextReader featureFileReader)
        {
            var language = this.DetermineLanguage();
            var gherkinParser = new Gherkin.Parser();

            Gherkin.Ast.GherkinDocument gherkinDocument = gherkinParser.Parse(
                new Gherkin.TokenScanner(featureFileReader),
                new Gherkin.TokenMatcher(language));

            Feature result = new Mapper(this.configuration, gherkinDocument.Feature.Language).MapToFeature(gherkinDocument);

            return result;
        }
开发者ID:ngm,项目名称:pickles,代码行数:13,代码来源:FeatureParser.cs

示例14: CommandBase

 public CommandBase()
 {
     //by default, read from/write to standard streams
     this.In = System.Console.In;
     this.Out = System.Console.Out;
     this.Error = System.Console.Error;
 }
开发者ID:varixto,项目名称:stellar,代码行数:7,代码来源:CommandBase.cs

示例15: Main

        public static void Main(string[] args)
        {
            nick = "SecureIRC";
            owner = "SecureIRC";
            server = "irc.entalyan.com";
            port = 6999;
            chan = "#SecureIRC";
            pass = ""; //Enter just the password

            //Connect to irc server and get input and output text streams from TcpClient.
            sock.Connect(server, port);
            if (!sock.Connected)
            {
                Console.WriteLine("Failed to connect!");
                return;
            }
            input = new System.IO.StreamReader(sock.GetStream());
            output = new System.IO.StreamWriter(sock.GetStream());

            //Starting USER and NICK login commands 
            output.Write(
                "PASS " + nick + ":" + pass + "\r\n" +
                "USER " + nick + " 0 * :" + owner + "\r\n" +
                "NICK " + nick + "\r\n" +
                "PRIVMSG #SecureIRC Successful login at: " + DateTime.Now.ToString() + "\r\n"
            );
            output.Flush();

            Listen();

            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();

        }
开发者ID:Entalyan,项目名称:Simple-IRC-Tests,代码行数:34,代码来源:Program.cs


注:本文中的System.IO.TextReader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。