Difference between revisions of "API:File"
From Kerbal Space Program Wiki
(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...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | <!-- Autogenerated by DOCTOOL. 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={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} | ||
+ | |desc=Find out if a file in your IO sandbox exists. | ||
+ | }} | ||
+ | {{StaticMethod | ||
+ | |returntype=KSP.IO.FileStream | ||
+ | |returndesc= | ||
+ | |name=Open<T> | ||
+ | |args={{arg|string|filename}}, {{arg|KSP.IO.FileMode|mode}}, {{arg|Vessel|flight|default=null}} | ||
+ | |desc=Open a stream that operates on a file. | ||
+ | }} | ||
+ | {{StaticMethod | ||
+ | |returntype=KSP.IO.FileStream | ||
+ | |returndesc= | ||
+ | |name=OpenWrite<T> | ||
+ | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} | ||
+ | |desc=Open a stream that writes to a file. | ||
+ | }} | ||
+ | {{StaticMethod | ||
+ | |returntype=void | ||
+ | |returndesc= | ||
+ | |name=WriteAllText<T> | ||
+ | |args={{arg|string|data}}, {{arg|string|filename}}, {{arg|Vessel|flight|default=null}} | ||
+ | |desc=Write a string to a file. | ||
+ | }} | ||
+ | {{StaticMethod | ||
+ | |returntype=void | ||
+ | |returndesc= | ||
+ | |name=AppendAllText<T> | ||
+ | |args={{arg|string|data}}, {{arg|string|filename}}, {{arg|Vessel|flight|default=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={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} | ||
+ | |desc=Open a stream that appends to a file. | ||
+ | }} | ||
{{StaticMethod | {{StaticMethod | ||
|returntype=void | |returntype=void | ||
|returndesc= | |returndesc= | ||
|name=Delete<T> | |name=Delete<T> | ||
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Delete a file in your IO sandbox. | |desc=Delete a file in your IO sandbox. | ||
}} | }} | ||
{{StaticMethod | {{StaticMethod | ||
− | |returntype= | + | |returntype=string |
+ | |array=[] | ||
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadAllLines<T> |
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
− | |desc= | + | |desc=Read all lines from a file in your IO sandbox. |
}} | }} | ||
{{StaticMethod | {{StaticMethod | ||
− | |returntype= | + | |returntype=KSP.IO.TextReader |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=OpenText<T> |
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
− | |desc= | + | |desc=Open a stream that operates on a file. |
}} | }} | ||
{{StaticMethod | {{StaticMethod | ||
− | |returntype= | + | |returntype=byte |
+ | |array=[] | ||
|returndesc= | |returndesc= | ||
− | |name= | + | |name=ReadAllBytes<T> |
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
− | |desc=Read all | + | |desc=Read all the bytes from a file in your IO sandbox. |
}} | }} | ||
{{StaticMethod | {{StaticMethod | ||
− | |returntype= | + | |returntype=KSP.IO.TextWriter |
|returndesc= | |returndesc= | ||
− | |name= | + | |name=CreateText<T> |
− | |args=string filename, Vessel flight = null | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
− | |desc= | + | |desc=Open a stream that creates a file. |
}} | }} | ||
{{StaticMethod | {{StaticMethod | ||
Line 43: | Line 89: | ||
|returndesc= | |returndesc= | ||
|name=WriteAllBytes<T> | |name=WriteAllBytes<T> | ||
− | |args=byte[] | + | |args={{arg|byte|data|array=[]}}, {{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Write a bunch of bytes to a file on disk | |desc=Write a bunch of bytes to a file on disk | ||
}} | }} | ||
Line 50: | Line 96: | ||
|returndesc= | |returndesc= | ||
|name=WriteAllLines<T> | |name=WriteAllLines<T> | ||
− | |args=string[] | + | |args={{arg|string|data|array=[]}}, {{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
|desc=Write an array of strings to a file, with each string becoming a line. | |desc=Write an array of strings to a file, with each string becoming a line. | ||
}} | }} | ||
{{StaticMethod | {{StaticMethod | ||
− | |returntype= | + | |returntype=string |
+ | |returndesc= | ||
+ | |name=ReadAllText<T> | ||
+ | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} | ||
+ | |desc=Read all the text from a file in your IO sandbox. | ||
+ | }} | ||
+ | {{StaticMethod | ||
+ | |returntype=KSP.IO.FileStream | ||
|returndesc= | |returndesc= | ||
− | |name= | + | |name=Create<T> |
− | |args=string | + | |args={{arg|string|filename}}, {{arg|Vessel|flight|default=null}} |
− | |desc= | + | |desc=Open a stream that creates a file. |
}} | }} | ||
{{MethodsEnd}} | {{MethodsEnd}} |
Latest revision as of 21:35, 12 October 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. |