System.Data.SQLite
Check-in [9e3a7fdf26]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix compilation for the .NET Compact Framework. Use invariant culture for Int64/Double parsing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tkt-3c00ec5b52
Files: files | file ages | folders
SHA1: 9e3a7fdf26dffa730bf4b1e561f40a0418cbc003
User & Date: mistachkin 2014-05-18 07:09:29
Context
2014-05-26
20:36
Merge updates from trunk. check-in: 99904a25b4 user: mistachkin tags: tkt-3c00ec5b52
2014-05-18
07:09
Fix compilation for the .NET Compact Framework. Use invariant culture for Int64/Double parsing. check-in: 9e3a7fdf26 user: mistachkin tags: tkt-3c00ec5b52
06:57
Add experimental MapTextToAffinity connection flag to permit automatic attempts to map textual column values onto values with an appropriate type affinity. check-in: f5dd5dcfde user: mistachkin tags: tkt-3c00ec5b52
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLiteConvert.cs.

1373
1374
1375
1376
1377
1378
1379

1380



1381












1382
1383
1384
1385
1386
1387
1388
....
1398
1399
1400
1401
1402
1403
1404

1405



1406











1407
1408
1409
1410
1411
1412
1413
    /// </returns>
    internal static bool LooksLikeInt64(
        string text
        )
    {
        long longValue;


        if (!long.TryParse(text, out longValue))



            return false;













        return String.Equals(
            longValue.ToString(CultureInfo.InvariantCulture), text,
            StringComparison.Ordinal);
    }

    /// <summary>
................................................................................
    /// </returns>
    internal static bool LooksLikeDouble(
        string text
        )
    {
        double doubleValue;


        if (!double.TryParse(text, out doubleValue))



            return false;












        return String.Equals(
            doubleValue.ToString(CultureInfo.InvariantCulture), text,
            StringComparison.Ordinal);
    }

    /// <summary>







>
|
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>







 







>
|
>
>
>

>
>
>
>
>
>
>
>
>
>
>







1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
....
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
    /// </returns>
    internal static bool LooksLikeInt64(
        string text
        )
    {
        long longValue;

#if !PLATFORM_COMPACTFRAMEWORK
        if (!long.TryParse(
                text, NumberStyles.Integer, CultureInfo.InvariantCulture,
                out longValue))
        {
            return false;
        }
#else
        try
        {
            longValue = long.Parse(
                text, NumberStyles.Integer, CultureInfo.InvariantCulture);
        }
        catch
        {
            return false;
        }
#endif

        return String.Equals(
            longValue.ToString(CultureInfo.InvariantCulture), text,
            StringComparison.Ordinal);
    }

    /// <summary>
................................................................................
    /// </returns>
    internal static bool LooksLikeDouble(
        string text
        )
    {
        double doubleValue;

#if !PLATFORM_COMPACTFRAMEWORK
        if (!double.TryParse(
                text, NumberStyles.Float | NumberStyles.AllowThousands,
                CultureInfo.InvariantCulture, out doubleValue))
        {
            return false;
        }
#else
        try
        {
            doubleValue = double.Parse(text, CultureInfo.InvariantCulture);
        }
        catch
        {
            return false;
        }
#endif

        return String.Equals(
            doubleValue.ToString(CultureInfo.InvariantCulture), text,
            StringComparison.Ordinal);
    }

    /// <summary>