[pgsqlclient-checkins] pgsqlclient_10/PostgreSql.Data.PgSqlClient/source PgDataReader.cs,1.10,1.11
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2003-10-26 14:57:25
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1:/tmp/cvs-serv10531 Modified Files: PgDataReader.cs Log Message: * source/PgDataReader.cs: - Added changes for handle new supported types and in SqlClient and OracleClient - New types are PgBox, PgCircle, PgPath, PgPoint, PgLSeg, PgPolygon and PgTimeSpan. * source/PgTypes/PgBox.cs: * source/PgTypes/PgCircle.cs: * source/PgTypes/PgLSeg.cs: * source/PgTypes/PgPath.cs: * source/PgTypes/PgPoint.cs: * source/PgTypes/PgPolygon.cs: - Changed to be structs instead of classes. * source/PgTypes/PgTimeSpan.cs: - New struct type for handle PostgreSQL interval types. Index: PgDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataReader.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PgDataReader.cs 17 Oct 2003 18:21:14 -0000 1.10 --- PgDataReader.cs 26 Oct 2003 14:56:38 -0000 1.11 *************** *** 24,29 **** --- 24,31 ---- using System.Reflection; using System.ComponentModel; + using PostgreSql.Data.NPgClient; using PostgreSql.Data.PgSqlClient.DbSchema; + using PostgreSql.Data.PgTypes; namespace PostgreSql.Data.PgSqlClient *************** *** 394,398 **** } ! public Object GetValue(int i) { if (position == STARTPOS) --- 396,400 ---- } ! public object GetValue(int i) { if (position == STARTPOS) *************** *** 555,558 **** --- 557,622 ---- return Convert.ToDateTime(GetValue(i)); + } + + public TimeSpan GetTimeSpan(int i) + { + if (position == STARTPOS) + { + throw new InvalidOperationException("There are no data to read."); + } + + return (TimeSpan)GetValue(i); + } + + public PgPoint GetPgPoint(int i) + { + return (PgPoint)this.GetPgValue(i); + } + + public PgBox GetPgBox(int i) + { + return (PgBox)this.GetPgValue(i); + } + + public PgLSeg GetPgLSeg(int i) + { + return (PgLSeg)this.GetPgValue(i); + } + + public PgCircle GetPgCircle(int i) + { + return (PgCircle)this.GetPgValue(i); + } + + public PgPath GetPgPath(int i) + { + return (PgPath)this.GetPgValue(i); + } + + public PgPolygon GetPgPolygon(int i) + { + return (PgPolygon)this.GetPgValue(i); + } + + public PgTimeSpan GetPgTimeSpan(int i) + { + return new PgTimeSpan(this.GetTimeSpan(i)); + } + + public object GetPgValue(int i) + { + switch (this.getProviderType(i)) + { + case PgDbType.Interval: + return this.GetPgTimeSpan(i); + + default: + return this.getValue(i); + } + } + + public int GetPgValues(object[] values) + { + return this.GetValues(values); } |