**** Merged from MCS ****
[mono-project.git] / mcs / class / Npgsql / Npgsql / NpgsqlExecute.cs
blob8b9f3e7fd2f43e902871f80ac99110f57f25c6e4
1 // created on 1/7/2003 at 20:03
2 // Npgsql.NpgsqlExecute.cs
3 //
4 // Author:
5 // Francisco Jr. (fxjrlists@yahoo.com.br)
6 //
7 // Copyright (C) 2002 The Npgsql Development Team
8 // npgsql-general@gborg.postgresql.org
9 // http://gborg.postgresql.org/project/npgsql/projdisplay.php
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU Lesser General Public
13 // License as published by the Free Software Foundation; either
14 // version 2.1 of the License, or (at your option) any later version.
16 // This library is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 // Lesser General Public License for more details.
21 // You should have received a copy of the GNU Lesser General Public
22 // License along with this library; if not, write to the Free Software
23 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 using System;
26 using System.IO;
27 using System.Text;
29 namespace Npgsql
32 /// <summary>
33 /// This class represents the Parse message sent to PostgreSQL
34 /// server.
35 /// </summary>
36 ///
37 internal sealed class NpgsqlExecute
39 // Logging related values
40 private static readonly String CLASSNAME = "NpgsqlExecute";
42 private String _portalName;
43 private Int32 _maxRows;
46 public NpgsqlExecute(String portalName, Int32 maxRows)
48 _portalName = portalName;
49 _maxRows = maxRows;
52 public String PortalName
54 get
56 return _portalName;
60 public void WriteToStream(Stream outputStream, Encoding encoding)
62 outputStream.WriteByte((Byte)'E');
64 PGUtil.WriteInt32(outputStream, 4 +
65 encoding.GetByteCount(_portalName) + 1 +
66 4);
68 PGUtil.WriteString(_portalName, outputStream, encoding);
69 PGUtil.WriteInt32(outputStream, _maxRows);