2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / System.Data / System.Data.Common / DbDataReader.cs
1 //
2 // System.Data.Common.DbDataReader.cs
3 //
4 // Author:
5 //   Tim Coleman (tim@timcoleman.com)
6 //
7 // Copyright (C) Tim Coleman, 2003
8 //
9
10 //
11 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
20 // 
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
23 // 
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 //
32
33 #if NET_2_0
34
35 using System.Collections;
36 using System.Data;
37
38 namespace System.Data.Common {
39         public abstract class DbDataReader : MarshalByRefObject, IDataReader, IDataReader2, IDataRecord, IDataRecord2, IDisposable, IEnumerable
40         {
41                 #region Constructors
42
43                 protected DbDataReader ()
44                 {
45                 }
46
47                 #endregion // Constructors
48
49                 #region Properties
50
51                 public abstract int Depth { get; }
52                 public abstract int FieldCount { get; }
53                 public abstract bool HasRows { get; }
54                 public abstract bool IsClosed { get; }
55                 public abstract object this [int index] { get; }
56                 public abstract object this [string name] { get; }
57                 public abstract int RecordsAffected { get; }
58                 public abstract int VisibleFieldCount { get; }
59
60                 #endregion // Properties
61
62                 #region Methods
63
64                 public abstract void Close ();
65                 public abstract void Dispose ();
66                 public abstract bool GetBoolean (int i);
67                 public abstract byte GetByte (int i);
68                 public abstract long GetBytes (int i, long fieldOffset, byte[] buffer, int bufferOffset, int length);
69                 public abstract char GetChar (int i);
70                 public abstract long GetChars (int i, long dataIndex, char[] buffer, int bufferIndex, int length);
71
72                 [MonoTODO]
73                 public DbDataReader GetData (int i)
74                 {
75                         throw new NotImplementedException ();
76                 }
77
78                 public abstract string GetDataTypeName (int i);
79                 public abstract DateTime GetDateTime (int i);
80                 public abstract decimal GetDecimal (int i);
81                 public abstract double GetDouble (int i);
82                 public abstract IEnumerator GetEnumerator ();
83                 public abstract Type GetFieldProviderSpecificType (int i);
84                 public abstract Type GetFieldType (int i);
85                 public abstract float GetFloat (int i);
86                 public abstract Guid GetGuid (int i);
87                 public abstract short GetInt16 (int i);
88                 public abstract int GetInt32 (int i);
89                 public abstract long GetInt64 (int i);
90                 public abstract string GetName (int i);
91                 public abstract int GetOrdinal (string name);
92                 public abstract object GetProviderSpecificValue (int i);
93                 public abstract int GetProviderSpecificValues (object[] values);
94                 public abstract DataTable GetSchemaTable ();
95                 public abstract string GetString (int i);
96                 public abstract object GetValue (int i);
97                 public abstract int GetValues (object[] values);
98
99                 IDataReader IDataRecord.GetData (int i)
100                 {
101                         return ((IDataReader) this).GetData (i);
102                 }
103
104                 public abstract bool IsDBNull (int i);
105                 public abstract bool NextResult ();
106                 public abstract bool Read ();
107
108                 #endregion // Methods
109         }
110 }
111
112 #endif // NET_2_0