/** * バイナリ形式のログファイルにログを出力する * * @output fs: 書き込み先のファイルオブジェクト * @output encoding: 文字列のエンコードタイプ */ public override void WriteToBinFile(UFileStream fs, Encoding encoding) { // Type of log (Area) fs.WriteByte((byte)LogType.Area); // Length of area name // Area name fs.WriteSizeString(name, encoding); // parent area name fs.WriteSizeString(parentName, encoding); // color fs.WriteUInt32(color); }
/** * バイナリ形式のログファイルにログを出力する * * @input fs: 書き込み先のファイルオブジェクト * @input encoding: 文字列を出力する場合のエンコードタイプ */ public override void WriteToBinFile(UFileStream fs, Encoding encoding) { // ID fs.WriteUInt32(id); // Name fs.WriteSizeString(name, encoding); // Color fs.WriteUInt32(color); }
/** * バイナリ形式のログをファイルに書き込む * * @input fs : 書き込み先のファイルオブジェクト * @input encoding: 文字列のエンコードタイプ */ public override void WriteToBinFile(UFileStream fs, Encoding encoding) { // ID fs.WriteUInt32(id); // ID名 fs.WriteSizeString(name, encoding); // 色 fs.WriteUInt32(color); // アイコン画像名の長さ // アイコン画像名 if (imageName == null) { // 長さ:0 = なし fs.WriteUInt32((UInt32)0); } else { fs.WriteSizeString(imageName, encoding); } }
/** * バイナリ形式のログファイルにログを出力する * * @output fs: 書き込み先のファイルオブジェクト * @output encoding: 文字列のエンコードタイプ */ public override void WriteToBinFile(UFileStream fs, Encoding encoding) { // データログ fs.WriteByte((byte)LogType.Data); // ログID fs.WriteUInt32(logId); // ログタイプ fs.WriteByte((byte)logType); // 表示レーンID fs.WriteUInt32(laneId); if (text == null) { //タイトルの長さ fs.WriteUInt32((UInt32)0); } else { //タイトル fs.WriteSizeString(text, encoding); } //時間 fs.WriteDouble(time); if (detail == null) { // ログデータ(詳細)の種類 fs.WriteByte((byte)DetailDataType.None); } else { // ログデータ(詳細)の種類 fs.WriteByte(detail.dataTypeByte()); // ログデータ(詳細) fs.WriteSizeString(detail.ToString(), encoding); } }
/** * バイナリ形式のログをファイルに書き込む * * @input fs : 書き込み先のファイルオブジェクト * @input encoding : 文字列のエンコードタイプ */ public override void WriteToBinFile(UFileStream fs, Encoding encoding) { // 名前 fs.WriteSizeString(name, encoding); // 画像データ // 指定の画像ファイルをメモリに展開し書き込む try { // 画像ファイルから画像のbyte配列を取得する if (imagePath != null && File.Exists(imagePath)) { fs.WriteSizeBytes(File.ReadAllBytes(imagePath)); } } catch (Exception e) { Console.WriteLine(e.Message); } }
/** * バイナリ形式のヘッダーを書き込む */ public void WriteHeaderBin() { // 新規 using (UFileStream fs = new UFileStream(logFilePath, FileMode.Create, FileAccess.Write)) { // ファイルの種別 fs.WriteString(IdentBin); // エンコードの長さ // エンコード fs.WriteSizeString(UUtility.GetEncodingStr(encoding), Encoding.UTF8); // ID情報 logIDs.WriteToBinFile(fs); // レーン情報 lanes.WriteToBinFile(fs); // Icon image images.WriteToBinFile(fs); } }