/// <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)); }
/// <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)); }
/// <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)); }