diff options
author | lbsa71 | 2008-04-02 13:06:18 +0000 |
---|---|---|
committer | lbsa71 | 2008-04-02 13:06:18 +0000 |
commit | 667ebc8ea29ba93060eee2506f2875ab78ab6216 (patch) | |
tree | d630c9c98fdbbe901b4d941dff25e6bdc77d4772 /OpenSim/Framework/Data.Base/BaseDataReader.cs | |
parent | Set default terrain to complete flat terrain (at 26 height). Even flat terrai... (diff) | |
download | opensim-SC-667ebc8ea29ba93060eee2506f2875ab78ab6216.zip opensim-SC-667ebc8ea29ba93060eee2506f2875ab78ab6216.tar.gz opensim-SC-667ebc8ea29ba93060eee2506f2875ab78ab6216.tar.bz2 opensim-SC-667ebc8ea29ba93060eee2506f2875ab78ab6216.tar.xz |
* Reworked Data Framework so that MSSQL works
* Introduced uint as field type
* Removed what should be superfluous Guid handling
* Introduced stub MySQLDataReader if we need to fix the Guid handling anyway
Diffstat (limited to 'OpenSim/Framework/Data.Base/BaseDataReader.cs')
-rw-r--r-- | OpenSim/Framework/Data.Base/BaseDataReader.cs | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/OpenSim/Framework/Data.Base/BaseDataReader.cs b/OpenSim/Framework/Data.Base/BaseDataReader.cs index cbaac55..3baefcd 100644 --- a/OpenSim/Framework/Data.Base/BaseDataReader.cs +++ b/OpenSim/Framework/Data.Base/BaseDataReader.cs | |||
@@ -31,7 +31,7 @@ using System.IO; | |||
31 | 31 | ||
32 | namespace OpenSim.Framework.Data.Base | 32 | namespace OpenSim.Framework.Data.Base |
33 | { | 33 | { |
34 | public class BaseDataReader | 34 | public abstract class BaseDataReader |
35 | { | 35 | { |
36 | private readonly IDataReader m_source; | 36 | private readonly IDataReader m_source; |
37 | 37 | ||
@@ -112,17 +112,28 @@ namespace OpenSim.Framework.Data.Base | |||
112 | return m_source.Read(); | 112 | return m_source.Read(); |
113 | } | 113 | } |
114 | 114 | ||
115 | public Guid GetGuid(string name) | 115 | public virtual Guid GetGuid(string name) |
116 | { | 116 | { |
117 | string guidString = GetString(name); | 117 | return m_source.GetGuid(m_source.GetOrdinal(name)); |
118 | if (String.IsNullOrEmpty(guidString)) | 118 | } |
119 | { | 119 | |
120 | return Guid.Empty; | 120 | public UInt32 GetUInt32(string name ) |
121 | } | 121 | { |
122 | else | 122 | return (UInt32)GetInt32(name); |
123 | { | 123 | } |
124 | return new Guid(guidString); | 124 | |
125 | } | 125 | private Int32 GetInt32(string name) |
126 | { | ||
127 | int ordinal = m_source.GetOrdinal(name); | ||
128 | int int32 = m_source.GetInt32(ordinal); | ||
129 | return int32; | ||
130 | } | ||
131 | |||
132 | public Int64 GetInt64(string name) | ||
133 | { | ||
134 | int ordinal = m_source.GetOrdinal( name ); | ||
135 | long int64 = m_source.GetInt64(ordinal); | ||
136 | return int64; | ||
126 | } | 137 | } |
127 | } | 138 | } |
128 | } | 139 | } |