Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient
In directory sc8-pr-cvs1:/tmp/cvs-serv12363
Modified Files:
PgDbClient.cs PgResponsePacket.cs
Log Message:
Added support for Polygon type ( read only at this moment )
Index: PgDbClient.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** PgDbClient.cs 17 Oct 2003 20:47:55 -0000 1.23
--- PgDbClient.cs 18 Oct 2003 13:39:02 -0000 1.24
***************
*** 665,671 ****
types.Add(600 , "point" , PgDataType.Point , Type.GetType("System.Array") , 701, 1, 16);
types.Add(601 , "lseg" , PgDataType.LSeg , Type.GetType("System.Array") , 600, 1, 32);
! types.Add(602 , "path" , PgDataType.VarChar , Type.GetType("System.String") , 0, 0, -1);
types.Add(603 , "box" , PgDataType.Box , Type.GetType("System.Array") , 600, 1, 32);
! types.Add(604 , "polygon" , PgDataType.VarChar , Type.GetType("System.String") , 0, 0, -1);
types.Add(628 , "line" , PgDataType.Line , Type.GetType("System.Array") , 701, 1, 32);
types.Add(718 , "circle" , PgDataType.Circle , Type.GetType("System.Array") , 0, 1, 24);
--- 665,671 ----
types.Add(600 , "point" , PgDataType.Point , Type.GetType("System.Array") , 701, 1, 16);
types.Add(601 , "lseg" , PgDataType.LSeg , Type.GetType("System.Array") , 600, 1, 32);
! types.Add(602 , "path" , PgDataType.Path , Type.GetType("System.Array") , 0, 1, -1);
types.Add(603 , "box" , PgDataType.Box , Type.GetType("System.Array") , 600, 1, 32);
! types.Add(604 , "polygon" , PgDataType.Polygon , Type.GetType("System.Array") , 0, 1, -1);
types.Add(628 , "line" , PgDataType.Line , Type.GetType("System.Array") , 701, 1, 32);
types.Add(718 , "circle" , PgDataType.Circle , Type.GetType("System.Array") , 0, 1, 24);
Index: PgResponsePacket.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgResponsePacket.cs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PgResponsePacket.cs 18 Oct 2003 12:56:56 -0000 1.11
--- PgResponsePacket.cs 18 Oct 2003 13:39:02 -0000 1.12
***************
*** 108,111 ****
--- 108,116 ----
}
+ public byte[] ToArray()
+ {
+ return ((MemoryStream)BaseStream).ToArray();
+ }
+
#endregion
***************
*** 323,326 ****
--- 328,343 ----
}
+ public PgPolygon ReadPolygon()
+ {
+ PgPoint[] points = new PgPoint[this.ReadInt()];
+
+ for (int i = 0; i < points.Length; i++)
+ {
+ points[i] = this.ReadPoint();
+ }
+
+ return new PgPolygon(points);
+ }
+
// Common read method
***************
*** 401,406 ****
return this.ReadBox();
- case PgDataType.Path:
case PgDataType.Polygon:
default:
return ReadBytes(length);
--- 418,425 ----
return this.ReadBox();
case PgDataType.Polygon:
+ return this.ReadPolygon();
+
+ case PgDataType.Path:
default:
return ReadBytes(length);
|