Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient
In directory sc8-pr-cvs1:/tmp/cvs-serv21474
Modified Files:
PgDbClient.cs PgOutputPacket.cs PgResponsePacket.cs
Log Message:
Added support for path geometric type and finish support for polygon type
Index: PgDbClient.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgDbClient.cs,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** PgDbClient.cs 18 Oct 2003 13:39:02 -0000 1.24
--- PgDbClient.cs 18 Oct 2003 14:46:26 -0000 1.25
***************
*** 667,671 ****
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);
--- 667,671 ----
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, 16);
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: PgOutputPacket.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgOutputPacket.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** PgOutputPacket.cs 18 Oct 2003 12:56:56 -0000 1.12
--- PgOutputPacket.cs 18 Oct 2003 14:46:26 -0000 1.13
***************
*** 178,181 ****
--- 178,197 ----
}
+ public void WritePolygon(PgPolygon polygon)
+ {
+ for (int i = 0; i < polygon.Points.Length; i++)
+ {
+ WritePoint(polygon.Points[0]);
+ }
+ }
+
+ public void WritePath(PgPath path)
+ {
+ for (int i = 0; i < path.Points.Length; i++)
+ {
+ WritePoint(path.Points[0]);
+ }
+ }
+
// Parameters
***************
*** 355,360 ****
break;
- case PgDataType.Path:
case PgDataType.Polygon:
break;
}
--- 371,386 ----
break;
case PgDataType.Polygon:
+ PgPolygon polygon = value as PgPolygon;
+
+ packet.WriteInt(size*polygon.Points.Length);
+ packet.WritePolygon(polygon);
+ break;
+
+ case PgDataType.Path:
+ PgPath path = value as PgPath;
+
+ packet.WriteInt(size*path.Points.Length);
+ packet.WritePath(path);
break;
}
Index: PgResponsePacket.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/NPgClient/PgResponsePacket.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** PgResponsePacket.cs 18 Oct 2003 13:39:02 -0000 1.12
--- PgResponsePacket.cs 18 Oct 2003 14:46:26 -0000 1.13
***************
*** 115,119 ****
#endregion
! #region METHODS
public string ReadNullString()
--- 115,119 ----
#endregion
! #region READ_METHODS
public string ReadNullString()
***************
*** 340,343 ****
--- 340,356 ----
}
+ public PgPath ReadPath()
+ {
+ bool isClosedPath = this.ReadBoolean();
+ PgPoint[] points = new PgPoint[this.ReadInt()];
+
+ for (int i = 0; i < points.Length; i++)
+ {
+ points[i] = this.ReadPoint();
+ }
+
+ return new PgPath(isClosedPath, points);
+ }
+
// Common read method
***************
*** 422,425 ****
--- 435,440 ----
case PgDataType.Path:
+ return this.ReadPath();
+
default:
return ReadBytes(length);
|