Difference between revisions of "API:TextReader"

From Kerbal Space Program Wiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
 
|summary=Identical to System.IO.TextReader, but with added IDisposable methods (for use in using() statements), and a factory method instead of constructors.
 
|summary=Identical to System.IO.TextReader, but with added IDisposable methods (for use in using() statements), and a factory method instead of constructors.
 
}}
 
}}
{{MethodsStart}}
+
{{PropertiesStart}}
{{Method
+
{{Property
|returntype=void
+
|type=bool
|returndesc=
+
|name=EndOfStream
|name=Close
+
|desc=
|args=
+
|hasget=1
 +
|hasset=
 +
}}
 +
{{Property
 +
|type=Stream
 +
|name=BaseStream
 +
|desc=
 +
|hasget=1
 +
|hasset=
 +
}}
 +
{{Property
 +
|type=Encoding
 +
|name=CurrentEncoding
 
|desc=
 
|desc=
 +
|hasget=1
 +
|hasset=
 
}}
 
}}
 +
{{PropertiesEnd}}
 +
{{MethodsStart}}
 
{{StaticMethod
 
{{StaticMethod
 
|returntype=TextReader
 
|returntype=TextReader
 
|returndesc=
 
|returndesc=
 
|name=CreateForType<T>
 
|name=CreateForType<T>
|args=string filename, Vessel flight = null
+
|args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}}
|desc=Create a TextReader instance for the desired filename.
+
|desc=Create a text reader stream.
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
|returntype=int
 
|returndesc=
 
|returndesc=
|name=Dispose
+
|name=Read
 
|args=
 
|args=
|desc=Close the TextReader.
+
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 34: Line 50:
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=int
+
|returntype=void
 +
|returndesc=
 +
|name=Close
 +
|args=
 +
|desc=
 +
}}
 +
{{Method
 +
|returntype=string
 
|returndesc=
 
|returndesc=
|name=Read
+
|name=ReadLine
 
|args=
 
|args=
 
|desc=
 
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=int
+
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Read
+
|name=DiscardBufferedData
|args=char[] buffer, int index, int count
+
|args=
 
|desc=
 
|desc=
 
}}
 
}}
Line 50: Line 73:
 
|returntype=int
 
|returntype=int
 
|returndesc=
 
|returndesc=
|name=ReadBlock
+
|name=Read
|args=char[] buffer, int index, int count
+
|args={{arg|char|buffer|array=[]}}, {{arg|int|index}}, {{arg|int|count}}
 
|desc=
 
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=string
+
|returntype=void
 
|returndesc=
 
|returndesc=
|name=ReadLine
+
|name=Dispose
 
|args=
 
|args=
 
|desc=
 
|desc=

Latest revision as of 22:43, 12 October 2012

KSP.IO Namespace
BinaryReader · BinaryWriter · File · FileInfo · FileStream · IOException · IOTools · IOUtils · MemoryStream · PluginConfigNode · PluginConfiguration · TextReader · TextWriter

TextReader Class

Identical to System.IO.TextReader, but with added IDisposable methods (for use in using() statements), and a factory method instead of constructors.

Properties

The following are public properties available in TextReader.

Signature Description
bool EndOfStream { get; }
Stream BaseStream { get; }
Encoding CurrentEncoding { get; }

Methods

The following are methods included in TextReader.

Signature Description
static TextReader CreateForType<T>(string filename, Vessel flight = null) Create a text reader stream.
int Read()
int Peek()
void Close()
string ReadLine()
void DiscardBufferedData()
int Read(char[] buffer, int index, int count)
void Dispose()
string ReadToEnd()