Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Integrate the new custom database type callbacks into the data reader class. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | customDataTypes |
Files: | files | file ages | folders |
SHA1: |
df67a84c21861ecd029df270a7f25add |
User & Date: | mistachkin 2016-06-19 02:59:47.321 |
Context
2016-06-19
| ||
03:03 | Improve coding style of the previous check-in and make it compile on the .NET Compact Framework. check-in: 3d482302d1 user: mistachkin tags: customDataTypes | |
02:59 | Integrate the new custom database type callbacks into the data reader class. check-in: df67a84c21 user: mistachkin tags: customDataTypes | |
02:59 | Add the new connection flags. check-in: ff93dd1274 user: mistachkin tags: customDataTypes | |
Changes
Changes to System.Data.SQLite/SQLiteDataReader.cs.
︙ | ︙ | |||
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 | if (typ == DbType.Binary) return affinity; if (typ == DbType.String) return affinity; break; } throw new InvalidCastException(); } /// <summary> /// Retrieves the column as a boolean value /// </summary> /// <param name="i">The index of the column.</param> /// <returns>bool</returns> public override bool GetBoolean(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetBoolean(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Boolean); return Convert.ToBoolean(GetValue(i), CultureInfo.CurrentCulture); } /// <summary> /// Retrieves the column as a single byte value /// </summary> /// <param name="i">The index of the column.</param> /// <returns>byte</returns> public override byte GetByte(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetByte(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Byte); return Convert.ToByte(_activeStatement._sql.GetInt32(_activeStatement, i)); } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 | if (typ == DbType.Binary) return affinity; if (typ == DbType.String) return affinity; break; } throw new InvalidCastException(); } /// <summary> /// Invokes the data reader value callback configured for the database /// type name associated with the specified column. If no data reader /// value callback is available for the database type name, do nothing. /// </summary> /// <param name="index"> /// The index of the column being read. /// </param> /// <param name="eventArgs"> /// The extra event data to pass into the callback. /// </param> /// <param name="complete"> /// Non-zero if the default handling for the data reader call should be /// skipped. If this is set to non-zero and the necessary return value /// is unavailable or unsuitable, an exception will be thrown. /// </param> private void InvokeReadValueCallback( int index, SQLiteReadValueEventArgs eventArgs, out bool complete ) { complete = false; _flags &= ~SQLiteConnectionFlags.UseConnectionReadValueCallbacks; try { SQLiteConnection connection = GetConnection(this); if (connection == null) return; string typeName = GetDataTypeName(index); if (typeName == null) return; SQLiteTypeCallbacks callbacks; if (!connection.TryGetTypeCallbacks(typeName, out callbacks) || (callbacks == null)) { return; } SQLiteReadValueCallback callback = callbacks.ReadValueCallback; object userData = callbacks.ReadValueUserData; if (callback != null) { callback( _activeStatement._sql, this, _flags, eventArgs, index, userData, out complete); /* throw */ } } finally { _flags |= SQLiteConnectionFlags.UseConnectionReadValueCallbacks; } } /// <summary> /// Retrieves the column as a boolean value /// </summary> /// <param name="i">The index of the column.</param> /// <returns>bool</returns> public override bool GetBoolean(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) { if (value.BooleanValue == null) throw new SQLiteException("missing boolean return value"); return (bool)value.BooleanValue; } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetBoolean(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Boolean); return Convert.ToBoolean(GetValue(i), CultureInfo.CurrentCulture); } /// <summary> /// Retrieves the column as a single byte value /// </summary> /// <param name="i">The index of the column.</param> /// <returns>byte</returns> public override byte GetByte(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) { if (value.ByteValue == null) throw new SQLiteException("missing byte return value"); return (byte)value.ByteValue; } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetByte(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Byte); return Convert.ToByte(_activeStatement._sql.GetInt32(_activeStatement, i)); } |
︙ | ︙ | |||
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 | /// <remarks> /// To determine the number of bytes in the column, pass a null value for the buffer. The total length will be returned. /// </remarks> public override long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetBytes(i - PrivateVisibleFieldCount, fieldOffset, buffer, bufferoffset, length); VerifyType(i, DbType.Binary); return _activeStatement._sql.GetBytes(_activeStatement, i, (int)fieldOffset, buffer, bufferoffset, length); } /// <summary> /// Returns the column as a single character /// </summary> /// <param name="i">The index of the column.</param> /// <returns>char</returns> public override char GetChar(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetChar(i - PrivateVisibleFieldCount); VerifyType(i, DbType.SByte); return Convert.ToChar(_activeStatement._sql.GetInt32(_activeStatement, i)); } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | /// <remarks> /// To determine the number of bytes in the column, pass a null value for the buffer. The total length will be returned. /// </remarks> public override long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( new SQLiteReadArrayEventArgs(fieldOffset, buffer, bufferoffset, length), value), out complete); if (complete) { byte[] bytes = value.BytesValue; if (bytes != null) { Array.Copy(bytes, 0, buffer, bufferoffset, length); return bytes.LongLength; } else { return -1; } } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetBytes(i - PrivateVisibleFieldCount, fieldOffset, buffer, bufferoffset, length); VerifyType(i, DbType.Binary); return _activeStatement._sql.GetBytes(_activeStatement, i, (int)fieldOffset, buffer, bufferoffset, length); } /// <summary> /// Returns the column as a single character /// </summary> /// <param name="i">The index of the column.</param> /// <returns>char</returns> public override char GetChar(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) { if (value.CharValue == null) throw new SQLiteException("missing character return value"); return (char)value.CharValue; } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetChar(i - PrivateVisibleFieldCount); VerifyType(i, DbType.SByte); return Convert.ToChar(_activeStatement._sql.GetInt32(_activeStatement, i)); } |
︙ | ︙ | |||
516 517 518 519 520 521 522 523 524 525 526 527 528 529 | /// <remarks> /// To determine the number of characters in the column, pass a null value for the buffer. The total length will be returned. /// </remarks> public override long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetChars(i - PrivateVisibleFieldCount, fieldoffset, buffer, bufferoffset, length); if ((_flags & SQLiteConnectionFlags.NoVerifyTextAffinity) != SQLiteConnectionFlags.NoVerifyTextAffinity) VerifyType(i, DbType.String); | > > > > > > > > > > > > > > > > > > > > > > > > > | 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 | /// <remarks> /// To determine the number of characters in the column, pass a null value for the buffer. The total length will be returned. /// </remarks> public override long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( new SQLiteReadArrayEventArgs(fieldoffset, buffer, bufferoffset, length), value), out complete); if (complete) { char[] chars = value.CharsValue; if (chars != null) { Array.Copy(chars, 0, buffer, bufferoffset, length); return chars.LongLength; } else { return -1; } } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetChars(i - PrivateVisibleFieldCount, fieldoffset, buffer, bufferoffset, length); if ((_flags & SQLiteConnectionFlags.NoVerifyTextAffinity) != SQLiteConnectionFlags.NoVerifyTextAffinity) VerifyType(i, DbType.String); |
︙ | ︙ | |||
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | /// </summary> /// <param name="i">The index of the column.</param> /// <returns>DateTime</returns> public override DateTime GetDateTime(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetDateTime(i - PrivateVisibleFieldCount); VerifyType(i, DbType.DateTime); return _activeStatement._sql.GetDateTime(_activeStatement, i); } /// <summary> /// Retrieve the column as a decimal value /// </summary> /// <param name="i">The index of the column.</param> /// <returns>decimal</returns> public override decimal GetDecimal(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetDecimal(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Decimal); return Decimal.Parse(_activeStatement._sql.GetText(_activeStatement, i), NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture); } /// <summary> /// Returns the column as a double /// </summary> /// <param name="i">The index of the column.</param> /// <returns>double</returns> public override double GetDouble(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetDouble(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Double); return _activeStatement._sql.GetDouble(_activeStatement, i); } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 | /// </summary> /// <param name="i">The index of the column.</param> /// <returns>DateTime</returns> public override DateTime GetDateTime(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) { if (value.DateTimeValue == null) throw new SQLiteException("missing date/time return value"); return (DateTime)value.DateTimeValue; } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetDateTime(i - PrivateVisibleFieldCount); VerifyType(i, DbType.DateTime); return _activeStatement._sql.GetDateTime(_activeStatement, i); } /// <summary> /// Retrieve the column as a decimal value /// </summary> /// <param name="i">The index of the column.</param> /// <returns>decimal</returns> public override decimal GetDecimal(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) { if (value.DecimalValue == null) throw new SQLiteException("missing decimal return value"); return (decimal)value.DecimalValue; } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetDecimal(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Decimal); return Decimal.Parse(_activeStatement._sql.GetText(_activeStatement, i), NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture); } /// <summary> /// Returns the column as a double /// </summary> /// <param name="i">The index of the column.</param> /// <returns>double</returns> public override double GetDouble(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) { if (value.DoubleValue == null) throw new SQLiteException("missing double return value"); return (double)value.DoubleValue; } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetDouble(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Double); return _activeStatement._sql.GetDouble(_activeStatement, i); } |
︙ | ︙ | |||
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 | /// </summary> /// <param name="i">The index of the column.</param> /// <returns>float</returns> public override float GetFloat(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetFloat(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Single); return Convert.ToSingle(_activeStatement._sql.GetDouble(_activeStatement, i)); } /// <summary> /// Returns the column as a Guid /// </summary> /// <param name="i">The index of the column.</param> /// <returns>Guid</returns> public override Guid GetGuid(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetGuid(i - PrivateVisibleFieldCount); TypeAffinity affinity = VerifyType(i, DbType.Guid); if (affinity == TypeAffinity.Blob) { | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 | /// </summary> /// <param name="i">The index of the column.</param> /// <returns>float</returns> public override float GetFloat(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) { if (value.FloatValue == null) throw new SQLiteException("missing float return value"); return (float)value.FloatValue; } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetFloat(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Single); return Convert.ToSingle(_activeStatement._sql.GetDouble(_activeStatement, i)); } /// <summary> /// Returns the column as a Guid /// </summary> /// <param name="i">The index of the column.</param> /// <returns>Guid</returns> public override Guid GetGuid(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) { if (value.GuidValue == null) throw new SQLiteException("missing guid return value"); return (Guid)value.GuidValue; } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetGuid(i - PrivateVisibleFieldCount); TypeAffinity affinity = VerifyType(i, DbType.Guid); if (affinity == TypeAffinity.Blob) { |
︙ | ︙ | |||
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 | /// </summary> /// <param name="i">The index of the column.</param> /// <returns>Int16</returns> public override Int16 GetInt16(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetInt16(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Int16); return Convert.ToInt16(_activeStatement._sql.GetInt32(_activeStatement, i)); } /// <summary> /// Retrieves the column as an int /// </summary> /// <param name="i">The index of the column.</param> /// <returns>Int32</returns> public override Int32 GetInt32(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetInt32(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Int32); return _activeStatement._sql.GetInt32(_activeStatement, i); } /// <summary> /// Retrieves the column as a long /// </summary> /// <param name="i">The index of the column.</param> /// <returns>Int64</returns> public override Int64 GetInt64(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetInt64(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Int64); return _activeStatement._sql.GetInt64(_activeStatement, i); } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 | /// </summary> /// <param name="i">The index of the column.</param> /// <returns>Int16</returns> public override Int16 GetInt16(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) { if (value.Int16Value == null) throw new SQLiteException("missing int16 return value"); return (Int16)value.Int16Value; } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetInt16(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Int16); return Convert.ToInt16(_activeStatement._sql.GetInt32(_activeStatement, i)); } /// <summary> /// Retrieves the column as an int /// </summary> /// <param name="i">The index of the column.</param> /// <returns>Int32</returns> public override Int32 GetInt32(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) { if (value.Int32Value == null) throw new SQLiteException("missing int32 return value"); return (Int32)value.Int32Value; } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetInt32(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Int32); return _activeStatement._sql.GetInt32(_activeStatement, i); } /// <summary> /// Retrieves the column as a long /// </summary> /// <param name="i">The index of the column.</param> /// <returns>Int64</returns> public override Int64 GetInt64(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) { if (value.Int64Value == null) throw new SQLiteException("missing int64 return value"); return (Int64)value.Int64Value; } } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetInt64(i - PrivateVisibleFieldCount); VerifyType(i, DbType.Int64); return _activeStatement._sql.GetInt64(_activeStatement, i); } |
︙ | ︙ | |||
1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 | /// </summary> /// <param name="i">The index of the column.</param> /// <returns>string</returns> public override string GetString(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetString(i - PrivateVisibleFieldCount); if ((_flags & SQLiteConnectionFlags.NoVerifyTextAffinity) != SQLiteConnectionFlags.NoVerifyTextAffinity) VerifyType(i, DbType.String); return _activeStatement._sql.GetText(_activeStatement, i); } /// <summary> /// Retrieves the column as an object corresponding to the underlying datatype of the column /// </summary> /// <param name="i">The index of the column.</param> /// <returns>object</returns> public override object GetValue(int i) { CheckDisposed(); VerifyForGet(); if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetValue(i - PrivateVisibleFieldCount); SQLiteType typ = GetSQLiteType(_flags, i); if (((_flags & SQLiteConnectionFlags.DetectTextAffinity) == SQLiteConnectionFlags.DetectTextAffinity) && | > > > > > > > > > > > > > > > > > > > > > > > > | 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 | /// </summary> /// <param name="i">The index of the column.</param> /// <returns>string</returns> public override string GetString(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) return value.StringValue; } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetString(i - PrivateVisibleFieldCount); if ((_flags & SQLiteConnectionFlags.NoVerifyTextAffinity) != SQLiteConnectionFlags.NoVerifyTextAffinity) VerifyType(i, DbType.String); return _activeStatement._sql.GetText(_activeStatement, i); } /// <summary> /// Retrieves the column as an object corresponding to the underlying datatype of the column /// </summary> /// <param name="i">The index of the column.</param> /// <returns>object</returns> public override object GetValue(int i) { CheckDisposed(); VerifyForGet(); if ((_flags & SQLiteConnectionFlags.UseConnectionReadValueCallbacks) == SQLiteConnectionFlags.UseConnectionReadValueCallbacks) { SQLiteDataReaderValue value = new SQLiteDataReaderValue(); bool complete; InvokeReadValueCallback(i, new SQLiteReadValueEventArgs( null, value), out complete); if (complete) return value.Value; } if (i >= PrivateVisibleFieldCount && _keyInfo != null) return _keyInfo.GetValue(i - PrivateVisibleFieldCount); SQLiteType typ = GetSQLiteType(_flags, i); if (((_flags & SQLiteConnectionFlags.DetectTextAffinity) == SQLiteConnectionFlags.DetectTextAffinity) && |
︙ | ︙ |