From dd3d87aff73ba57a06b098a0a54e03d9d9924f8f Mon Sep 17 00:00:00 2001 From: morkt Date: Mon, 3 Aug 2015 22:26:26 +0400 Subject: [PATCH] (Dump): convenient class for tracing/debugging. --- ArcFormats/ArcCommon.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ArcFormats/ArcCommon.cs b/ArcFormats/ArcCommon.cs index e62a694e..d81258b3 100644 --- a/ArcFormats/ArcCommon.cs +++ b/ArcFormats/ArcCommon.cs @@ -401,4 +401,16 @@ namespace GameRes.Formats System.GC.SuppressFinalize (this); } } + + public static class Dump + { + public static string DirectoryName = Environment.GetFolderPath (Environment.SpecialFolder.UserProfile); + + [System.Diagnostics.Conditional("DEBUG")] + public static void Write (byte[] mem, string filename = "index.dat") + { + using (var dump = File.Create (Path.Combine (DirectoryName, filename))) + dump.Write (mem, 0, mem.Length); + } + } }