From 71f662c33e9938951eec3da97140aed25aa815d7 Mon Sep 17 00:00:00 2001 From: csharptest Date: Fri, 20 May 2011 15:15:34 -0500 Subject: reformatted all code to .NET standard formatting --- src/ProtoGen.Test/TempFile.cs | 113 ++++++++++++++++++++++-------------------- 1 file changed, 59 insertions(+), 54 deletions(-) (limited to 'src/ProtoGen.Test/TempFile.cs') diff --git a/src/ProtoGen.Test/TempFile.cs b/src/ProtoGen.Test/TempFile.cs index e41b591b..74a183f5 100644 --- a/src/ProtoGen.Test/TempFile.cs +++ b/src/ProtoGen.Test/TempFile.cs @@ -1,54 +1,59 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; - -namespace Google.ProtocolBuffers.ProtoGen -{ - class ProtoFile : TempFile - { - public ProtoFile(string filename, string contents) - : base(filename, contents) - { - } - } - class TempFile : IDisposable - { - private string tempFile; - - public static TempFile Attach(string path) - { - return new TempFile(path, null); - } - - protected TempFile(string filename, string contents) { - tempFile = filename; - if (contents != null) - { - File.WriteAllText(tempFile, contents, new UTF8Encoding(false)); - } - } - - public TempFile(string contents) - : this(Path.GetTempFileName(), contents) - { - } - - public string TempPath { get { return tempFile; } } - - public void ChangeExtension(string ext) - { - string newFile = Path.ChangeExtension(tempFile, ext); - File.Move(tempFile, newFile); - tempFile = newFile; - } - - public void Dispose() - { - if (File.Exists(tempFile)) - { - File.Delete(tempFile); - } - } - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Google.ProtocolBuffers.ProtoGen +{ + internal class ProtoFile : TempFile + { + public ProtoFile(string filename, string contents) + : base(filename, contents) + { + } + } + + internal class TempFile : IDisposable + { + private string tempFile; + + public static TempFile Attach(string path) + { + return new TempFile(path, null); + } + + protected TempFile(string filename, string contents) + { + tempFile = filename; + if (contents != null) + { + File.WriteAllText(tempFile, contents, new UTF8Encoding(false)); + } + } + + public TempFile(string contents) + : this(Path.GetTempFileName(), contents) + { + } + + public string TempPath + { + get { return tempFile; } + } + + public void ChangeExtension(string ext) + { + string newFile = Path.ChangeExtension(tempFile, ext); + File.Move(tempFile, newFile); + tempFile = newFile; + } + + public void Dispose() + { + if (File.Exists(tempFile)) + { + File.Delete(tempFile); + } + } + } +} \ No newline at end of file -- cgit v1.2.3