2005-04-12 Dick Porter <dick@ximian.com>
[mono.git] / mcs / ilasm / Report.cs
1 //
2 // Mono.ILASM.Report
3 //
4 // Author(s):
5 //  Jackson Harper (Jackson@LatitudeGeo.com)
6 //
7 // (C) 2003 Jackson Harper, All rights reserved
8 //
9
10
11 using System;
12 using System.IO;
13
14 namespace Mono.ILASM {
15
16         public class Report {
17
18                 private int error_count;
19                 private int mark_count;
20                 private bool quiet;
21
22                 public Report () : this (false)
23                 {
24
25                 }
26
27                 public Report (bool quiet)
28                 {
29                         this.error_count = 0;
30                         this.quiet = quiet;
31                 }
32
33                 public int ErrorCount {
34                         get { return error_count; }
35                 }
36
37                 public void AssembleFile (string file, string listing,
38                                           string target, string output)
39                 {
40                         Console.WriteLine ("Assembling '{0}' , {1}, to {2} --> '{3}'", file,
41                                            GetListing (listing), target, output);
42                         Console.WriteLine ();
43                 }
44
45                 public void Error (string message)
46                 {
47                         error_count++;
48                         Console.WriteLine (message);
49                 }
50
51                 public void Message (string message)
52                 {
53                         if (quiet)
54                                 return;
55                         Console.WriteLine (message);
56                 }
57                 
58                 private string GetListing (string listing)
59                 {
60                         if (listing == null)
61                                 return "no listing file";
62                         return listing;
63                 }
64
65         }
66
67 }
68