Difference between revisions of "API:TextWriter"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Created page with "{{Namespace:KSP.IO}} {{Class |name=TextWriter |summary=Identical to System.IO.TextWriter, but with added IDisposable methods (for use in using() statements), and a factory met...")
 
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
 
|summary=Identical to System.IO.TextWriter, but with added IDisposable methods (for use in using() statements), and a factory method instead of constructors.
 
|summary=Identical to System.IO.TextWriter, but with added IDisposable methods (for use in using() statements), and a factory method instead of constructors.
 
}}
 
}}
 +
{{PropertiesStart}}
 +
{{Property
 +
|type=string
 +
|name=NewLine
 +
|desc=
 +
|hasget=1
 +
|hasset=1
 +
}}
 +
{{Property
 +
|type=Encoding
 +
|name=Encoding
 +
|desc=
 +
|hasget=1
 +
|hasset=
 +
}}
 +
{{Property
 +
|type=IFormatProvider
 +
|name=FormatProvider
 +
|desc=
 +
|hasget=1
 +
|hasset=
 +
}}
 +
{{PropertiesEnd}}
 
{{MethodsStart}}
 
{{MethodsStart}}
{{Method
 
|returntype=void
 
|returndesc=
 
|name=Close
 
|args=
 
}}
 
 
{{StaticMethod
 
{{StaticMethod
 
|returntype=TextWriter
 
|returntype=TextWriter
 
|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 TextWriter instance for the desired filename.
+
|desc=Create a text writing stream
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Dispose
+
|name=WriteLine
 
|args=
 
|args=
|desc=Close() the TextWriter
+
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Flush
+
|name=Write
|args=
+
|args={{arg|string|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 35: Line 53:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=bool value
+
|args={{arg|ulong|value}}
 +
|desc=
 +
}}
 +
{{Method
 +
|returntype=void
 +
|returndesc=
 +
|name=Close
 +
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 41: Line 67:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=char value
+
|args={{arg|object|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=WriteLine
|args=char[] buffer
+
|args={{arg|long|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=WriteLine
|args=decimal value
+
|args={{arg|string|format}}, {{arg|object|arg0}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=WriteLine
|args=double value
+
|args={{arg|string|format}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=WriteLine
|args=int value
+
|args={{arg|decimal|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=WriteLine
|args=long value
+
|args={{arg|bool|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=WriteLine
|args=object value
+
|args={{arg|char|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=WriteLine
|args=float value
+
|args={{arg|double|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 89: Line 123:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=string value
+
|args={{arg|char|buffer|array=[]}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=WriteLine
|args=uint value
+
|args={{arg|char|buffer|array=[]}}, {{arg|int|index}}, {{arg|int|count}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=Write
+
|name=Flush
|args=ulong value
+
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 107: Line 144:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=string format, object arg0
+
|args={{arg|double|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 113: Line 151:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=string format, params object[] arg
+
|args={{arg|decimal|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 119: Line 158:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=char[] buffer, int index, int count
+
|args={{arg|string|format}}, {{arg|object|arg0}}, {{arg|object|arg1}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 125: Line 165:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=string format, object arg0, object arg1
+
|args={{arg|uint|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 131: Line 172:
 
|returndesc=
 
|returndesc=
 
|name=Write
 
|name=Write
|args=string format, object arg0, object arg1, object arg2
+
|args={{arg|int|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=WriteLine
+
|name=Write
|args=
+
|args={{arg|string|format}}, {{arg|object|arg0}}, {{arg|object|arg1}}, {{arg|object|arg2}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 143: Line 186:
 
|returndesc=
 
|returndesc=
 
|name=WriteLine
 
|name=WriteLine
|args=bool value
+
|args={{arg|ulong|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 149: Line 193:
 
|returndesc=
 
|returndesc=
 
|name=WriteLine
 
|name=WriteLine
|args=char value
+
|args={{arg|object|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=WriteLine
+
|name=Write
|args=char[] buffer
+
|args={{arg|char|buffer|array=[]}}, {{arg|int|index}}, {{arg|int|count}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 161: Line 207:
 
|returndesc=
 
|returndesc=
 
|name=WriteLine
 
|name=WriteLine
|args=decimal value
+
|args={{arg|string|format}}, {{arg|object|arg0}}, {{arg|object|arg1}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 167: Line 214:
 
|returndesc=
 
|returndesc=
 
|name=WriteLine
 
|name=WriteLine
|args=double value
+
|args={{arg|float|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 173: Line 221:
 
|returndesc=
 
|returndesc=
 
|name=WriteLine
 
|name=WriteLine
|args=int value
+
|args={{arg|string|format}}, {{arg|object|arg0}}, {{arg|object|arg1}}, {{arg|object|arg2}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=WriteLine
+
|name=Write
|args=long value
+
|args={{arg|float|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=WriteLine
+
|name=Write
|args=object value
+
|args={{arg|char|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 191: Line 242:
 
|returndesc=
 
|returndesc=
 
|name=WriteLine
 
|name=WriteLine
|args=float value
+
|args={{arg|char|buffer|array=[]}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 197: Line 249:
 
|returndesc=
 
|returndesc=
 
|name=WriteLine
 
|name=WriteLine
|args=string value
+
|args={{arg|string|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=WriteLine
+
|name=Write
|args=uint value
+
|args={{arg|string|format}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=WriteLine
+
|name=Write
|args=ulong value
+
|args={{arg|bool|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 215: Line 270:
 
|returndesc=
 
|returndesc=
 
|name=WriteLine
 
|name=WriteLine
|args=string format, object arg0
+
|args={{arg|uint|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=WriteLine
+
|name=Dispose
|args=string format, params object[] arg
+
|args=
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
Line 227: Line 284:
 
|returndesc=
 
|returndesc=
 
|name=WriteLine
 
|name=WriteLine
|args=char[] buffer, int index, int count
+
|args={{arg|int|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=WriteLine
+
|name=Write
|args=string format, object arg0, object arg1
+
|args={{arg|long|value}}
 +
|desc=
 
}}
 
}}
 
{{Method
 
{{Method
 
|returntype=void
 
|returntype=void
 
|returndesc=
 
|returndesc=
|name=WriteLine
+
|name=Write
|args=string format, object arg0, object arg1, object arg2
+
|args={{arg|string|format}}, {{arg|object|arg0}}
 +
|desc=
 
}}
 
}}
 
{{MethodsEnd}}
 
{{MethodsEnd}}

Latest revision as of 23:08, 12 October 2012

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

TextWriter Class

Identical to System.IO.TextWriter, 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 TextWriter.

Signature Description
string NewLine { get; set; }
Encoding Encoding { get; }
IFormatProvider FormatProvider { get; }

Methods

The following are methods included in TextWriter.

Signature Description
static TextWriter CreateForType<T>(string filename, Vessel flight = null) Create a text writing stream
void WriteLine()
void Write(string value)
void Write(ulong value)
void Close()
void Write(object value)
void WriteLine(long value)
void WriteLine(string format, object arg0)
void WriteLine(string format)
void WriteLine(decimal value)
void WriteLine(bool value)
void WriteLine(char value)
void WriteLine(double value)
void Write(char[] buffer)
void WriteLine(char[] buffer, int index, int count)
void Flush()
void Write(double value)
void Write(decimal value)
void Write(string format, object arg0, object arg1)
void Write(uint value)
void Write(int value)
void Write(string format, object arg0, object arg1, object arg2)
void WriteLine(ulong value)
void WriteLine(object value)
void Write(char[] buffer, int index, int count)
void WriteLine(string format, object arg0, object arg1)
void WriteLine(float value)
void WriteLine(string format, object arg0, object arg1, object arg2)
void Write(float value)
void Write(char value)
void WriteLine(char[] buffer)
void WriteLine(string value)
void Write(string format)
void Write(bool value)
void WriteLine(uint value)
void Dispose()
void WriteLine(int value)
void Write(long value)
void Write(string format, object arg0)