本文整理汇总了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();
}
}
示例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();
}
}
示例3: Lexer
public Lexer(System.IO.TextReader rdr)
{
this.rdr = rdr;
st = State.StartOfLine;
lookahead = new Token(TokenType.EOFile);
sb = new StringBuilder();
}
示例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;
}
示例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);
}
示例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();
}
示例7: PosEventReader
public PosEventReader(System.IO.TextReader data, IPosContextGenerator contextGenerator)
{
mContextGenerator = contextGenerator;
mTextReader = data;
string nextLine = mTextReader.ReadLine();
if (nextLine != null)
{
AddEvents(nextLine);
}
}
示例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();
}
示例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);
}
示例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];
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}