Difference between revisions of "API:File"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Created page with "{{Namespace:KSP.IO}} {{Class |name=File }} {{MethodsStart}} {{StaticMethod |returntype=void |returndesc= |name=Delete<T> |args=string filename, Vessel flight = null |desc=Dele...")
 
Line 1: Line 1:
 +
<!-- Autogenerated by WRAPTOOL.  Yell at N3X15 if it breaks. -->
 
{{Namespace:KSP.IO}}
 
{{Namespace:KSP.IO}}
 
{{Class
 
{{Class
 
|name=File
 
|name=File
 +
|summary=summary goes here
 
}}
 
}}
 
{{MethodsStart}}
 
{{MethodsStart}}
 +
{{StaticMethod
 +
|returntype=bool
 +
|returndesc=
 +
|name=Exists<T>
 +
|args=string filename, Vessel flight = null
 +
|desc=Find out if a file in your IO sandbox exists.
 +
}}
 +
{{StaticMethod
 +
|returntype=KSP.IO.FileStream
 +
|returndesc=
 +
|name=Open<T>
 +
|args=string filename, KSP.IO.FileMode mode, Vessel flight = null
 +
|desc=Open a stream that operates on a file.
 +
}}
 +
{{StaticMethod
 +
|returntype=KSP.IO.FileStream
 +
|returndesc=
 +
|name=OpenWrite<T>
 +
|args=string filename, Vessel flight = null
 +
|desc=Open a stream that writes to a file.
 +
}}
 +
{{StaticMethod
 +
|returntype=void
 +
|returndesc=
 +
|name=WriteAllText<T>
 +
|args=string data, string filename, Vessel flight = null
 +
|desc=Write a string to a file.
 +
}}
 +
{{StaticMethod
 +
|returntype=void
 +
|returndesc=
 +
|name=AppendAllText<T>
 +
|args=string data, string filename, Vessel flight = null
 +
|desc=Append a string to a file, or creates it if it doesn't exist.
 +
}}
 +
{{StaticMethod
 +
|returntype=KSP.IO.TextWriter
 +
|returndesc=
 +
|name=AppendText<T>
 +
|args=string filename, Vessel flight = null
 +
|desc=Open a stream that appends to a file.
 +
}}
 
{{StaticMethod
 
{{StaticMethod
 
|returntype=void
 
|returntype=void
Line 12: Line 56:
 
}}
 
}}
 
{{StaticMethod
 
{{StaticMethod
|returntype=bool
+
|returntype=string[]
 
|returndesc=
 
|returndesc=
|name=Exists<T>
+
|name=ReadAllLines<T>
 
|args=string filename, Vessel flight = null
 
|args=string filename, Vessel flight = null
|desc=Find out if a file in your IO sandbox exists.
+
|desc=Read all lines from a file in your IO sandbox.
 
}}
 
}}
 
{{StaticMethod
 
{{StaticMethod
|returntype=byte[]
+
|returntype=KSP.IO.TextReader
 
|returndesc=
 
|returndesc=
|name=ReadAllBytes<T>
+
|name=OpenText<T>
 
|args=string filename, Vessel flight = null
 
|args=string filename, Vessel flight = null
|desc=Read all the bytes from a file in your IO sandbox.
+
|desc=Open a stream that operates on a file.
 
}}
 
}}
 
{{StaticMethod
 
{{StaticMethod
|returntype=string[]
+
|returntype=byte[]
 
|returndesc=
 
|returndesc=
|name=ReadAllLines<T>
+
|name=ReadAllBytes<T>
 
|args=string filename, Vessel flight = null
 
|args=string filename, Vessel flight = null
|desc=Read all lines from a file in your IO sandbox.
+
|desc=Read all the bytes from a file in your IO sandbox.
 
}}
 
}}
 
{{StaticMethod
 
{{StaticMethod
|returntype=string
+
|returntype=KSP.IO.TextWriter
 
|returndesc=
 
|returndesc=
|name=ReadAllText<T>
+
|name=CreateText<T>
 
|args=string filename, Vessel flight = null
 
|args=string filename, Vessel flight = null
|desc=Read all the text from a file in your IO sandbox.
+
|desc=Open a stream that creates a file.
 
}}
 
}}
 
{{StaticMethod
 
{{StaticMethod
Line 54: Line 98:
 
}}
 
}}
 
{{StaticMethod
 
{{StaticMethod
|returntype=void
+
|returntype=string
 +
|returndesc=
 +
|name=ReadAllText<T>
 +
|args=string filename, Vessel flight = null
 +
|desc=Read all the text from a file in your IO sandbox.
 +
}}
 +
{{StaticMethod
 +
|returntype=KSP.IO.FileStream
 
|returndesc=
 
|returndesc=
|name=WriteAllText<T>
+
|name=Create<T>
|args=string data, string filename, Vessel flight = null
+
|args=string filename, Vessel flight = null
|desc=Write a string to a file.
+
|desc=Open a stream that creates a file.
 
}}
 
}}
 
{{MethodsEnd}}
 
{{MethodsEnd}}

Revision as of 06:14, 23 August 2012

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

File Class

summary goes here

Methods

The following are methods included in File.

Signature Description
static bool Exists<T>(string filename, Vessel flight = null) Find out if a file in your IO sandbox exists.
static KSP.IO.FileStream Open<T>(string filename, KSP.IO.FileMode mode, Vessel flight = null) Open a stream that operates on a file.
static KSP.IO.FileStream OpenWrite<T>(string filename, Vessel flight = null) Open a stream that writes to a file.
static void WriteAllText<T>(string data, string filename, Vessel flight = null) Write a string to a file.
static void AppendAllText<T>(string data, string filename, Vessel flight = null) Append a string to a file, or creates it if it doesn't exist.
static KSP.IO.TextWriter AppendText<T>(string filename, Vessel flight = null) Open a stream that appends to a file.
static void Delete<T>(string filename, Vessel flight = null) Delete a file in your IO sandbox.
static string[] ReadAllLines<T>(string filename, Vessel flight = null) Read all lines from a file in your IO sandbox.
static KSP.IO.TextReader OpenText<T>(string filename, Vessel flight = null) Open a stream that operates on a file.
static byte[] ReadAllBytes<T>(string filename, Vessel flight = null) Read all the bytes from a file in your IO sandbox.
static KSP.IO.TextWriter CreateText<T>(string filename, Vessel flight = null) Open a stream that creates a file.
static void WriteAllBytes<T>(byte[] data, string filename, Vessel flight = null) Write a bunch of bytes to a file on disk
static void WriteAllLines<T>(string[] data, string filename, Vessel flight = null) Write an array of strings to a file, with each string becoming a line.
static string ReadAllText<T>(string filename, Vessel flight = null) Read all the text from a file in your IO sandbox.
static KSP.IO.FileStream Create<T>(string filename, Vessel flight = null) Open a stream that creates a file.