2003-06-02 Ville Palo <vi64pa@kolumbus.fi>
authorVille Palo <ville@mono-cvs.ximian.com>
Mon, 2 Jun 2003 07:26:48 +0000 (07:26 -0000)
committerVille Palo <ville@mono-cvs.ximian.com>
Mon, 2 Jun 2003 07:26:48 +0000 (07:26 -0000)
* SqlString.cs: implementes less than and greater than operators.
Added some checks to ctor.

svn path=/trunk/mcs/; revision=15066

mcs/class/System.Data/System.Data.SqlTypes/ChangeLog
mcs/class/System.Data/System.Data.SqlTypes/SqlString.cs

index 0238793181b369857498e1e677c49f3a38721ff7..23bdb3bf70c310f943d39b8ea6b39dd17dd1b7a1 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-02  Ville Palo <vi64pa@kolumbus.fi>
+
+       * SqlString.cs: implementes less than and greater than operators.
+       Added some checks to ctor.
+               
 2003-06-01  Ville Palo <vi64pa@kolumbus.fi>
 
        * SqlString.cs: added null checking
index 3809f050012b374e3e1c9d8ee443064671b95994..08be04356a54b5f7a67892dbfefdb746f71442b3 100644 (file)
@@ -124,7 +124,13 @@ namespace System.Data.SqlTypes
                                chars = new char [(count - index) / 2];
                        else
                                chars = new char [count - index];
-                       
+
+                       if (index >= data.Length)
+                               throw new ArgumentOutOfRangeException ("index");
+
+                       if ((index + count) > data.Length)
+                               throw new ArgumentOutOfRangeException ("count");
+
                        int j = 0;
                        for (int i = index; i < chars.Length; i++) {
                                
@@ -406,7 +412,7 @@ namespace System.Data.SqlTypes
                        if (x.IsNull || y.IsNull)
                                return SqlBoolean.Null;
                        else
-                               throw new NotImplementedException ();
+                               return new SqlBoolean (x.CompareTo (y) > 0);
                }
 
                // Greater Than Or Equal
@@ -415,7 +421,7 @@ namespace System.Data.SqlTypes
                        if (x.IsNull || y.IsNull)
                                return SqlBoolean.Null;
                        else
-                               throw new NotImplementedException ();
+                               return new SqlBoolean (x.CompareTo (y) >= 0);
                }
 
                public static SqlBoolean operator != (SqlString x, SqlString y) 
@@ -432,7 +438,7 @@ namespace System.Data.SqlTypes
                        if (x.IsNull || y.IsNull)
                                return SqlBoolean.Null;
                        else
-                               throw new NotImplementedException ();
+                               return new SqlBoolean (x.CompareTo (y) < 0);
                }
 
                // Less Than Or Equal
@@ -441,7 +447,7 @@ namespace System.Data.SqlTypes
                        if (x.IsNull || y.IsNull)
                                return SqlBoolean.Null;
                        else
-                               throw new NotImplementedException ();
+                               return new SqlBoolean (x.CompareTo (y) <= 0);
                }
 
                // **************************************