* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / Microsoft.Web.Services / Microsoft.Web.Services.Dime / DimeReader.cs
1 //
2 // Microsoft.Web.Services.Dime.DimeReader.cs
3 //
4 // Name: Duncan Mak (duncan@ximian.com)
5 //
6 // Copyright (C) Ximian, Inc. 2003
7 //
8
9 using System;
10 using System.IO;
11
12 namespace Microsoft.Web.Services.Dime {
13
14         public class DimeReader
15         {
16
17                 Stream stream;
18                 bool opened;
19
20                 public DimeReader (Stream stream)
21                 {
22                         if (stream == null)
23                                 throw new ArgumentNullException (
24                                         Locale.GetText ("Argument is null."));
25
26                         if (stream.CanRead == false)
27                                 throw new ArgumentException (
28                                         Locale.GetText ("The stream is not readable"));
29                         
30                         this.stream = stream;
31                         opened = true;
32                 }
33
34                 public void Close ()
35                 {
36                         if (opened == false)
37                                 throw new InvalidOperationException (
38                                         Locale.GetText ("The stream is currently open."));
39                                 
40                         stream.Close ();
41                         opened = false;
42                 }
43
44                 public bool CanRead {
45                         get { return stream.CanRead; }
46                 }
47
48                 [MonoTODO]
49                 public DimeRecord ReadRecord ()
50                 {
51                         if (opened == false)
52                                 throw new InvalidOperationException (
53                                         Locale.GetText ("The stream is currently closed."));
54                         opened = true;
55
56                         throw new NotImplementedException ();
57                 }
58         }
59 }