Beispiel #1
0
 /// <summary>
 /// Append text to an existing file (encode with UTF-8).
 /// </summary>
 /// <param name="filename">The name (and path) of the file.</param>
 /// <param name="txt">string to append</param>
 public static void Append(string filename, string txt)
 {
     Append(DllTool.GetNullTailUTF8Bytes(filename), DllTool.GetUTF8Bytes(txt));
 }
Beispiel #2
0
 /// <summary>
 /// Creates a new UTF8 text FileData object.
 /// </summary>
 /// <param name="contents">The contents of the file.</param>
 /// <param name="filename">The name of the file.</param>
 /// <returns></returns>
 public static FileData NewFileData(string contents, string filename)
 {
     return(NewFileData(DllTool.GetUTF8Bytes(contents), filename));
 }
Beispiel #3
0
 /// <summary>
 /// Write data to a file in the save directory. If the file existed already, it will be completely replaced by the new contents.
 /// <para>encode with UTF-8</para>
 /// </summary>
 /// <param name="filename">The name (and path) of the file.</param>
 /// <param name="input">The string data to write to the file.</param>
 public static void Write(string filename, string input)
 {
     Write(DllTool.GetNullTailUTF8Bytes(filename), DllTool.GetUTF8Bytes(input));
 }