* Refractored a bit.
[ngenerator.git] / Option.cs
blobb4c4f04136ae795b25ea9b5c99148aa5cdb4ee59
1 // /home/jeremie/TaoParser/NGenerator/Option.cs
2 // Writtent by jeremie at 17:56 09/06/2007
3 //
4 // This file is licensed under the LGPL licence as described in the COPYING file
6 using System;
7 using System.IO;
9 namespace NGenerator
11 public static class Options
13 static bool isSealed = false;
14 static InputType inputType = InputType.SingleFile;
15 static UnsafeLevel unsafeLevel = UnsafeLevel.Safe;
16 static StreamWriter output = null;
17 static FileInfo inputFile;
19 public static void Seal()
21 isSealed = true;
22 if (output == null)
23 output = new StreamWriter("output.cs");
26 public static InputType Input {
27 get {
28 return inputType;
30 set {
31 if (isSealed)
32 return;
33 inputType = value;
37 public static UnsafeLevel Unsafe {
38 get {
39 return unsafeLevel;
41 set {
42 if (isSealed)
43 return;
44 unsafeLevel = value;
48 public static StreamWriter Output {
49 get {
50 return output;
52 set {
53 if (isSealed)
54 return;
55 output = value;
59 public static FileInfo InputFile {
60 get {
61 return inputFile;
63 set {
64 if (isSealed)
65 return;
66 inputFile = value;
71 public enum InputType {
72 SingleFile,
73 Directory
76 public enum UnsafeLevel {
77 // eg use IntPtr
78 Safe,
79 // eg use pointer
80 Unsafe,
81 // eg use pointer internally but give a safe api with IntPtr (take care of the marshalling and all)
82 UnsafeWithWrapper