• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IO.TextReader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

        public Lexer(System.IO.TextReader reader)
        {
            _allowComments = true;
            _allowSingleQuotedStrings = true;

            _inputBuffer = 0;
            _stringBuffer = new System.Text.StringBuilder(128);
            _state = 1;
            EndOfInput = false;
            _reader = reader;

            _fsmContext = new FsmContext {L = this};
        }
开发者ID:CraigTaylor,项目名称:App.Port,代码行数:13,代码来源:Lexer.cs


示例15: ReaderInput

        public ReaderInput(string name, System.IO.TextReader reader)
        {
            if (null == name)
            {
                throw new ArgumentNullException("name");
            }

            if (null == reader)
            {
                throw new ArgumentNullException("reader");
            }

            _name = name;
            _reader = reader;
        }
开发者ID:w4x,项目名称:boolangstudio,代码行数:15,代码来源:ReaderInput.cs


示例16: Field

		internal Field(System.String name, System.IO.TextReader reader)
		{
			if (name == null)
				throw new System.ArgumentException("name cannot be null");
			if (reader == null)
				throw new System.ArgumentException("value cannot be null");
			
			this.name = String.Intern(name); // Field names are interned
			this.readerValue = reader;
		}
开发者ID:emtees,项目名称:old-code,代码行数:10,代码来源:Field.cs


示例17: ANTLRReaderStream

 public ANTLRReaderStream( TextReader r, int size, int readChunkSize )
 {
     Load( r, size, readChunkSize );
 }
开发者ID:sklose,项目名称:NCalc2,代码行数:4,代码来源:ANTLRReaderStream.cs


示例18: 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


示例19: 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


示例20: Initializer

 protected void Initializer(string FeatureName)
 {
     this.In = System.Console.In;
     this.Out = System.Console.Out;
     this.Error = System.Console.Out;
     Name = FeatureName;
 }
开发者ID:Ngauet,项目名称:automatedframework,代码行数:7,代码来源:ConsoleBase.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IO.TextWriter类代码示例发布时间:2022-05-24
下一篇:
C# IO.StringWriter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap