-
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
-//
+//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
-//
+//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//
using System;
using System.Collections;
+using System.Reflection;
+#if !FULL_AOT_RUNTIME
+using System.Reflection.Emit;
+#endif
namespace System.Data.Common
{
- internal abstract class AbstractDataContainer
- {
- #region Fields
-
- BitArray _nullValues;
+ internal abstract class DataContainer {
+ BitArray null_values;
System.Type _type;
DataColumn _column;
- #endregion //Fields
-
- #region Properties
+ // implementing class protocol
+ protected internal abstract object GetValue (int index);
+ internal abstract long GetInt64 (int index);
+
+ // used to set the array value to something neutral when the corresponding item is null (in the database sense)
+ // note: we don't actually ever look at the value written there, but the GC may like us to avoid keeping stale
+ // values in the array.
+ protected abstract void ZeroOut (int index);
+ protected abstract void SetValue (int index, object value);
+ protected abstract void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field);
+
+ protected abstract void DoCopyValue (DataContainer from, int from_index, int to_index);
+ protected abstract int DoCompareValues (int index1, int index2);
+
+ protected abstract void Resize (int length);
+
+ internal object this [int index] {
+ get { return IsNull (index) ? DBNull.Value : GetValue (index); }
+ set {
+ if (value == null) {
+ // Table might not have a default values row to copy from
+ if (Column.Table.DefaultValuesRowIndex == -1) {
+ ZeroOut (index);
+ null_values [index] = true;
+ } else {
+ CopyValue (Column.Table.DefaultValuesRowIndex, index);
+ }
+ return;
+ }
- internal abstract object this[int index] {
- get;
- set;
+ bool is_dbnull = value == DBNull.Value;
+ if (is_dbnull)
+ ZeroOut (index);
+ else
+ SetValue (index, value);
+ null_values [index] = is_dbnull;
+ }
}
- internal virtual int Capacity {
- get {
- return (_nullValues != null) ? _nullValues.Count : 0;
- }
- set {
- if (_nullValues == null) {
- _nullValues = new BitArray(value);
- }
- else {
- _nullValues.Length = value;
- }
+ internal int Capacity {
+ get { return null_values != null ? null_values.Count : 0; }
+ set {
+ int old_capacity = Capacity;
+ if (value == old_capacity)
+ return;
+ if (null_values == null)
+ null_values = new BitArray (value);
+ else
+ null_values.Length = value;
+ Resize (value);
}
}
internal Type Type {
- get {
- return _type;
- }
+ get { return _type; }
}
protected DataColumn Column {
- get {
- return _column;
- }
+ get { return _column; }
}
- #endregion //Properties
-
- #region Methods
-
- internal static AbstractDataContainer CreateInstance(Type type, DataColumn column)
+ internal static DataContainer Create (Type type, DataColumn column)
{
- AbstractDataContainer container;
+ DataContainer container;
switch (Type.GetTypeCode(type)) {
- case TypeCode.Int16 :
- container = new Int16DataContainer();
- break;
- case TypeCode.Int32 :
- container = new Int32DataContainer();
- break;
- case TypeCode.Int64 :
- container = new Int64DataContainer();
- break;
- case TypeCode.String :
- container = new StringDataContainer();
- break;
- case TypeCode.Boolean:
- container = new BitDataContainer();
- break;
- case TypeCode.Byte :
- container = new ByteDataContainer();
- break;
- //case TypeCode.Char :
- case TypeCode.DateTime :
- container = new DateTimeDataContainer();
- break;
- //case TypeCode.Decimal :
- case TypeCode.Double :
- container = new DoubleDataContainer();
- break;
- //case TypeCode.SByte :
- case TypeCode.Single :
- container = new SingleDataContainer();
- break;
- //case TypeCode.UInt16 :
- //case TypeCode.UInt32 :
- //case TypeCode.UInt64 :
- default :
- container = new ObjectDataContainer();
- break;
+ case TypeCode.Int16:
+ container = new Int16DataContainer ();
+ break;
+ case TypeCode.Int32:
+ container = new Int32DataContainer ();
+ break;
+ case TypeCode.Int64:
+ container = new Int64DataContainer ();
+ break;
+ case TypeCode.String:
+ container = new StringDataContainer ();
+ break;
+ case TypeCode.Boolean:
+ container = new BitDataContainer ();
+ break;
+ case TypeCode.Byte:
+ container = new ByteDataContainer ();
+ break;
+ case TypeCode.Char:
+ container = new CharDataContainer ();
+ break;
+ case TypeCode.Double:
+ container = new DoubleDataContainer ();
+ break;
+ case TypeCode.SByte:
+ container = new SByteDataContainer ();
+ break;
+ case TypeCode.Single:
+ container = new SingleDataContainer ();
+ break;
+ case TypeCode.UInt16:
+ container = new UInt16DataContainer ();
+ break;
+ case TypeCode.UInt32:
+ container = new UInt32DataContainer ();
+ break;
+ case TypeCode.UInt64:
+ container = new UInt64DataContainer ();
+ break;
+ case TypeCode.DateTime:
+ container = new DateTimeDataContainer ();
+ break;
+ case TypeCode.Decimal:
+ container = new DecimalDataContainer ();
+ break;
+ default:
+ container = new ObjectDataContainer ();
+ break;
}
container._type = type;
container._column = column;
return container;
}
- internal bool IsNull(int index)
+ internal static object GetExplicitValue (object value)
{
- return (_nullValues != null) ? _nullValues[index] : true;
+ Type valueType = value.GetType ();
+ MethodInfo method = valueType.GetMethod ("op_Explicit", new Type[]{valueType});
+ if (method != null)
+ return (method.Invoke (value, new object[]{value}));
+ return null;
}
-
- internal void SetNullBit(int index,bool isNull)
+
+ internal object GetContainerData (object value)
+ {
+ object obj;
+ TypeCode tc;
+
+ if (value == null)
+ return null;
+
+ if (_type.IsInstanceOfType (value)) {
+ return value;
+ } else if ((tc = Type.GetTypeCode (_type)) == TypeCode.String) {
+ return (Convert.ToString (value));
+ } else if (value is IConvertible) {
+ switch (tc) {
+ case TypeCode.Int16:
+ return (Convert.ToInt16 (value));
+ case TypeCode.Int32:
+ return (Convert.ToInt32 (value));
+ case TypeCode.Int64:
+ return (Convert.ToInt64 (value));
+ case TypeCode.Boolean:
+ return (Convert.ToBoolean (value));
+ case TypeCode.Byte:
+ return (Convert.ToByte (value));
+ case TypeCode.Char:
+ return (Convert.ToChar (value));
+ case TypeCode.Double:
+ return (Convert.ToDouble (value));
+ case TypeCode.SByte:
+ return (Convert.ToSByte (value));
+ case TypeCode.Single:
+ return (Convert.ToSingle (value));
+ case TypeCode.UInt16:
+ return (Convert.ToUInt16 (value));
+ case TypeCode.UInt32:
+ return (Convert.ToUInt32 (value));
+ case TypeCode.UInt64:
+ return (Convert.ToUInt64 (value));
+ case TypeCode.DateTime:
+ if (value == DBNull.Value)
+ return DBNull.Value;
+ return (Convert.ToDateTime (value));
+ case TypeCode.Decimal:
+ return (Convert.ToDecimal (value));
+ default:
+ throw new InvalidCastException (string.Format ("Cannot convert from {0} to {1}", value.GetType ().FullName, _type.FullName));
+ }
+ } else if ((obj = GetExplicitValue (value)) != null) {
+ return (obj);
+ } else {
+ throw new InvalidCastException ();
+ }
+ }
+
+ internal bool IsNull (int index)
{
- _nullValues[index] = isNull;
+ return null_values == null || null_values [index];
}
- protected void SetNull(int index,bool isNull,bool isDbNull)
+ internal void FillValues (int fromIndex)
{
- SetNullBit(index,isDbNull);
- // this method must be called after setting the value into value array
- // otherwise the dafault value will be overriden
- if ( isNull ) {
- // set the value to default
- CopyValue(Column.Table.DefaultValuesRowIndex,index);
- }
+ for (int i = 0; i < Capacity; i++)
+ CopyValue (fromIndex, i);
}
- internal void FillValues(int fromIndex)
+ internal void CopyValue (int from_index, int to_index)
{
- for(int i=0; i < Capacity; i++) {
- CopyValue(fromIndex,i);
- _nullValues[i] = _nullValues[fromIndex];
- }
+ CopyValue (this, from_index, to_index);
}
- internal virtual void CopyValue(AbstractDataContainer fromContainer, int fromIndex, int toIndex)
+ internal void CopyValue (DataContainer from, int from_index, int to_index)
{
- _nullValues[toIndex] = fromContainer._nullValues[fromIndex];
+ DoCopyValue (from, from_index, to_index);
+ null_values [to_index] = from.null_values [from_index];
}
- internal virtual void CopyValue(int fromIndex, int toIndex)
+ internal void SetItemFromDataRecord (int index, IDataRecord record, int field)
{
- _nullValues[toIndex] = _nullValues[fromIndex];
+ if (record.IsDBNull (field))
+ this [index] = DBNull.Value;
+ else if (record is ISafeDataRecord)
+ SetValueFromSafeDataRecord (index, (ISafeDataRecord) record, field);
+ else
+ this [index] = record.GetValue (field);
}
- internal virtual void SetItemFromDataRecord(int index, IDataRecord record, int field)
+ internal int CompareValues (int index1, int index2)
{
- bool isDbNull = record.IsDBNull(field);
- SetNull(index,false,isDbNull);
+ bool null1 = IsNull (index1);
+ bool null2 = IsNull (index2);
+
+ if (null1 == null2)
+ return null1 ? 0 : DoCompareValues (index1, index2);
+ return null1 ? -1 : 1;
}
+ }
+
+ sealed class BitDataContainer : DataContainer {
+ BitArray _values;
- protected bool CheckAndSetNull( int index, IDataRecord record, int field)
+ protected internal override object GetValue (int index)
{
- bool isDbNull = record.IsDBNull(field);
- SetNull(index,false,isDbNull);
- return isDbNull;
+ return _values [index];
}
- protected int CompareNulls(int index1, int index2)
+ protected override void ZeroOut (int index)
{
- bool null1 = IsNull(index1);
- bool null2 = IsNull(index2);
+ _values [index] = false;
+ }
- if ( null1 ^ null2 ) {
- return null1 ? -1 : 1;
- }
- else {
- return 0;
- }
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = (bool) GetContainerData (value);
}
- internal abstract int CompareValues(int index1, int index2);
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ _values [index] = record.GetBooleanSafe (field);
+ }
- internal abstract long GetInt64(int index);
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (bool) GetContainerData (from.GetValue (from_index));
+ }
- #endregion //Methods
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ bool val1 = _values [index1];
+ bool val2 = _values [index2];
+ return val1 == val2 ? 0 : val1 ? 1 : -1;
+ }
- sealed class Int16DataContainer : AbstractDataContainer
+ protected override void Resize (int size)
{
- #region Fields
-
- short[] _values;
+ if (_values == null)
+ _values = new BitArray (size);
+ else
+ _values.Length = size;
+ }
- #endregion //Fields
+ internal override long GetInt64 (int index)
+ {
+ return Convert.ToInt64 (_values [index]);
+ }
+ }
- #region Properties
+ sealed class CharDataContainer : DataContainer {
+ char [] _values;
- internal override object this[int index] {
- get {
- if (IsNull(index)) {
- return DBNull.Value;
- }
- else {
- return _values[index];
- }
- }
- set {
- bool isDbNull = (value == DBNull.Value);
- if (value == null || isDbNull) {
- SetValue(index,0);
- }
- else if( value is short ) {
- SetValue(index,(short)value);
- }
- else {
- try {
- SetValue(index,Convert.ToInt16(value));
- } catch (Exception ex) {
- throw new ArgumentException (ex.Message, ex);
- }
- }
- SetNull(index,value == null,isDbNull);
- }
- }
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- internal override int Capacity {
- set {
- base.Capacity = value;
- if (_values == null) {
- _values = new short[value];
- }
- else {
- short[] tmp = new short[value];
- Array.Copy(_values,0,tmp,0,_values.Length);
- _values = tmp;
- }
- }
- }
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = '\0';
+ }
- #endregion //Properties
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = (char) GetContainerData (value);
+ }
- #region Methods
-
- private void SetValue(int index, short value)
- {
- _values[index] = value;
- }
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ _values [index] = record.GetCharSafe (field);
+ }
- internal override void SetItemFromDataRecord(int index, IDataRecord record, int field)
- {
- // if exception thrown, it should be caught
- // in the caller method
- if (!CheckAndSetNull ( index, record,field))
- SetValue(index,record.GetInt16(field));
- }
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (char) GetContainerData (from.GetValue (from_index));
+ }
- internal override void CopyValue(int fromIndex, int toIndex)
- {
- base.CopyValue(fromIndex, toIndex);
- _values[toIndex] = _values[fromIndex];
- }
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ char val1 = _values [index1];
+ char val2 = _values [index2];
+ return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
+ }
- internal override void CopyValue(AbstractDataContainer fromContainer, int fromIndex, int toIndex)
- {
- base.CopyValue(fromContainer, fromIndex, toIndex);
- _values[toIndex] = ((Int16DataContainer)fromContainer)._values[fromIndex];
+ protected override void Resize (int size)
+ {
+ if (_values == null) {
+ _values = new char [size];
+ return;
}
- internal override int CompareValues(int index1, int index2)
- {
- short s1 = _values[index1];
- short s2 = _values[index2];
-
- if ( s1 == 0 && s2 == 0 ) {
- int cn = CompareNulls(index1, index2);
- return cn;
- }
-
- bool b1 = IsNull(index1);
- bool b2 = IsNull(index2);
-
- if ( s1 == 0 && b1 ) {
- return -1;
- }
+ char[] tmp = new char [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
+ }
- if ( s2 == 0 && b2 ) {
- return 1;
- }
+ internal override long GetInt64 (int index)
+ {
+ return Convert.ToInt64 (_values [index]);
+ }
+ }
- if ( s1 <= s2 ) {
- return ( s1 != s2 ) ? -1 : 0;
- }
- return 1;
- }
+ sealed class ByteDataContainer : DataContainer {
+ byte [] _values;
- internal override long GetInt64(int index)
- {
- return (long) _values[index];
- }
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- #endregion //Methods
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = 0;
}
- sealed class Int32DataContainer : AbstractDataContainer
+ protected override void SetValue (int index, object value)
{
- #region Fields
-
- int[] _values;
+ _values [index] = (byte) GetContainerData (value);
+ }
- #endregion //Fields
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ _values [index] = record.GetByteSafe (field);
+ }
- #region Properties
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (byte) GetContainerData (from.GetValue (from_index));
+ }
- internal override object this[int index] {
- get {
- if (IsNull(index)) {
- return DBNull.Value;
- }
- else {
- return _values[index];
- }
- }
- set {
- bool isDbNull = (value == DBNull.Value);
- if (value == null || isDbNull) {
- SetValue(index,0);
- }
- else if( value is int ) {
- SetValue(index,(int)value);
- }
- else {
- SetValue(index,Convert.ToInt32(value));
- }
- SetNull(index,value == null,isDbNull);
- }
- }
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ int val1 = _values [index1];
+ int val2 = _values [index2];
+ return val1 - val2;
+ }
- internal override int Capacity {
- set {
- base.Capacity = value;
- if (_values == null) {
- _values = new int[value];
- }
- else {
- int[] tmp = new int[value];
- Array.Copy(_values,0,tmp,0,_values.Length);
- _values = tmp;
- }
- }
+ protected override void Resize (int size)
+ {
+ if (_values == null) {
+ _values = new byte [size];
+ return;
}
- #endregion //Properties
-
- #region Methods
-
- private void SetValue(int index, int value)
- {
- _values[index] = value;
- }
+ byte[] tmp = new byte [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
+ }
- internal override void SetItemFromDataRecord(int index, IDataRecord record, int field)
- {
- // if exception thrown, it should be caught
- // in the caller method
- if (!CheckAndSetNull ( index, record,field))
- SetValue(index,record.GetInt32(field));
- }
+ internal override long GetInt64 (int index)
+ {
+ return _values [index];
+ }
+ }
- internal override void CopyValue(int fromIndex, int toIndex)
- {
- base.CopyValue(fromIndex, toIndex);
- _values[toIndex] = _values[fromIndex];
- }
+ sealed class SByteDataContainer : DataContainer {
+ sbyte [] _values;
- internal override void CopyValue(AbstractDataContainer fromContainer, int fromIndex, int toIndex)
- {
- base.CopyValue(fromContainer, fromIndex, toIndex);
- _values[toIndex] = ((Int32DataContainer)fromContainer)._values[fromIndex];
- }
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- internal override int CompareValues(int index1, int index2)
- {
- int i1 = _values[index1];
- int i2 = _values[index2];
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = 0;
+ }
- if ( i1 == 0 && i2 == 0 ) {
- int cn = CompareNulls(index1, index2);
- return cn;
- }
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = (sbyte) GetContainerData (value);
+ }
- bool b1 = IsNull(index1);
- bool b2 = IsNull(index2);
-
- if ( i1 == 0 && b1 ) {
- return -1;
- }
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ _values [index] = (sbyte) record.GetByteSafe (field);
+ }
- if ( i2 == 0 && b2 ) {
- return 1;
- }
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (sbyte) GetContainerData (from.GetValue (from_index));
+ }
- if ( i1 <= i2 ) {
- return ( i1 != i2 ) ? -1 : 0;
- }
- return 1;
- }
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ int val1 = _values [index1];
+ int val2 = _values [index2];
+ return val1 - val2;
+ }
- internal override long GetInt64(int index)
- {
- return (long) _values[index];
+ protected override void Resize (int size)
+ {
+ if (_values == null) {
+ _values = new sbyte [size];
+ return;
}
- #endregion //Methods
+ sbyte[] tmp = new sbyte [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
}
- sealed class Int64DataContainer : AbstractDataContainer
+ internal override long GetInt64 (int index)
{
- #region Fields
-
- long[] _values;
+ return _values [index];
+ }
+ }
- #endregion //Fields
+ sealed class Int16DataContainer : DataContainer {
+ short [] _values;
- #region Properties
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- internal override object this[int index] {
- get {
- if (IsNull(index)) {
- return DBNull.Value;
- }
- else {
- return _values[index];
- }
- }
- set {
- bool isDbNull = (value == DBNull.Value);
- if (value == null || isDbNull) {
- SetValue(index,0);
- }
- else if( value is long ) {
- SetValue(index,(long)value);
- }
- else {
- SetValue(index,Convert.ToInt64(value));
- }
- SetNull(index,value == null,isDbNull);
- }
- }
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = 0;
+ }
- internal override int Capacity {
- set {
- base.Capacity = value;
- if (_values == null) {
- _values = new long[value];
- }
- else {
- long[] tmp = new long[value];
- Array.Copy(_values,0,tmp,0,_values.Length);
- _values = tmp;
- }
- }
- }
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = (short) GetContainerData (value);
+ }
- #endregion //Properties
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ _values [index] = record.GetInt16Safe (field);
+ }
- #region Methods
-
- private void SetValue(int index, long value)
- {
- _values[index] = value;
- }
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (short) GetContainerData (from.GetValue (from_index));
+ }
- internal override void SetItemFromDataRecord(int index, IDataRecord record, int field)
- {
- // if exception thrown, it should be caught
- // in the caller method
- if (!CheckAndSetNull ( index, record,field))
- SetValue(index,record.GetInt64(field));
- }
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ int val1 = _values [index1];
+ int val2 = _values [index2];
+ return val1 - val2;
+ }
- internal override void CopyValue(int fromIndex, int toIndex)
- {
- base.CopyValue(fromIndex, toIndex);
- _values[toIndex] = _values[fromIndex];
+ protected override void Resize (int size)
+ {
+ if (_values == null) {
+ _values = new short [size];
+ return;
}
- internal override void CopyValue(AbstractDataContainer fromContainer, int fromIndex, int toIndex)
- {
- base.CopyValue(fromContainer, fromIndex, toIndex);
- _values[toIndex] = ((Int64DataContainer)fromContainer)._values[fromIndex];
- }
+ short[] tmp = new short [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
+ }
- internal override int CompareValues(int index1, int index2)
- {
- long l1 = _values[index1];
- long l2 = _values[index2];
+ internal override long GetInt64 (int index)
+ {
+ return _values [index];
+ }
+ }
- if ( l1 == 0 || l2 == 0 ) {
- int cn = CompareNulls(index1, index2);
- if (cn != 0) {
- return cn;
- }
- }
+ sealed class UInt16DataContainer : DataContainer {
+ ushort [] _values;
- if ( l1 <= l2 ) {
- return ( l1 != l2 ) ? -1 : 0;
- }
- return 1;
- }
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- internal override long GetInt64(int index)
- {
- return _values[index];
- }
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = 0;
+ }
- #endregion //Methods
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = (ushort) GetContainerData (value);
}
- sealed class SingleDataContainer : AbstractDataContainer
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
{
- #region Fields
-
- float[] _values;
+ _values [index] = (ushort) record.GetInt16Safe (field);
+ }
- #endregion //Fields
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (ushort) GetContainerData (from.GetValue (from_index));
+ }
- #region Properties
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ int val1 = _values [index1];
+ int val2 = _values [index2];
+ return val1 - val2;
+ }
- internal override object this[int index] {
- get {
- if (IsNull(index)) {
- return DBNull.Value;
- }
- else {
- return _values[index];
- }
- }
- set {
- bool isDbNull = (value == DBNull.Value);
- if (value == null || isDbNull) {
- SetValue(index,0);
- }
- else if( value is float ) {
- SetValue(index,(float)value);
- }
- else {
- SetValue(index,Convert.ToSingle(value));
- }
- SetNull(index,value == null,isDbNull);
- }
+ protected override void Resize (int size)
+ {
+ if (_values == null) {
+ _values = new ushort [size];
+ return;
}
- internal override int Capacity {
- set {
- base.Capacity = value;
- if (_values == null) {
- _values = new float[value];
- }
- else {
- float[] tmp = new float[value];
- Array.Copy(_values,0,tmp,0,_values.Length);
- _values = tmp;
- }
- }
- }
+ ushort[] tmp = new ushort [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
+ }
- #endregion //Properties
+ internal override long GetInt64 (int index)
+ {
+ return _values [index];
+ }
+ }
- #region Methods
-
- private void SetValue(int index, float value)
- {
- _values[index] = value;
- }
+ sealed class Int32DataContainer : DataContainer {
+ int [] _values;
- internal override void SetItemFromDataRecord(int index, IDataRecord record, int field)
- {
- // if exception thrown, it should be caught
- // in the caller method
- if (!CheckAndSetNull ( index, record,field))
- SetValue(index,record.GetFloat(field));
- }
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- internal override void CopyValue(int fromIndex, int toIndex)
- {
- base.CopyValue(fromIndex, toIndex);
- _values[toIndex] = _values[fromIndex];
- }
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = 0;
+ }
- internal override void CopyValue(AbstractDataContainer fromContainer, int fromIndex, int toIndex)
- {
- base.CopyValue(fromContainer, fromIndex, toIndex);
- _values[toIndex] = ((SingleDataContainer)fromContainer)._values[fromIndex];
- }
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = (int) GetContainerData (value);
+ }
- internal override int CompareValues(int index1, int index2)
- {
- float f1 = _values[index1];
- float f2 = _values[index2];
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ _values [index] = record.GetInt32Safe (field);
+ }
- if ( f1 == 0 || f2 == 0 ) {
- int cn = CompareNulls(index1, index2);
- if (cn != 0) {
- return cn;
- }
- }
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (int) GetContainerData (from.GetValue (from_index));
+ }
- if ( f1 <= f2 ) {
- return ( f1 != f2 ) ? -1 : 0;
- }
- return 1;
- }
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ int val1 = _values [index1];
+ int val2 = _values [index2];
+ return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
+ }
- internal override long GetInt64(int index)
- {
- return Convert.ToInt64(_values[index]);
+ protected override void Resize (int size)
+ {
+ if (_values == null) {
+ _values = new int [size];
+ return;
}
- #endregion //Methods
+ int[] tmp = new int [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
}
- sealed class DoubleDataContainer : AbstractDataContainer
+ internal override long GetInt64 (int index)
{
- #region Fields
-
- double[] _values;
+ return _values [index];
+ }
+ }
- #endregion //Fields
+ sealed class UInt32DataContainer : DataContainer {
+ uint [] _values;
- #region Properties
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- internal override object this[int index] {
- get {
- if (IsNull(index)) {
- return DBNull.Value;
- }
- else {
- return _values[index];
- }
- }
- set {
- bool isDbNull = (value == DBNull.Value);
- if (value == null || isDbNull) {
- SetValue(index,0);
- }
- else if( value is double ) {
- SetValue(index,(double)value);
- }
- else {
- SetValue(index,Convert.ToDouble(value));
- }
- SetNull(index,value == null,isDbNull);
- }
- }
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = 0;
+ }
- internal override int Capacity {
- set {
- base.Capacity = value;
- if (_values == null) {
- _values = new double[value];
- }
- else {
- double[] tmp = new double[value];
- Array.Copy(_values,0,tmp,0,_values.Length);
- _values = tmp;
- }
- }
- }
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = (uint) GetContainerData (value);
+ }
- #endregion //Properties
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ _values [index] = (uint) record.GetInt32Safe (field);
+ }
- #region Methods
-
- private void SetValue(int index, double value)
- {
- _values[index] = value;
- }
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (uint) GetContainerData (from.GetValue (from_index));
+ }
- internal override void SetItemFromDataRecord(int index, IDataRecord record, int field)
- {
- // if exception thrown, it should be caught
- // in the caller method
- if (!CheckAndSetNull ( index, record,field))
- SetValue(index,record.GetDouble(field));
- }
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ uint val1 = _values [index1];
+ uint val2 = _values [index2];
+ return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
+ }
- internal override void CopyValue(int fromIndex, int toIndex)
- {
- base.CopyValue(fromIndex, toIndex);
- _values[toIndex] = _values[fromIndex];
+ protected override void Resize (int size)
+ {
+ if (_values == null) {
+ _values = new uint [size];
+ return;
}
- internal override void CopyValue(AbstractDataContainer fromContainer, int fromIndex, int toIndex)
- {
- base.CopyValue(fromContainer, fromIndex, toIndex);
- _values[toIndex] = ((DoubleDataContainer)fromContainer)._values[fromIndex];
- }
+ uint[] tmp = new uint [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
+ }
- internal override int CompareValues(int index1, int index2)
- {
- double d1 = _values[index1];
- double d2 = _values[index2];
+ internal override long GetInt64 (int index)
+ {
+ return _values [index];
+ }
+ }
- if ( d1 == 0 || d2 == 0 ) {
- int cn = CompareNulls(index1, index2);
- if (cn != 0) {
- return cn;
- }
- }
+ sealed class Int64DataContainer : DataContainer {
+ long [] _values;
- if ( d1 <= d2 ) {
- return ( d1 != d2 ) ? -1 : 0;
- }
- return 1;
- }
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- internal override long GetInt64(int index)
- {
- return Convert.ToInt64(_values[index]);
- }
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = 0;
+ }
- #endregion //Methods
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = (long) GetContainerData (value);
}
- sealed class ByteDataContainer : AbstractDataContainer
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
{
- #region Fields
-
- byte[] _values;
+ _values [index] = record.GetInt64Safe (field);
+ }
- #endregion //Fields
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (long) GetContainerData (from.GetValue (from_index));
+ }
- #region Properties
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ long val1 = _values [index1];
+ long val2 = _values [index2];
+ return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
+ }
- internal override object this[int index] {
- get {
- if (IsNull(index)) {
- return DBNull.Value;
- }
- else {
- return _values[index];
- }
- }
- set {
- bool isDbNull = (value == DBNull.Value);
- if (value == null || isDbNull) {
- SetValue(index,0);
- }
- else if( value is byte ) {
- SetValue(index,(byte)value);
- }
- else {
- SetValue(index,Convert.ToByte(value));
- }
- SetNull(index,value == null,isDbNull);
- }
+ protected override void Resize (int size)
+ {
+ if (_values == null) {
+ _values = new long [size];
+ return;
}
- internal override int Capacity {
- set {
- base.Capacity = value;
- if (_values == null) {
- _values = new byte[value];
- }
- else {
- byte[] tmp = new byte[value];
- Array.Copy(_values,0,tmp,0,_values.Length);
- _values = tmp;
- }
- }
- }
+ long[] tmp = new long [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
+ }
- #endregion //Properties
+ internal override long GetInt64 (int index)
+ {
+ return _values [index];
+ }
+ }
- #region Methods
-
- private void SetValue(int index, byte value)
- {
- _values[index] = value;
- }
+ sealed class UInt64DataContainer : DataContainer {
+ ulong [] _values;
- internal override void SetItemFromDataRecord(int index, IDataRecord record, int field)
- {
- // if exception thrown, it should be caught
- // in the caller method
- if (!CheckAndSetNull ( index, record,field))
- SetValue(index,record.GetByte(field));
- }
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- internal override void CopyValue(int fromIndex, int toIndex)
- {
- base.CopyValue(fromIndex, toIndex);
- _values[toIndex] = _values[fromIndex];
- }
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = 0;
+ }
- internal override void CopyValue(AbstractDataContainer fromContainer, int fromIndex, int toIndex)
- {
- base.CopyValue(fromContainer, fromIndex, toIndex);
- _values[toIndex] = ((ByteDataContainer)fromContainer)._values[fromIndex];
- }
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = (ulong) GetContainerData (value);
+ }
- internal override int CompareValues(int index1, int index2)
- {
- byte b1 = _values[index1];
- byte b2 = _values[index2];
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ _values [index] = (ulong) record.GetInt64Safe (field);
+ }
- if ( b1 == 0 || b2 == 0 ) {
- int cn = CompareNulls(index1, index2);
- if (cn != 0) {
- return cn;
- }
- }
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (ulong) GetContainerData (from.GetValue (from_index));
+ }
- if ( b1 <= b2 ) {
- return ( b1 != b2 ) ? -1 : 0;
- }
- return 1;
- }
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ ulong val1 = _values [index1];
+ ulong val2 = _values [index2];
+ return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
+ }
- internal override long GetInt64(int index)
- {
- return (long) _values[index];
+ protected override void Resize (int size)
+ {
+ if (_values == null) {
+ _values = new ulong [size];
+ return;
}
- #endregion //Methods
+ ulong[] tmp = new ulong [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
}
- sealed class BitDataContainer : AbstractDataContainer
+ internal override long GetInt64 (int index)
{
- #region Fields
-
- bool[] _values;
+ return Convert.ToInt64 (_values [index]);
+ }
+ }
- #endregion //Fields
+ sealed class SingleDataContainer : DataContainer {
+ float [] _values;
- #region Properties
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- internal override object this[int index] {
- get {
- bool isNull = IsNull(index);
- if (isNull) {
- return DBNull.Value;
- }
- else {
- return _values[index];
- }
- }
- set {
- bool isDbNull = (value == DBNull.Value);
- if (value == null || isDbNull) {
- SetValue(index,false);
- }
- else if( value is bool ) {
- SetValue(index,(bool)value);
- }
- else {
- SetValue(index,Convert.ToBoolean(value));
- }
- SetNull(index,value == null,isDbNull);
- }
- }
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = 0;
+ }
- internal override int Capacity {
- set {
- base.Capacity = value;
- if (_values == null) {
- _values = new bool[value];
- }
- else {
- bool[] tmp = new bool[value];
- Array.Copy(_values,0,tmp,0,_values.Length);
- _values = tmp;
- }
- }
- }
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = (float) GetContainerData (value);
+ }
- #endregion //Properties
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ _values [index] = record.GetFloatSafe (field);
+ }
- #region Methods
-
- private void SetValue(int index, bool value)
- {
- _values[index] = value;
- }
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (float) GetContainerData (from.GetValue (from_index));
+ }
- internal override void SetItemFromDataRecord(int index, IDataRecord record, int field)
- {
- // if exception thrown, it should be caught
- // in the caller method
- if (!CheckAndSetNull ( index, record,field))
- SetValue(index,record.GetBoolean(field));
- }
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ float val1 = _values [index1];
+ float val2 = _values [index2];
+ return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
+ }
- internal override void CopyValue(int fromIndex, int toIndex)
- {
- base.CopyValue(fromIndex, toIndex);
- _values[toIndex] = _values[fromIndex];
+ protected override void Resize (int size)
+ {
+ if (_values == null) {
+ _values = new float [size];
+ return;
}
- internal override void CopyValue(AbstractDataContainer fromContainer, int fromIndex, int toIndex)
- {
- base.CopyValue(fromContainer, fromIndex, toIndex);
- _values[toIndex] = ((BitDataContainer)fromContainer)._values[fromIndex];
- }
+ float[] tmp = new float [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
+ }
- internal override int CompareValues(int index1, int index2)
- {
- bool b1 = _values[index1];
- bool b2 = _values[index2];
+ internal override long GetInt64 (int index)
+ {
+ return Convert.ToInt64 (_values [index]);
+ }
+ }
- if ( b1 ^ b2 ) {
- return b1 ? 1 : -1;
- }
-
- if ( b1 ) {
- return 0;
- }
+ sealed class DoubleDataContainer : DataContainer {
+ double [] _values;
- return CompareNulls(index1, index2);
- }
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- internal override long GetInt64(int index)
- {
- return Convert.ToInt64(_values[index]);
- }
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = 0;
+ }
- #endregion //Methods
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = (double) GetContainerData (value);
}
- class ObjectDataContainer : AbstractDataContainer
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
{
- #region Fields
-
- object[] _values;
+ _values [index] = record.GetDoubleSafe (field);
+ }
- #endregion //Fields
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = (double) GetContainerData (from.GetValue (from_index));
+ }
- #region Properties
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ double val1 = _values [index1];
+ double val2 = _values [index2];
+ return val1 == val2 ? 0 : val1 < val2 ? -1 : 1;
+ }
- internal override object this[int index] {
- get {
- return _values[index];
- }
- set {
- SetValue(index,value);
- SetNull(index,value == null,value == DBNull.Value);
- }
+ protected override void Resize (int size)
+ {
+ if (_values == null) {
+ _values = new double [size];
+ return;
}
- internal override int Capacity {
- set {
- base.Capacity = value;
- if (_values == null) {
- _values = new object[value];
- }
- else {
- object[] tmp = new object[value];
- Array.Copy(_values,0,tmp,0,_values.Length);
- _values = tmp;
- }
- }
- }
+ double[] tmp = new double [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
+ }
- #endregion //Properties
+ internal override long GetInt64 (int index)
+ {
+ return Convert.ToInt64 (_values[index]);
+ }
+ }
- #region Methods
-
- protected virtual void SetValue(int index, object value)
- {
- if(value == null) {
- value = Column.DefaultValue;
- }
- _values[index] = value;
- }
+ class ObjectDataContainer : DataContainer {
+ object [] _values;
- internal override void SetItemFromDataRecord(int index, IDataRecord record, int field)
- {
- // if exception thrown, it should be caught
- // in the caller metho
- SetValue(index,record.GetValue(field));
- base.SetItemFromDataRecord(index,record,field);
- }
+ protected internal override object GetValue (int index)
+ {
+ return _values [index];
+ }
- internal override void CopyValue(int fromIndex, int toIndex)
- {
- base.CopyValue(fromIndex, toIndex);
- _values[toIndex] = _values[fromIndex];
- }
+ protected override void ZeroOut (int index)
+ {
+ _values [index] = null;
+ }
- internal override void CopyValue(AbstractDataContainer fromContainer, int fromIndex, int toIndex)
- {
- base.CopyValue(fromContainer, fromIndex, toIndex);
- _values[toIndex] = ((ObjectDataContainer)fromContainer)._values[fromIndex];
- }
+ protected override void SetValue (int index, object value)
+ {
+ _values [index] = value;
+ }
- internal override int CompareValues(int index1, int index2)
- {
- object obj1 = _values[index1];
- object obj2 = _values[index2];
- if(obj1 == obj2) {
- return 0;
- }
- else if (obj1 is IComparable) {
- try {
- return ((IComparable)obj1).CompareTo(obj2);
- }
- catch {
- //just suppress
- }
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ _values [index] = record.GetValue (field);
+ }
+
+ protected override void DoCopyValue (DataContainer from, int from_index, int to_index)
+ {
+ _values [to_index] = GetContainerData (from.GetValue (from_index));
+ }
+
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ object obj1 = _values [index1];
+ object obj2 = _values [index2];
+ if (obj1 == obj2)
+ return 0;
+
+ if (obj1 is IComparable) {
+ try {
+ return ((IComparable)obj1).CompareTo (obj2);
+ } catch {
if (obj2 is IComparable) {
- obj2 = Convert.ChangeType(obj2, Type.GetTypeCode(obj1.GetType()));
- return ((IComparable)obj1).CompareTo(obj2);
+ obj2 = Convert.ChangeType (obj2, Type.GetTypeCode (obj1.GetType ()));
+ return ((IComparable)obj1).CompareTo (obj2);
}
}
-
- return String.Compare(obj1.ToString(), obj2.ToString());
- }
-
- internal override long GetInt64(int index)
- {
- return Convert.ToInt64(_values[index]);
}
- #endregion //Methods
-
+ return String.Compare (obj1.ToString (), obj2.ToString ());
}
- sealed class StringDataContainer : ObjectDataContainer
+ protected override void Resize (int size)
{
- #region Methods
-
- private void SetValue(int index, string value)
- {
- if (value != null && Column.MaxLength >= 0 && Column.MaxLength < value.Length ) {
- throw new ArgumentException("Cannot set column '" + Column.ColumnName + "' to '" + value + "'. The value violates the MaxLength limit of this column.");
- }
- base.SetValue(index,value);
- }
-
- protected override void SetValue(int index, object value)
- {
- if ( value != null && value != DBNull.Value ) {
- if ( value is string ) {
- SetValue(index, (string) value);
- }
- else {
- SetValue(index, Convert.ToString(value));
- }
- return;
- }
-
- base.SetValue(index, value);
+ if (_values == null) {
+ _values = new object [size];
+ return;
}
- internal override void SetItemFromDataRecord(int index, IDataRecord record, int field)
- {
- // if exception thrown, it should be caught
- // in the caller method
- if (!CheckAndSetNull ( index, record,field))
- SetValue(index,record.GetString(field));
- }
+ object[] tmp = new object [size];
+ Array.Copy (_values, 0, tmp, 0, _values.Length);
+ _values = tmp;
+ }
- internal override int CompareValues(int index1, int index2)
- {
- bool isNull1 = IsNull(index1);
- bool isNull2 = IsNull(index2);
+ internal override long GetInt64 (int index)
+ {
+ return Convert.ToInt64 (_values [index]);
+ }
+ }
- if (isNull1) {
- return isNull2 ? 0 : -1;
- }
- else {
- if (isNull2) {
- return 1;
- }
- }
- return String.Compare((string)this[index1], (string)this[index2], !Column.Table.CaseSensitive);
- }
+ sealed class DateTimeDataContainer : ObjectDataContainer {
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ base.SetValue (index, record.GetDateTimeSafe (field));
+ }
- #endregion //Methods
+ protected override void SetValue (int index, object value)
+ {
+ base.SetValue (index, GetContainerData (value));
}
+ }
- sealed class DateTimeDataContainer : ObjectDataContainer
+ sealed class DecimalDataContainer : ObjectDataContainer {
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
{
- #region Methods
-
- protected override void SetValue(int index, object value)
- {
- if ( value != null && value != DBNull.Value && !(value is DateTime)) {
- value = Convert.ToDateTime(value);
- }
+ base.SetValue (index, record.GetDecimalSafe (field));
+ }
- base.SetValue(index,value);
- }
+ protected override void SetValue (int index, object value)
+ {
+ base.SetValue (index, GetContainerData (value));
+ }
+ }
- internal override void SetItemFromDataRecord(int index, IDataRecord record, int field)
- {
- // if exception thrown, it should be caught
- // in the caller method
- if (!CheckAndSetNull(index,record,field))
- base.SetValue(index,record.GetDateTime(field));
- }
+ sealed class StringDataContainer : ObjectDataContainer {
+ private void SetValue (int index, string value)
+ {
+ if (value != null && Column.MaxLength >= 0 && Column.MaxLength < value.Length)
+ throw new ArgumentException ("Cannot set column '" + Column.ColumnName + "' to '" + value + "'. The value violates the MaxLength limit of this column.");
+ base.SetValue (index, value);
+ }
- internal override int CompareValues(int index1, int index2)
- {
- bool isNull1 = IsNull(index1);
- bool isNull2 = IsNull(index2);
+ protected override void SetValue (int index, object value)
+ {
+ SetValue (index, (string) GetContainerData (value));
+ }
- if (isNull1) {
- return isNull2 ? 0 : -1;
- }
- else {
- if (isNull2) {
- return 1;
- }
- }
- return DateTime.Compare((DateTime)this[index1], (DateTime)this[index2]);
- }
+ protected override void SetValueFromSafeDataRecord (int index, ISafeDataRecord record, int field)
+ {
+ SetValue (index, record.GetStringSafe (field));
+ }
- #endregion //Methods
+ protected override int DoCompareValues (int index1, int index2)
+ {
+ DataTable table = Column.Table;
+ return String.Compare ((string) this [index1], (string) this [index2], !table.CaseSensitive, table.Locale);
}
}
}