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