1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 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 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 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 643 644 645 646 647 648 649 650 651 652 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 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 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 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 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 895 896 897 898 899 900 901 902 903 904 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 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 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 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 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 1405 1406 1407 1408 1409 1410 1411 1412 1413 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 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 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 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<fpdoc-descriptions>
<package name="fcl">
<!--
====================================================================
fpjson
====================================================================
-->
<module name="fpjson">
<short>JSON support for Free Pascal</short>
<descr>
<p>
The JSON unit implements JSON support for Free Pascal. It contains the data
structures (<link id="TJSONData"/> and descendent objects) to treat JSON data
and output JSON as a string <link id="TJSONData.AsJSON"/>. The generated JSON
can be formatted in several ways <link id="TJSONData.FormatJSON"/>.
</p>
<p>
Using the JSON data structures is simple. Instantiate an appropriate descendent
of <var>TJSONData</var>, set the data and call <var>AsJSON</var>. The
following JSON data types are supported:
</p>
<dl>
<dt>Numbers</dt><dd>in one of <link id="TJSONIntegerNumber"/>, <link
id="TJSONFloatNumber"/> or <link id="TJSONInt64Number"/>, depending on the
type of the number.</dd>
<dt>Strings</dt><dd>in <link id="TJSONString"/>.</dd>
<dt>Boolean</dt><dd>in <link id="TJSONBoolean"/>.</dd>
<dt>null</dt><dd>is supported using <link id="TJSONNull"/></dd>
<dt>Array</dt><dd>is supported using <link id="TJSONArray"/></dd>
<dt>Object</dt><dd>is supported using <link id="TJSONObject"/></dd>
</dl>
<p>
The constructors of these objects allow to set the value, making them very
easy to use. The memory management is automatic in the sense that arrays and
objects own their values, and when the array or object is freed, all data in
it is freed as well.
</p>
<p>Typical use would be:</p>
<code>
Var
O : TJSONObject;
begin
O:=TJSONObject.Create(['Age',44,
'Firstname','Michael',
'Lastname','Van Canneyt']);
Writeln(O.AsJSON);
Write('Welcome ',O.Strings['Firstname'],', ');
Writeln(O.Get('Lastname','')); // empty default.
Writeln(', your current age is ',O.Integers('Age']);
O.Free;
end;
</code>
<p>
The <var>TJSONArray</var> and <var>TJSONObject</var> classes offer methods
to examine, get and set the various members and search through the various members.
</p>
<p>
Currently the JSON support only allows the use of UTF-8 data.
</p>
<p>
Parsing incoming JSON and constructing the JSON data structures is not implemented in
the <var>fpJSON</var> unit. For this, the <link id="jsonscanner"/> unit must
be included in the program unit clause. This sets several callback hooks
(using <link id="SetJSONParserHandler"/> and then the <link id="GetJSON"/>
function can then be used to transform a string or stream to JSON data
structures:
</p>
<code>
uses fpjson, jsonparser;
Var
D,E : TJSONData;
begin
D:=GetJSON('{ "Children" : ['+
' { "Age" : 23, '+
' "Names" : { "LastName" : "Rodriquez",'+
' "FirstName" : "Roberto" }},'+
' { "Age" : 20,'+
' "Names" : { "LastName" : "Rodriquez",'+
' "FirstName" : "Maria" }}'+
' ]}');
E:=D.FindPath('Children[1].Names.FirstName');
Writeln(E.AsJSON);
D.Free;
end.
</code>
<p>will print "Maria".</p>
<p>
The FPJSON code does not use hardcoded class names when creating the JSON:
it uses the various <link id="CreateJSON"/> functions to create the data.
These functions use a registry of classes, so it is possible to create
descendents of the classes in the <var>fpjson</var> unit and have these
used for construction of JSON Data structures. The
<link id="GetJSONInstanceType"/> and
<link id="SetJSONInstanceType"/> functions can be used to get or set the classes that must be used.
the default parser used by <link id="GetJSON"/> will also use these functions.
</p>
</descr>
<!-- uses unit Visibility: default -->
<element name="variants">
<short>Variant support routines</short>
</element>
<!-- enumeration type Visibility: default -->
<element name="TJSONtype">
<short>Possible types of JSON data</short>
<descr>
<var>TJSONtype</var> determines the type of JSON data a particular object contains.
The class function <link id="TJSONData.JSONType"/> returns this type, and
indicates what kind of data that particular descendent contains. The values
correspond to the original data types in the JSON specification. The
<var>TJSONData</var> object itself returns the unknown value.
</descr>
<seealso>
<link id="TJSONData.JSONType"/>
<link id="TJSONData"/>
</seealso>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONtype.jtUnknown">
<short>Unknown JSON data type</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONtype.jtNumber">
<short>Numerical type. This can be integer (32/64 bit) or float.</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONtype.jtString">
<short>String data type.</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONtype.jtBoolean">
<short>Boolean data</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONtype.jtNull">
<short>Null data</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONtype.jtArray">
<short>Array data (integer index,elements can be any type)</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONtype.jtObject">
<short>Object data (named index, elements can be any type)</short>
</element>
<!-- alias type Visibility: default -->
<element name="TJSONFloat">
<short>Float type used in JSON unit</short>
<descr>
<var>TJSONFloat</var> is the floating point type used in the JSON support.
It is currently a double, but this can be changed easily.
</descr>
<seealso>
<link id="TJSONFloatNumber"/>
</seealso>
</element>
<!-- alias type Visibility: default -->
<element name="TJSONStringType">
<short>String type used in JSON unit</short>
<descr>
<var>TJSONFloat</var> is the string point type used in the JSON support.
It is currently an ansistring, but this can be changed easily. Unicode
characters can be encoded with UTF-8.
</descr>
<seealso>
<link id="TJSONString"/>
<link id="TJSONData.AsString"/>
</seealso>
</element>
<!-- alias type Visibility: default -->
<element name="TJSONCharType">
<short>Character type used in parsing</short>
<descr>
<var>TJSONCharType</var> is the type of a single character in a <link
id="TJSONStringType"/> string. It is used by the parser.
</descr>
<seealso>
<link id="TJSONStringType"/>
</seealso>
</element>
<!-- pointer type Visibility: default -->
<element name="PJSONCharType">
<short>Pointer to <var>TJSONCharType</var>, used in parsing</short>
<descr>
<var>PJSONCharType</var> is a pointer to a <link id="TJSONCharType"/>
character. It is used while parsing JSON.
</descr>
<seealso>
<link id="TJSONStringType"/>
<link id="TJSONCharType"/>
</seealso>
</element>
<!-- enumeration type Visibility: default -->
<element name="TFormatOption">
<short>Formatting options for <var>FormatJSON</var></short>
<descr>
<var>TFormatOption</var> enumerates the various formatting options that can be used in
the <link id="TJSONData.FormatJSON"/> function.
</descr>
<seealso>
<link id="TJSONData.FormatJSON"/>
</seealso>
</element>
<!-- enumeration value Visibility: default -->
<element name="TFormatOption.foSingleLineArray">
<short>Keep all array elements on a single line.</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TFormatOption.foSingleLineObject">
<short>Keep all object elements on a single line.</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TFormatOption.foDoNotQuoteMembers">
<short>Do not use quote characters around object member names.</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TFormatOption.foUseTabchar">
<short>Use the tabulator character for indents</short>
</element>
<!-- set type Visibility: default -->
<element name="TFormatOptions">
<short>Set of <var>TFormatOption</var> options.</short>
<descr>
<var>TFormatOptions</var> is the set definition used to specify options in
<link id="TJSONData.FormatJSON"/>.
</descr>
<seealso>
<link id="TJSONData.FormatJSON"/>
<link id="TFormatOption"/>
</seealso>
</element>
<!-- constant Visibility: default -->
<element name="DefaultIndentSize">
<short>Default indent size for formatted JSON</short>
<descr>
<var>DefaultIndentSize</var> is the default indent size used in formatted JSON.
</descr>
<seealso>
<link id="TJSONData.FormatJSON"/>
<link id="TFormatOptions"/>
<link id="DefaultFormat"/>
</seealso>
</element>
<!-- constant Visibility: default -->
<element name="DefaultFormat">
<short>Default formatting options</short>
<descr>
<var>DefaultFormat</var> contains the default formatting options used in formatted JSON.
</descr>
<seealso>
<link id="TJSONData.FormatJSON"/>
<link id="TFormatOptions"/>
<link id="AsJSONFormat"/>
<link id="DefaultIndentSize"/>
</seealso>
</element>
<!-- constant Visibility: default -->
<element name="AsJSONFormat">
<short>Formatting options to reproduce JSON</short>
<descr>
<var>AsJSONFormat</var> contains the options that make <link
id="TJSONData.FormatJSON"/> behave like <link id="TJSONData.AsJSON"/>
</descr>
<seealso>
<link id="TJSONData.FormatJSON"/>
<link id="TFormatOptions"/>
<link id="DefaultFormat"/>
<link id="DefaultIndentSize"/>
</seealso>
</element>
<!--
********************************************************************
#fcl.fpjson.TJSONData
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TJSONData">
<short>Base (abstract) object for all JSON based data types</short>
<descr>
<p>
<var>TJSONData</var> is an abstract class which introduces all properties
and methods needed to work with JSON-based data. It should never be
instantiated. Based on the type of data that must be represented one of the
following descendents must be instantiated instead.
</p>
<dl>
<dt>Numbers</dt><dd>must be represented using one of <link id="TJSONIntegerNumber"/>, <link
id="TJSONFloatNumber"/> or <link id="TJSONInt64Number"/>, depending on the
type of the number.</dd>
<dt>Strings</dt><dd>can be represented with <link id="TJSONString"/>.</dd>
<dt>Boolean</dt><dd>can be represented with <link id="TJSONBoolean"/>.</dd>
<dt>null</dt><dd>is supported using <link id="TJSONNull"/></dd>
<dt>Array</dt><dd>data can be represented using <link id="TJSONArray"/></dd>
<dt>Object</dt><dd>data can be supported using <link id="TJSONObject"/></dd>
</dl>
</descr>
<p>
To handle arbitrary data, a variable of type <var>TJSONData</var> can be
declared, and it can be used to handle any of the above. The <link id="AsJSON"/>
property can be read to get a JSON representation of the data.
</p>
<seealso>
<link id="TJSONIntegerNumber"/>
<link id="TJSONString"/>
<link id="TJSONBoolean"/>
<link id="TJSONNull"/>
<link id="TJSONArray"/>
<link id="TJSONObject"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TJSONData.Create">
<short>Create a new instance of TJSONData.</short>
<descr>
<var>Create</var> instantiates a new <var>TJSONData</var> object. It should
never be called directly, instead one of the descendents should be
instantiated.
</descr>
<seealso>
<link id="TJSONIntegerNumber.Create"/>
<link id="TJSONString.Create"/>
<link id="TJSONBoolean.Create"/>
<link id="TJSONNull.Create"/>
<link id="TJSONArray.Create"/>
<link id="TJSONObject.Create"/>
</seealso>
</element>
<!-- class function Visibility: public -->
<element name="TJSONData.JSONType">
<short>The native JSON data type represented by this object</short>
<descr>
<var>JSONType</var> indicates the JSON data type that this object will be
written as, or the JSON data type that instantiated this object.
In <var>TJSONData</var>, this function returns <var>jtUnknown</var>.
Descendents override this method to return the correct data type.
</descr>
<seealso>
<link id="TJSONtype"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONData.JSONType.Result">
<short>The native JSON data type</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONData.Clear">
<short>Clear the raw value of this data object</short>
<descr>
<var>Clear</var> is implemented by the descendents of <var>TJSONData</var>
to clear the data. An array will be emptied, an object will remove all
properties, numbers are set to zero, strings set to the empty string, etc.
</descr>
<seealso>
<link id="Create"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONData.Clone">
<short>Duplicate the value of the JSON data</short>
<descr>
<p>
<var>Clone</var> returns a new instance of the <var>TJSONData</var>
descendent that has the same value as the instance, i.e. the
<var>AsJSON</var> property of the instance and its clone is the same.
</p>
<p>
Note that the clone must be freed by the caller. Freeing a JSON object will not
free its clones.
</p>
</descr>
<errors>
Normally, no JSON-specific errors should occur, but an <link
id="#rtl.systutils.EOutOfMemory">EOutOfMemory</link> exception can be raised.
</errors>
<seealso>
<link id="Clear"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONData.Clone.Result">
<short>A new instance with the same JSON representation</short>
</element>
<!-- function Visibility: public -->
<element name="TJSONData.FormatJSON">
<short>Return a formatted JSON representation of the data.</short>
<descr>
<p>
<var>FormatJSON</var> returns a formatted JSON representation of the data.
For simple JSON values, this is the same representation as the <link
id="AsJSON"/> property, but for complex values (<link id="TJSONArray"/> and
<link id="TJSONObject"/>) the JSON is formatted differently.
</p>
<p>
There are some optional parameters to control the formatting.
<var>Options</var> controls the use of whitespace and newlines.
<var>IndentSize</var> controls the amount of indent applied when starting a
new line.
</p>
<p>
The implementation is not optimized for speed.
</p>
</descr>
<seealso>
<link id="AsJSON"/>
<link id="TFormatOptions"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONData.FormatJSON.Result">
<short>The JSON representation of the instance.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONData.FormatJSON.Options">
<short>Formatting options to apply</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONData.FormatJSON.Indentsize">
<short>Amount of indent to use when starting new lines.</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.Count">
<short>Number of sub-items for this data element</short>
<descr>
<var>Count</var> is the amount of members of this data element. For simple
values (null, boolean, number and string) this is zero. For complex
structures, this is the amount of elements in the array or the number of
properties of the object
</descr>
<seealso>
<link id="Items"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.Items">
<short>Indexed access to sub-items</short>
<descr>
<var>Items</var> allows indexed access to the sub-items of this data. The
<var>Index</var> is 0-based, and runs from 0 to <var>Count-1</var>. For
simple data types, this function always returns <var>Nil</var>, the complex
data type descendents (<link id="TJSONArray"/> and <link id="TJSONObject"/>)
override this method to return the <var>Index</var>-th element in the list.
</descr>
<seealso>
<link id="Count"/>
<link id="TJSONArray"/>
<link id="TJSONObject"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONData.Items.Index">
<short>The index in the array</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.Value">
<short>The value of this data object as a variant.</short>
<descr>
<p>
<var>Value</var> returns the value of the data object as a variant when
read, and converts the variant value to the native JSON type of the object.
It does not change the native JSON type (<link id="JSONType"/>), so the variant
value must be convertible to the native JSON type.
</p>
<p>
For complex types, reading or writing this property will raise an <var>EConvertError</var> exception.
</p>
</descr>
<seealso>
<link id="JSONType"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.AsString">
<short>Access the raw JSON value as a string</short>
<descr>
<p>
<var>AsString</var> allows access to the raw value as a string. When
reading, it converts the native value of the data to a string. When writing,
it attempts to transform the string to a native value. If this conversion fails, an
<var>EConvertError</var> exception is raised.
</p>
<p>
For <link id="TJSONString"/> this will return the native value.
</p>
<p>
For complex values, reading or writing this property will result in an
<var>EConvertError</var> exception.
</p>
</descr>
<seealso>
<link id="AsInteger"/>
<link id="Value"/>
<link id="AsInt64"/>
<link id="AsFloat"/>
<link id="AsBoolean"/>
<link id="IsNull"/>
<link id="AsJSON"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.AsFloat">
<short>Access the raw JSON value as a float</short>
<descr>
<p>
<var>AsFloat</var> allows access to the raw value as a floating-point value. When
reading, it converts the native value of the data to a floating-point. When writing,
it attempts to transform the floating-point value to a native value. If this
conversion fails, an <var>EConvertError</var> exception is raised.
</p>
<p>
For <link id="TJSONFloatNumber"/> this will return the native value.
</p>
<p>
For complex values, reading or writing this property will always result in an
<var>EConvertError</var> exception.
</p>
</descr>
<seealso>
<link id="AsInteger"/>
<link id="Value"/>
<link id="AsInt64"/>
<link id="AsString"/>
<link id="AsBoolean"/>
<link id="IsNull"/>
<link id="AsJSON"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.AsInteger">
<short>Access the raw JSON value as an 32-bit integer</short>
<descr>
<p>
<var>AsInteger</var> allows access to the raw value as a 32-bit integer value.
When reading, it attempts to convert the native value of the data to a 32-bit integer
value. When writing, it attempts to transform the 32-bit integer value to
a native value. If either conversion fails, an <var>EConvertError</var> exception is raised.
</p>
<p>
For <link id="TJSONIntegerNumber"/> this will return the native value.
</p>
<p>
For complex values, reading or writing this property will always result in an
<var>EConvertError</var> exception.
</p>
</descr>
<seealso>
<link id="AsFloat"/>
<link id="Value"/>
<link id="AsInt64"/>
<link id="AsString"/>
<link id="AsBoolean"/>
<link id="IsNull"/>
<link id="AsJSON"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.AsInt64">
<short>Access the raw JSON value as an 64-bit integer</short>
<descr>
<p>
<var>AsInt64</var> allows access to the raw value as a 64-bit integer value.
When reading, it attempts to convert the native value of the data to a
64-bit integer value. When writing, it attempts to transform the 64-bit
integer value to a native value.
If either conversion fails, an <var>EConvertError</var> exception is raised.
</p>
<p>
For <link id="TJSONInt64Number"/> this will return the native value.
</p>
<p>
For complex values, reading or writing this property will always result in an
<var>EConvertError</var> exception.
</p>
</descr>
<seealso>
<link id="AsFloat"/>
<link id="Value"/>
<link id="AsInteger"/>
<link id="AsString"/>
<link id="AsBoolean"/>
<link id="IsNull"/>
<link id="AsJSON"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.AsBoolean">
<short>Access the raw JSON value as a boolean</short>
<descr>
<p>
<var>AsBoolean</var> allows access to the raw value as a boolean value.
When reading, it attempts to convert the native value of the data to a
boolean value. When writing, it attempts to transform the boolean value to a native value.
For numbers this means that nonzero numbers result in <var>True</var>, a zero results
in <var>False</var>.
If either conversion fails, an <var>EConvertError</var> exception is raised.
</p>
<p>
For <link id="TJSONBoolean"/> this will return the native value.
</p>
<p>
For complex values, reading or writing this property will always result in
an <var>EConvertError</var> exception.
</p>
</descr>
<seealso>
<link id="AsFloat"/>
<link id="Value"/>
<link id="AsInt64"/>
<link id="AsString"/>
<link id="AsInteger"/>
<link id="IsNull"/>
<link id="AsJSON"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.IsNull">
<short>Is the data a null value ?</short>
<descr>
<var>IsNull</var> is <var>True</var> only for <var>JSONType=jtNull</var>,
i.e. for a <link id="TJSONNull"/> instance.
In all other cases, it is <var>False</var>. This value cannot be set.
</descr>
<seealso>
<link id="TJSONType"/>
<link id="JSONType"/>
<link id="TJSONNull"/>
<link id="AsFloat"/>
<link id="Value"/>
<link id="AsInt64"/>
<link id="AsString"/>
<link id="AsInteger"/>
<link id="AsBoolean"/>
<link id="AsJSON"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.AsJSON">
<short>Return a JSON representation of the value</short>
<descr>
<var>AsJSON</var> returns a JSON representation of the value of the data.
For simple values, this is just a textual representation of the object.
For objects and arrays, this is an actual JSON Object or array.
</descr>
<seealso>
<link id="AsFloat"/>
<link id="Value"/>
<link id="AsInt64"/>
<link id="AsString"/>
<link id="AsInteger"/>
<link id="AsBoolean"/>
<link id="AsJSON"/>
</seealso>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONDataClass">
<short>Class of <var>TJSONData</var></short>
<descr>
<var>TJSONDataClass</var> is used in the <link id="CreateJSON"/>,
<link id="SetJSONInstanceType"/> and <link id="GetJSONInstanceType"/> functions
to set the actual classes used when creating JSON data.
</descr>
<seealso>
<link id="CreateJSON"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- enumeration type Visibility: default -->
<element name="TJSONNumberType">
<short>Enumerate the different kind of numerical types</short>
<descr>
<var>TJSONNumberType</var> is used to enumerate the different kind of
numerical types: JSON only has a single 'number' format. Depending on how
the value was parsed, FPC tries to create a value that is as close to the
original value as possible: this can be one of integer, int64 or
TJSONFloatType (normally a double). The number types have a common ancestor,
and they are distinguished by their <link id="TJSONNumber.NumberType"/> value.
</descr>
<seealso>
<link id="TJSONNumber.NumberType"/>
</seealso>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONNumberType.ntFloat">
<short>Floating point value</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONNumberType.ntInteger">
<short>32-bit Integer value</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONNumberType.ntInt64">
<short>64-bit integer value</short>
</element>
<!--
********************************************************************
#fcl.fpjson.TJSONNumber
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TJSONNumber">
<short>Common ancestor for the numerical value JSON classes.</short>
<descr>
<var>TJSONNumber</var> is an abstract class which serves as the ancestor for
the 3 numerical classes. It should never be instantiated directly. Instead,
depending on the kind of data, one of <link id="TJSONIntegerNumber"/>,
<link id="TJSONInt64Number"/> or <link id="TJSONFloatNumber"/> should be
instantiated.
</descr>
<seealso>
<link id="TJSONIntegerNumber"/>
<link id="TJSONInt64Number"/>
<link id="TJSONFloatNumber"/>
</seealso>
</element>
<!-- class function Visibility: public -->
<element name="TJSONNumber.JSONType">
<short>native JSON data type</short>
<descr>
<var>JSONType</var> is overridden by <var>TJSONNumber</var> to return <var>jtNumber</var>.
</descr>
<seealso>
<link id="TJSONData.JSONType"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONNumber.JSONType.Result">
<short>Always <var>jtNumber</var></short>
</element>
<!-- class function Visibility: public -->
<element name="TJSONNumber.NumberType">
<short>Kind of numerical data managed by this class.</short>
<descr>
<var>NumberType</var> is overridden by <var>TJSONNumber</var> descendents to
return the kind of numerical data that can be managed by the class.
</descr>
<seealso>
<link id="TJSONIntegerNumber"/>
<link id="TJSONInt64Number"/>
<link id="TJSONFloatNumber"/>
<link id="JSONType"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONNumber.NumberType.Result">
<short>the kind of numerical data managed by this class.</short>
</element>
<!--
********************************************************************
#fcl.fpjson.TJSONFloatNumber
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TJSONFloatNumber">
<short>Class to represent floating-point JSON data.</short>
<descr>
<var>TJSONFloatNumber</var> must be used whenever floating point data must
be represented. It can handle <link id="TJSONFloatType"/> data (normally a
double). For integer data, <link id="TJSONIntegerNumber"/> or <link
id="TJSONInt64Number"/> are better suited.
</descr>
<seealso>
<link id="TJSONIntegerNumber"/>
<link id="TJSONInt64Number"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TJSONFloatNumber.Create">
<short>Create a new floating-point value</short>
<descr>
<var>Create</var> instantiates a new JSON floating point value, and
initializes it with <var>AValue</var>.
</descr>
<seealso>
<link id="TJSONIntegerNumber.Create"/>
<link id="TJSONInt64Number.Create"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONFloatNumber.Create.AValue">
<short>Initial floating point value</short>
</element>
<!-- class function Visibility: public -->
<element name="TJSONFloatNumber.NumberType">
<short>Kind of numerical data managed by this class.</short>
<descr>
<var>NumberType</var> is overridden by <var>TJSONFloatNumber</var> to return
<var>ntFloat</var>.
</descr>
<seealso>
<link id="TJSONNumberType"/>
<link id="TJSONData.JSONtype"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONFloatNumber.NumberType.Result">
<short>Always <var>ntFloat</var></short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONFloatNumber.Clear">
<short>Clear value</short>
<descr>
<var>Clear</var> is overridden by <var>TJSONFloatNumber</var> to set the
value to 0.0
</descr>
<seealso>
<link id="TJSONData.Clear"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONFloatNumber.Clone">
<short>Clone floating point value</short>
<descr>
<var>Clone</var> overrides <link id="TJSONData.Clone"/> and creates an instance of the same class with the same
floating-point value.
</descr>
<seealso>
<link id="TJSONData.Clone"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONFloatNumber.Clone.Result">
<short>New instance of <var>TJSONFloatNumber</var> with the same value</short>
</element>
<!--
********************************************************************
#fcl.fpjson.TJSONIntegerNumber
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TJSONIntegerNumber">
<short>Class to represent 32-bit integer JSON data.</short>
<descr>
<var>TJSONIntegerNumber</var> must be used whenever 32-bit integer data must
be represented. For 64-bit integer data, <link id="TJSONInt64Number"/> must be used.
</descr>
<seealso>
<link id="TJSONFloatNumber"/>
<link id="TJSONInt64Number"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TJSONIntegerNumber.Create">
<short>Create a new instance of 32-bit integer JSON data</short>
<descr>
<var>Create</var> instantiates a new 32-bit integer JSON data and initializes the
value with <var>AValue</var>.
</descr>
<seealso>
<link id="TJSONFloatNumber.Create"/>
<link id="TJSONInt64Number.Create"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONIntegerNumber.Create.AValue">
<short>Initial value for the integer data</short>
</element>
<!-- class function Visibility: public -->
<element name="TJSONIntegerNumber.NumberType">
<short>Kind of numerical data managed by this class.</short>
<descr>
<var>NumberType</var> is overridden by <var>TJSONIntegerNumber</var> to return
<var>ntInteger</var>.
</descr>
<seealso>
<link id="TJSONNumberType"/>
<link id="TJSONData.JSONtype"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONIntegerNumber.NumberType.Result">
<short>Always <var>ntInteger</var></short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONIntegerNumber.Clear">
<short>Clear value</short>
<descr>
<var>Clear</var> is overridden by <var>TJSONIntegerNumber</var> to set the
value to 0.
</descr>
<seealso>
<link id="TJSONData.Clear"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONIntegerNumber.Clone">
<short>Clone 32-bit integer value</short>
<descr>
<var>Clone</var> overrides <link id="TJSONData.Clone"/> and creates an instance of the same class with the same
32-bit integer value.
</descr>
<seealso>
<link id="TJSONData.Clone"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONIntegerNumber.Clone.Result">
<short>New instance of <var>TJSONIntegerNumber</var> with the same integer value</short>
</element>
<!--
********************************************************************
#fcl.fpjson.TJSONInt64Number
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TJSONInt64Number">
<short>Class to represent 64-bit integer JSON data.</short>
<descr>
<var>TJSONInt64Number</var> must be used whenever 64-bit integer data must
be represented. For 32-bit integer data, <link id="TJSONIntegerNumber"/> must
be used.
</descr>
<seealso>
<link id="TJSONFloatNumber"/>
<link id="TJSONIntegerNumber"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TJSONInt64Number.Create">
<short>Create a new instance of 64-bit integer JSON data</short>
<descr>
<var>Create</var> instantiates a new 64-bit integer JSON data and
initializes the value with <var>AValue</var>.
</descr>
<seealso>
<link id="TJSONIntegerNumber.Create"/>
<link id="TJSONFloatNumber.Create"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONInt64Number.Create.AValue">
<short>Initial 64-bit integer value</short>
</element>
<!-- class function Visibility: public -->
<element name="TJSONInt64Number.NumberType">
<short>Kind of numerical data managed by this class.</short>
<descr>
<var>NumberType</var> is overridden by <var>TJSONInt64Number</var> to return
<var>ntInt64</var>.
</descr>
<seealso>
<link id="TJSONNumberType"/>
<link id="TJSONData.JSONtype"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONInt64Number.NumberType.Result">
<short>Always <var>ntInt64</var></short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONInt64Number.Clear">
<short>Clear value</short>
<descr>
<var>Clear</var> is overridden by <var>TJSONInt64Number</var> to set the value to 0.
</descr>
<seealso>
<link id="TJSONData.Clear"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONInt64Number.Clone">
<short>Clone 64-bit integer value</short>
<descr>
<var>Clone</var> overrides <link id="TJSONData.Clone"/> and creates an instance of the same class with the same
64-bit integer value.
</descr>
<seealso>
<link id="TJSONData.Clone"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONInt64Number.Clone.Result">
<short>New instance of <var>TJSONInt64Number</var> with the same int64 value</short>
</element>
<!--
********************************************************************
#fcl.fpjson.TJSONString
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TJSONString">
<short>Class to represent string JSON data.</short>
<descr>
<var>TJSONString</var> must be used whenever string data must be represented.
Currently the implementation uses an ANSI string to hold the data.
This means that to correctly hold Unicode data, a UTF-8 encoding must be used.
</descr>
<seealso>
<link id="TJSONFloatNumber"/>
<link id="TJSONIntegerNumber"/>
<link id="TJSONInt64Number"/>
<link id="TJSONBoolean"/>
<link id="TJSONNull"/>
<link id="TJSONArray"/>
<link id="TJSONObject"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TJSONString.Create">
<short>Create a new instance of string JSON data</short>
<descr>
<var>Create</var> instantiates a new string JSON data and initializes the value with <var>AValue</var>.
Currently the implementation uses an ANSI string to hold the data.
This means that to correctly hold Unicode data, a UTF-8 encoding must be used.
</descr>
<seealso>
<link id="TJSONIntegerNumber.Create"/>
<link id="TJSONFloatNumber.Create"/>
<link id="TJSONInt64Number.Create"/>
<link id="TJSONBoolean.Create"/>
<link id="TJSONNull.Create"/>
<link id="TJSONArray.Create"/>
<link id="TJSONObject.Create"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONString.Create.AValue">
<short>Initial string value.</short>
</element>
<!-- class function Visibility: public -->
<element name="TJSONString.JSONType">
<short>native JSON data type</short>
<descr>
<var>JSONType</var> is overridden by <var>TJSONString</var> to return <var>jtString</var>.
</descr>
<seealso>
<link id="TJSONData.JSONType"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONString.JSONType.Result">
<short>Always <var>jtString</var></short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONString.Clear">
<short>Clear value</short>
<descr>
<var>Clear</var> is overridden by <var>TJSONString</var> to set the
value to the empty string ''.
</descr>
<seealso>
<link id="TJSONData.Clear"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONString.Clone">
<short>Clone string value</short>
<descr>
<var>Clone</var> overrides <link id="TJSONData.Clone"/> and creates an instance of the same class with the same
string value.
</descr>
<seealso>
<link id="TJSONData.Clone"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONString.Clone.Result">
<short>New instance of <var>TJSONString</var> with the same string value</short>
</element>
<!--
********************************************************************
#fcl.fpjson.TJSONBoolean
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TJSONBoolean">
<short>Class to represent boolean JSON data.</short>
<descr>
<var>TJSONBoolean</var> must be used whenever boolean data must be
represented. It has limited functionality to convert the value from or to integer or
floating point data.
</descr>
<seealso>
<link id="TJSONFloatNumber"/>
<link id="TJSONIntegerNumber"/>
<link id="TJSONInt64Number"/>
<link id="TJSONBoolean"/>
<link id="TJSONNull"/>
<link id="TJSONArray"/>
<link id="TJSONObject"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TJSONBoolean.Create">
<short>Create a new instance of boolean JSON data</short>
<descr>
<var>Create</var> instantiates a new boolean JSON data and initializes the
value with <var>AValue</var>.
</descr>
<seealso>
<link id="TJSONIntegerNumber.Create"/>
<link id="TJSONFloatNumber.Create"/>
<link id="TJSONInt64Number.Create"/>
<link id="TJSONString.Create"/>
<link id="TJSONNull.Create"/>
<link id="TJSONArray.Create"/>
<link id="TJSONObject.Create"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONBoolean.Create.AValue">
<short>Initial boolean value</short>
</element>
<!-- class function Visibility: public -->
<element name="TJSONBoolean.JSONType">
<short>native JSON data type</short>
<descr>
<var>JSONType</var> is overridden by <var>TJSONString</var> to return <var>jtBoolean</var>.
</descr>
<seealso>
<link id="TJSONData.JSONType"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONBoolean.JSONType.Result">
<short>Always <var>jtBoolean</var></short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONBoolean.Clear">
<short>Clear data</short>
<descr>
<var>Clear</var> is overridden by <var>TJSONBoolean</var> to set the
value to <var>False</var>.
</descr>
<seealso>
<link id="TJSONData.Clear"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONBoolean.Clone">
<short>Clone boolean value</short>
<descr>
<var>Clone</var> overrides <link id="TJSONData.Clone"/> and creates an instance of the same class with the same
boolean value.
</descr>
<seealso>
<link id="TJSONData.Clone"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONBoolean.Clone.Result">
<short>New instance of <var>TJSONBoolean</var> with the same boolean value</short>
</element>
<!--
********************************************************************
#fcl.fpjson.TJSONNull
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TJSONNull">
<short>Class to represent boolean JSON data.</short>
<descr>
<var>TJSONNull</var> must be used whenever a <var>null</var> value must be
represented.
</descr>
<seealso>
<link id="TJSONFloatNumber"/>
<link id="TJSONIntegerNumber"/>
<link id="TJSONInt64Number"/>
<link id="TJSONBoolean"/>
<link id="TJSONString"/>
<link id="TJSONArray"/>
<link id="TJSONObject"/>
</seealso>
</element>
<!-- class function Visibility: public -->
<element name="TJSONNull.JSONType">
<short>native JSON data type</short>
<descr>
<var>JSONType</var> is overridden by <var>TJSONNull</var> to return <var>jtNull</var>.
</descr>
<seealso>
<link id="TJSONData.JSONType"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONNull.JSONType.Result">
<short>Always <var>jtNull</var></short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONNull.Clear">
<short>Clear data</short>
<descr>
<var>Clear</var> does nothing.
</descr>
<seealso>
<link id="TJSONData.Clear"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONNull.Clone">
<short>Clone boolean value</short>
<descr>
<var>Clone</var> overrides <link id="TJSONData.Clone"/> and creates an instance of the same class.
</descr>
<seealso>
<link id="TJSONData.Clone"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONNull.Clone.Result">
<short>New instance of <var>TJSONNull</var></short>
</element>
<!-- procedure type Visibility: default -->
<element name="TJSONArrayIterator">
<short>Iterator callback for <var>TJSONArray.Iterate</var></short>
<descr>
<var>TJSONArrayIterator</var> is the procedural callback used by <link
id="TJSONArray.Iterate"/> to iterate over the values. <var>Item</var> is the
current item in the iteration. <var>Data</var> is the data passed on when
calling <var>Iterate</var>. The <var>Continue</var> parameter can be set to
<var>false</var> to stop the iteration loop.
</descr>
<seealso>
<link id="TJSONArray.Iterate"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TJSONArrayIterator.Item">
<short>Current item</short>
</element>
<!-- argument Visibility: default -->
<element name="TJSONArrayIterator.Data">
<short>extra data</short>
</element>
<!-- argument Visibility: default -->
<element name="TJSONArrayIterator.Continue">
<short>Continue iterating or not ?</short>
</element>
<!--
********************************************************************
#fcl.fpjson.TJSONArray
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TJSONArray">
<short>Class to represent array data</short>
<descr>
<p>
<var>TJSONArray</var> is the class that must be used to represent array
data. In difference with pascal arrays, the array elements can be of any
valid JSON data type. It is similar to a <link
id="#fcl.contnrs.TObjectList">TObjectList</link> in that the memory
management is automatic: the array grows and shrinks to accommodate the
number of element in it. The elements in the array are owned by the array,
so they should not be freed.
</p>
<p>
The array can be created empty or can be created with a series of values
that will be converted to JSON objects and added to the initial JSON array.
</p>
<p>
The items in the array are available as raw JSON objects in the <link
id="TJSONData.Items"/> property. The data can also be accessed (read-write)
as native Pascal types through the <link id="Integers"/>, <link id="Floats"/>,
<link id="Booleans"/> etc. array properties. The actual JSON types are available
in the <link id="Types"/> array.
</p>
<p>Elements can be added to the array using the various forms of the
<link id="Add"/> and <link id="Insert"/> methods. Elements can be deleted
with the <link id="Delete"/> method.
</p>
</descr>
<seealso>
<link id="Types"/>
<link id="Integers"/>
<link id="Floats"/>
<link id="TJSONData.Items"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TJSONArray.Create">
<short>Create a new instance of JSON array data.</short>
<descr>
<p>
<var>Create</var> creates a new JSON array instance, and initializes the
data with <var>Elements</var>. The elements are converted to various <link
id="TJSONData"/> instances, instances of <var>TJSONData</var> are
inserted in the array as-is.
</p>
<p>
The data type of the inserted objects is determined from the type of data
passed to it, with a natural mapping. A <var>Nil</var> pointer will be
inserted as a <var>TJSONNull</var> value.
</p>
</descr>
<errors>
If an invalid class or not recognized data type (pointer) is inserted in the
elements array, an <var>EConvertError</var> exception will be raised.
</errors>
<seealso>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Create.Elements">
<short>Data to add to the array.</short>
</element>
<!-- destructor Visibility: public -->
<element name="TJSONArray.Destroy">
<short>Free the JSON array</short>
<descr>
<var>Destroy</var> will delete all elements in the array and clean up the
<link id="TJSONArray"/> instance.
</descr>
<seealso>
<link id="TJSONArray.Clear"/>
<link id="TJSONArray.Create"/>
</seealso>
</element>
<!-- class function Visibility: public -->
<element name="TJSONArray.JSONType">
<short>native JSON data type</short>
<descr>
<var>JSONType</var> is overridden by <var>TJSONArray</var> to return
<var>jtArray</var>.
</descr>
<seealso>
<link id="TJSONData.JSONType"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONArray.JSONType.Result">
<short>Always <var>jtArray</var></short>
</element>
<!-- function Visibility: public -->
<element name="TJSONArray.Clone">
<short>Clone the JSON array</short>
<descr>
<var>Clone</var> creates a new <var>TJSONArray</var>, clones all elements in
the array and adds them to the newly created array in the same order as they
are in the array.
</descr>
<seealso>
<link id="TJSONData.Clone"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONArray.Clone.Result">
<short>Cloned TJSONArray instance.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONArray.Iterate">
<short>Iterate over all elements in the array</short>
<descr>
<var>Iterate</var> iterates over all elements in the array, passing them one
by one to the <var>Iterator</var> callback, together with the <var>Data</var> parameter.
The iteration stops when all elements have been passed or when the iterator
callback returned <var>False</var> in the <var>Continue</var> parameter.
</descr>
<seealso>
<link id="TJSONArrayIterator"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Iterate.Iterator">
<short>Iterator callback, called for each element in the array.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Iterate.Data">
<short>Data item passed to the iterator with each call.</short>
</element>
<!-- function Visibility: public -->
<element name="TJSONArray.IndexOf">
<short>Return index of JSONData instance in array</short>
<descr>
<var>IndexOf</var> compares all elements in the array with <var>Obj</var>
and returns the index of the element instance that equals <var>Obj</var>.
The actual instances are compared, not the JSON value. If none of the
elements match, the function returns -1.
</descr>
<seealso>
<link id="Clear"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONArray.IndexOf.Result">
<short>Index of <var>Obj</var> in the array, or -1.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.IndexOf.obj">
<short>Object instance to search for.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONArray.Clear">
<short>Clear the array</short>
<descr>
<var>Clear</var> clears the array and frees all elements in it. After the
call to clear, <link id="TJSONData.Count">Count</link> returns 0.
</descr>
<seealso>
<link id="Delete"/>
<link id="Extract"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONArray.Add">
<short>Add a JSON value to the array</short>
<descr>
<p>
<var>Add</var> adds the value passed on to the array. If it is a plain
pascal value, it is converted to an appropriate <link id="TJSONData"/>
instance. If a <var>TJSONData</var> instance is passed, it is simply added
to the array. Note that the instance will be owned by the array, and
destroyed when the array is cleared (this is in particular true is an JSON
array or object).
</p>
<p>
The function returns the <var>TJSONData</var> instance that was added to
the array.
</p>
</descr>
<seealso>
<link id="Delete"/>
<link id="Extract"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONArray.Add.Result">
<short>TJSONData instance that was added.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Add.Item">
<short>TJSONData instance to add to array.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Add.I">
<short>Integer value to add to array</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Add.S">
<short>String value to add to array</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Add.F">
<short>Floating point value to add to array</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Add.B">
<short>Boolean value to array</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Add.AnArray">
<short>JSON Array to add to array.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Add.AnObject">
<short>JSON Object to add to array.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONArray.Delete">
<short>Delete an element from the list by index</short>
<descr>
<var>Delete</var> deletes the element with given <var>Index</var> from the
list. The <link id="TJSONData"/> element is freed.
</descr>
<errors>
If an invalid index is passed, an exception is raised.
</errors>
<seealso>
<link id="Clear"/>
<link id="Add"/>
<link id="Extract"/>
<link id="Exchange"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Delete.Index">
<short>Index of the element to delete.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONArray.Exchange">
<short>Exchange 2 elements in the list</short>
<descr>
<var>Exchange</var> exchanges 2 elements at locations <var>Index1</var> and
<var>Index2</var> in the list. This is more efficient than manually
extracting and adding the elements to the list.
</descr>
<errors>
If an invalid index (for either element) is passed, an exception is raised.
</errors>
<seealso>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Exchange.Index1">
<short>Index of the first element</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Exchange.Index2">
<short>Index of the second element.</short>
</element>
<!-- function Visibility: public -->
<element name="TJSONArray.Extract">
<short>Extract an element from the array</short>
<descr>
<var>Extract</var> removes the element at position <var>Index</var> or the
indicated element from the list, just as <link id="Delete"/> does. In difference
with <var>Delete</var>, it does not free the object instance. Instead,
it returns the extracted element.
</descr>
<errors>
</errors>
<seealso>
<link id="Delete"/>
<link id="Clear"/>
<link id="Insert"/>
<link id="Add"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONArray.Extract.Result">
<short>Extracted element</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Extract.Item">
<short>Item to extract from the array</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Extract.Index">
<short>Index of item to extract from the array</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONArray.Insert">
<short>Insert an element in the array.</short>
<descr>
<p>
<var>Insert</var> adds a value or element to the array at position
<var>Index</var>. Elements with index equal to or larger than
<var>Index</var> are shifted. Like <link id="Add"/>, it converts plain
pascal values to JSON values.
</p>
<p>Note that when inserting a <link
id="TJSONData"/> instance to the array, it is owned by the array.
<var>Index</var> must be a value between 0 and <var>Count-1</var>.
</p>
</descr>
<errors>
If an invalid index is specified, an exception is raised.
</errors>
<seealso>
<link id="Add"/>
<link id="Delete"/>
<link id="Extract"/>
<link id="Clear"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Insert.Index">
<short>Position at which to insert the new value</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Insert.Item">
<short>JSON Data object to insert.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Insert.I">
<short>Integer value to insert</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Insert.S">
<short>String value to insert</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Insert.F">
<short>Floating point value to insert</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Insert.B">
<short>Boolean value to insert</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Insert.AnArray">
<short>JSON array to insert.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Insert.AnObject">
<short>JSON Object to insert</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONArray.Move">
<short>Move a value from one location to another</short>
<descr>
<var>Move</var> moves the element at index <var>CurIndex</var> to the
position <var>NewIndex</var>. It will shift the elements in between as
needed. This operation is more efficient than extracting and inserting the
element manually.
</descr>
<seealso>
<link id="Exchange"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Move.CurIndex">
<short>Current index of the element</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Move.NewIndex">
<short>Final index of the element.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONArray.Remove">
<short>Remove an element from the list</short>
<descr>
<var>Remove</var> removes <var>item</var> from the array, if it is in the
array. The object pointer is checked for presence in the array, not the JSON values.
Note that the element is freed if it was in the array and is removed.
</descr>
<seealso>
<link id="Delete"/>
<link id="Extract"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Remove.Item">
<short>Item to remove from the array</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.Items">
<short>Indexed access to the values in the array</short>
<descr>
<var>Items</var> is introduced in <link id="TJSONData.Items"/>.
<var>TJSONArray</var> simply declares it as the default property.
</descr>
<seealso>
<link id="TJSONData.Items"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.Types">
<short>JSON types of elements in the array</short>
<descr>
<p>
<var>Types</var> gives direct access to the <link id="TJSONData.JSONType"/>
result of the elements in the array. Accessing it is equivalent to accessing
</p>
<code>
Items[Index].JSONType
</code>
</descr>
<seealso>
<link id="TJSONData.JSONType"/>
<link id="TJSONData.Items"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Types.Index">
<short>Index of element whose type must be read</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.Nulls">
<short>Check which elements are null</short>
<descr>
<p>
<var>Nulls</var> gives direct access to the <link id="TJSONData.IsNull"/>
property when reading. It is then equivalent to accessing
</p>
<code>
Items[Index].IsNull
</code>
</descr>
<seealso>
<link id="TJSONData.JSONType"/>
<link id="TJSONData.Items"/>
<link id="TJSONData.IsNull"/>
<link id="TJSONArray.Types"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Nulls.Index">
<short>Element to check for <var>null</var> value</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.Integers">
<short>Get or set elements as integer values</short>
<descr>
<p>
<var>Integers</var> gives direct access to the <link id="TJSONData.AsInteger"/>
property when reading. Reading it is the equivalent to accessing
</p>
<code>
Items[Index].AsInteger
</code>
<p>
When writing, it will check if an integer JSON value is located at the given
location, and replace it with the new value. If a non-integer JSON value is
there, it is replaced with the written integer value.
</p>
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="TJSONData.IsNull"/>
<link id="TJSONArray.Types"/>
<link id="TJSONArray.Int64s"/>
<link id="TJSONArray.QWords"/>
<link id="TJSONArray.Floats"/>
<link id="TJSONArray.Strings"/>
<link id="TJSONArray.Booleans"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Integers.Index">
<short>Index of element to read or write</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.Int64s">
<short>Get or set elements as Int64 values</short>
<descr>
<p>
<var>Int64s</var> gives direct access to the <link id="TJSONData.AsInt64"/>
property when reading. Reading it is the equivalent to accessing
</p>
<code>
Items[Index].AsInt64
</code>
<p>
When writing, it will check if an 64-bit integer JSON value is located at the given
location, and replace it with the new value. If a non-64-bit-integer JSON value is
there, it is replaced with the written int64 value.
</p>
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="TJSONData.IsNull"/>
<link id="TJSONArray.Types"/>
<link id="TJSONArray.Integers"/>
<link id="TJSONArray.Floats"/>
<link id="TJSONArray.Strings"/>
<link id="TJSONArray.Booleans"/>
<link id="TJSONArray.QWords"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Int64s.Index">
<short>Index of element to read/write</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.Strings">
<short>Get or set elements as string values</short>
<descr>
<p>
<var>Strings</var> gives direct access to the <link id="TJSONData.AsString"/>
property when reading. Reading it is the equivalent to accessing
</p>
<code>
Items[Index].AsString
</code>
<p>
When writing, it will check if a string JSON value is located at the given
location, and replace it with the new value. If a non-string value is
there, it is replaced with the written string value.
</p>
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="TJSONData.IsNull"/>
<link id="TJSONArray.Types"/>
<link id="TJSONArray.Integers"/>
<link id="TJSONArray.QWords"/>
<link id="TJSONArray.Floats"/>
<link id="TJSONArray.Int64s"/>
<link id="TJSONArray.Booleans"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Strings.Index">
<short>Index of element to read/write</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.Floats">
<short>Get or set elements as floating-point numerical values</short>
<descr>
<p>
<var>Floats</var> gives direct access to the <link id="TJSONData.AsFloat"/>
property when reading. Reading it is the equivalent to accessing
</p>
<code>
Items[Index].AsFloat
</code>
<p>
When writing, it will check if a floating point numerical JSON value is located at the given
location, and replace it with the new value. If a non-floating point
numerical value is there, it is replaced with the written floating point value.
</p>
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="TJSONData.IsNull"/>
<link id="TJSONArray.Types"/>
<link id="TJSONArray.Integers"/>
<link id="TJSONArray.Strings"/>
<link id="TJSONArray.Int64s"/>
<link id="TJSONArray.QWords"/>
<link id="TJSONArray.Booleans"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Floats.Index">
<short>Index of element to read/write</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.Booleans">
<short>Get or set elements as boolean values</short>
<descr>
<p>
<var>Floats</var> gives direct access to the <link id="TJSONData.AsBoolean"/>
property when reading. Reading it is the equivalent to accessing
</p>
<code>
Items[Index].AsBoolean
</code>
<p>
When writing, it will check if a boolean JSON value is located at the given
location, and replace it with the new value. If a non-boolean value is there,
it is replaced with the written boolean value.
</p>
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="TJSONData.IsNull"/>
<link id="TJSONArray.Types"/>
<link id="TJSONArray.Integers"/>
<link id="TJSONArray.Strings"/>
<link id="TJSONArray.Int64s"/>
<link id="TJSONArray.QWords"/>
<link id="TJSONArray.Floats"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Booleans.Index">
<short>Index of element to read/write</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.Arrays">
<short>Get or set elements as JSON array values</short>
<descr>
<p>
<var>Arrays</var> gives direct access to JSON Array values
when reading. Reading it is the equivalent to accessing
</p>
<code>
Items[Index] As TJSONArray
</code>
<p>
When writing, it will replace any previous value at that location with the
written value. Note that the old value is freed, and the new value is owned
by the array.
</p>
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="TJSONData.IsNull"/>
<link id="TJSONArray.Types"/>
<link id="TJSONArray.Integers"/>
<link id="TJSONArray.Strings"/>
<link id="TJSONArray.Int64s"/>
<link id="TJSONArray.QWords"/>
<link id="TJSONArray.Floats"/>
<link id="TJSONArray.Objects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Arrays.Index">
<short>Index of element to read/write</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.Objects">
<short>Get or set elements as JSON object values</short>
<descr>
<p>
<var>Objects</var> gives direct access to JSON object values
when reading. Reading it is the equivalent to accessing
</p>
<code>
Items[Index] As TJSONObject
</code>
<p>
When writing, it will replace any previous value at that location with the
whiten value. Note that the old value is freed, and the new value is owned
by the array.
</p>
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="TJSONData.IsNull"/>
<link id="TJSONArray.Types"/>
<link id="TJSONArray.Integers"/>
<link id="TJSONArray.Strings"/>
<link id="TJSONArray.Int64s"/>
<link id="TJSONArray.QWords"/>
<link id="TJSONArray.Floats"/>
<link id="TJSONArray.Arrays"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Objects.Index">
<short>Index of element to read/write</short>
</element>
<!-- procedure type Visibility: default -->
<element name="TJSONObjectIterator">
<short>Iterator callback for <var>TJSONObject.Iterate</var></short>
<descr>
<var>TJSONObjectIterator</var> is the procedural callback used by
<link id="TJSONObject.Iterate"/> to iterate over the values. <var>Item</var> is the
current item in the iteration, and <var>AName</var> it's name.
<var>Data</var> is the data passed on when calling <var>Iterate</var>.
The <var>Continue</var> parameter can be set to
<var>false</var> to stop the iteration loop.
</descr>
<seealso>
<link id="TJSONObject.Iterate"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TJSONObjectIterator.AName">
<short>Name (key) of the current item in the object</short>
</element>
<!-- argument Visibility: default -->
<element name="TJSONObjectIterator.Item">
<short>Current item</short>
</element>
<!-- argument Visibility: default -->
<element name="TJSONObjectIterator.Data">
<short>Data passed on to Iterate call</short>
</element>
<!-- argument Visibility: default -->
<element name="TJSONObjectIterator.Continue">
<short>Set to false to stop the iteration</short>
</element>
<!--
********************************************************************
#fcl.fpjson.TJSONObject
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TJSONObject">
<short>Class to represent a JSON object literal</short>
<descr>
<p>
<var>TJSONObject</var> is the class that must be used to represent a JSON
object literal. It can be compared to a dictionary class or a list class in
which the list index is a string value, or indeed a proper class with an
arbitrary number of properties. The elements can be of any valid JSON data type.
The memory management is automatic: the object grows and shrinks to accommodate the
number of elements (properties) in it. The elements in the array are owned by the
object, so they should not be freed.
</p>
<p>
The object can be created empty or can be created with a series of named values
that will be converted to JSON objects and added to the initial JSON array.
</p>
<p>
The items in the object are available with a numerical index as raw JSON objects in the <link
id="TJSONData.Items"/> and with their names in the <link id="Elements"/> property.
The data can also be accessed (read-write) as native Pascal types through the <link id="Integers"/>, <link
id="Floats"/>, <link id="Booleans"/> etc. array properties, using their name
as a key. The actual JSON types are available in the <link id="Types"/> array.
</p>
<p>Elements can be added to the array using the various forms of the
<link id="Add"/> method. Elements can be deleted with the <link id="Delete"/> method.
</p>
</descr>
<seealso>
<link id="Types"/>
<link id="Integers"/>
<link id="Floats"/>
<link id="TJSONData.Items"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TJSONObject.Create">
<short>Create a new instance of JSON object data.</short>
<descr>
<p>
<var>Create</var> creates a new JSON object instance, and initializes the
data with <var>Elements</var>. Elements is an array containing an even
number of items, alternating a name and a value. The names must be strings,
and the values are converted to various <link id="TJSONData"/> instances.
If a value is an instance of <var>TJSONData</var>, it is added to the object
array as-is.
</p>
<p>
The data type of the inserted objects is determined from the type of data
passed to it, with a natural mapping. A <var>Nil</var> pointer will be
inserted as a <var>TJSONNull</var> value. The following gives an example:
</p>
<code>
Var
O : TJSONObject;
begin
O:=TJSONObject.Create(['Age',44,
'Firstname','Michael',
'Lastname','Van Canneyt']);
</code>
</descr>
<errors>
<p>
An <var>EConvertError</var> exception is raised in one of the following cases:
</p>
<ol>
<li>If an odd number of arguments is passed</li>
<li>an item where a name is expected does not contain a string</li>
<li>A value contains an invalid class</li>
<li>A value of a not recognized data type (pointer) is inserted in the
elements</li>
</ol>
</errors>
<seealso>
<link id="Add"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Create.Elements">
<short>Names and corresponding values to be added to the object</short>
</element>
<!-- destructor Visibility: public -->
<element name="TJSONObject.Destroy">
<short>Free the JSON object</short>
<descr>
<var>Destroy</var> will delete all elements in the array and clean up the
<link id="TJSONObject"/> instance.
</descr>
<seealso>
<link id="TJSONObject.Clear"/>
<link id="TJSONObject.Create"/>
</seealso>
</element>
<!-- class function Visibility: public -->
<element name="TJSONObject.JSONType">
<short>native JSON data type</short>
<descr>
<var>JSONType</var> is overridden by <var>TJSONObject</var> to return
<var>jtObject</var>.
</descr>
<seealso>
<link id="TJSONData.JSONType"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONObject.JSONType.Result">
<short>Always <var>jtObject</var></short>
</element>
<!-- function Visibility: public -->
<element name="TJSONObject.Clone">
<short>Clone the JSON object</short>
<descr>
<var>Clone</var> creates a new <var>TJSONObject</var>, clones all elements in
the array and adds them to the newly created array with the same names as they
were in the array.
</descr>
<seealso>
<link id="TJSONData.Clone"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONObject.Clone.Result">
<short>Cloned TJSONObject instance.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONObject.Iterate">
<short>Iterate over all elements in the object</short>
<descr>
<var>Iterate</var> iterates over all elements in the object, passing them one
by one with name and value to the <var>Iterator</var> callback, together with the
<var>Data</var> parameter.
The iteration stops when all elements have been passed or when the iterator
callback returned <var>False</var> in the <var>Continue</var> parameter.
</descr>
<seealso>
<link id="TJSONObjectIterator"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Iterate.Iterator">
<short>Iterator callback, called for each element in the array.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Iterate.Data">
<short>Data item passed to the iterator with each call.</short>
</element>
<!-- function Visibility: public -->
<element name="TJSONObject.IndexOf">
<short>Return index of JSONData instance in object</short>
<descr>
<var>IndexOf</var> compares all elements in the object with <var>Obj</var>
and returns the index (in the <link id="TJSONData.Items"/> property)
of the element instance that equals <var>Obj</var>.
The actual instances are compared, not the JSON value. If none of the
elements match, the function returns -1.
</descr>
<seealso>
<link id="Clear"/>
<link id="IndexOfName"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONObject.IndexOf.Result">
<short>Index of <var>Obj</var> in the array, or -1.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.IndexOf.Item">
<short>Object instance to search for.</short>
</element>
<!-- function Visibility: public -->
<element name="TJSONObject.IndexOfName">
<short>Return index of name in item list</short>
<descr>
<p>
<var>IndexOfName</var> compares the names of all elements in the object with
<var>AName</var> and returns the index (in the <link id="TJSONData.Items"/> property)
of the element instance whose name matched <var>AName</var>.
If none of the element's names match, the function returns -1.
</p>
<p>
Since JSON is a case-sensitive specification, the names are searched
case-sensitively by default. This can be changed by setting the optional
<var>CaseInsensitive</var> parameter to <var>True</var>
</p>
</descr>
<seealso>
<link id="IndexOf"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONObject.IndexOfName.Result">
<short>Index of <var>AName</var> in the array, or -1.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.IndexOfName.AName">
<short>Name to search for.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.IndexOfName.CaseInsensitive">
<short>Search case-insensitively or not ?</short>
</element>
<!-- function Visibility: public -->
<element name="TJSONObject.Find">
<short>Find an element by name.</short>
<descr>
<p>
<var>Find</var> compares the names of all elements in the object with
<var>AName</var> and returns the matching element.
If none of the element's names match, the function returns <var>Nil</var>
</p>
<p>
Since JSON is a case-sensitive specification, the names are searched
case-sensitively.
</p>
<p>
If <var>AType</var> is specified then the element's type must also match the
specified type.
</p>
</descr>
<seealso>
<link id="IndexOf"/>
<link id="IndexOfName"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONObject.Find.Result">
<short>Data element corresponding to <var>AName</var></short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Find.AName">
<short>Name to search for.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Find.AType">
<short>Type to match.</short>
</element>
<!-- function Visibility: public -->
<element name="TJSONObject.Get">
<short>Retrieve a value by name</short>
<descr>
<p>
<var>Get</var> can be used to retrieve a value by name. If an element with
name equal to <var>AName</var> exists, and its type corresponds to the type
of the <var>ADefault</var>, then the value is returned. If no element
element with the correct type exists, the <var>ADefault</var> value is
returned.
</p>
<p>
If no default is specified, the value is returned as a variant type,
or Null if no value was found.
</p>
<p>
The other value retrieval properties such as <link id="Integers"/>
<link id="Int64s"/>, <link id="Booleans"/>, <link id="Strings"/>,
<link id="Floats"/>, <link id="Arrays"/>, <link id="Objects"/>
will raise an exception if the name is not found. The <var>Get</var>
function does not raise an exception.
</p>
</descr>
<seealso>
<link id="Integers"/>
<link id="Int64s"/>
<link id="Booleans"/>
<link id="Strings"/>
<link id="Floats"/>
<link id="Arrays"/>
<link id="Objects"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONObject.Get.Result">
<short>The requested value</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Get.AName">
<short>Name of the value to retrieve</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Get.ADefault">
<short>Default value to return if no value is found or it has the wrong type.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONObject.Clear">
<short>Clear the object</short>
<descr>
<var>Clear</var> clears the object and frees all elements in it. After the
call to <var>Clear</var>, <link id="TJSONData.Count">Count</link> returns 0.
</descr>
<seealso>
<link id="Delete"/>
<link id="Extract"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONObject.Add">
<short>Add a name, value to the object</short>
<descr>
<p>
<var>Add</var> adds the value <var>AValue</var> with name <var>AName</var>
to the object. If the value is not a <link id="TJSONData"/> descendent, then
it is converted to a <var>TJSONData</var> value, and it returns the
<var>TJSONData</var> descendent that was created to add the value.
</p>
<p>
The properties <link id="Integers"/>, <link id="Int64s"/>, <link id="Booleans"/>
<link id="Strings"/>, <link id="Floats"/>, <link id="Arrays"/> and <link id="Objects"/>
will not raise an exception if an existing name is used, they will overwrite
any existing value.
</p>
</descr>
<errors>
If a value with the same name already exists, an exception is raised.
</errors>
<seealso>
<link id="Integers"/>
<link id="Int64s"/>
<link id="Booleans"/>
<link id="Strings"/>
<link id="Floats"/>
<link id="Arrays"/>
<link id="Objects"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONObject.Add.Result">
<short>The resulting TJSONData descendent</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Add.AName">
<short>Name to add the value with.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Add.AValue">
<short>Value to add to the object.</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONObject.Delete">
<short>Delete an element from the list by index</short>
<descr>
<var>Delete</var> deletes the element with given <var>Index</var> or
<var>AName</var> from the list. The <link id="TJSONData"/> element is freed.
If a non-existing name is specified, no value is deleted.
</descr>
<errors>
If an invalid index is passed, an exception is raised.
</errors>
<seealso>
<link id="Clear"/>
<link id="Add"/>
<link id="Extract"/>
<link id="Exchange"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Delete.Index">
<short>Index of element in <var>Items</var> to delete.</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Delete.AName">
<short>Name of element to delete</short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONObject.Remove">
<short>Remove item by instance</short>
<descr>
<var>Remove</var> will locate the value <var>Item</var> in the list of
values, and removes it if it exists. The item is freed.
</descr>
<seealso>
<link id="Delete"/>
<link id="Extract"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Remove.Item">
<short>Item to remove.</short>
</element>
<!-- function Visibility: public -->
<element name="TJSONObject.Extract">
<short>Extract an element from the object</short>
<descr>
<var>Extract</var> removes the element at position <var>Index</var> or with the
<var>AName</var> from the list, just as <link id="Delete"/> does. In difference
with <var>Delete</var>, it does not free the object instance. Instead,
it returns the extracted element. The result is <var>Nil</var> if a
non-existing name is specified.
</descr>
<seealso>
<link id="Delete"/>
<link id="Clear"/>
<link id="Insert"/>
<link id="Add"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONObject.Extract.Result">
<short>Element to extract from the object</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Extract.Index">
<short>Index of element to extract</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Extract.AName">
<short>Name of element to extract</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.Names">
<short>Indexed access to the names of elements.</short>
<descr>
<var>Names</var> allows to retrieve the names of the elements in the object.
The index is zero-based, running from 0 to <var>Count-1</var>.
</descr>
<seealso>
<link id="Types"/>
<link id="Elements"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Names.Index">
<short>Index of name to retrieve.</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.Elements">
<short>Name-based access to JSON values in the object.</short>
<descr>
<var>Elements</var> allows to retrieve the JSON values of the elements in the
object by name. If a non-existent name is specified, an <link id="EJSON"/>
exception is raised.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Types"/>
<link id="Integers"/>
<link id="Int64s"/>
<link id="Booleans"/>
<link id="Strings"/>
<link id="Floats"/>
<link id="Arrays"/>
<link id="Objects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Elements.AName">
<short>Name of value to retrieve.</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.Types">
<short>Types of values in the object.</short>
<descr>
<var>Types</var> allows to retrieve the JSON types of the elements in
the object by name. If a non-existent name is specified, an <link id="EJSON"/>
exception is raised.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Elements"/>
<link id="Integers"/>
<link id="Int64s"/>
<link id="Booleans"/>
<link id="Strings"/>
<link id="Floats"/>
<link id="Arrays"/>
<link id="Nulls"/>
<link id="Objects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Types.AName">
<short>Name of value to retrieve.</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.Nulls">
<short>Named access to <var>null</var> values</short>
<descr>
<var>Nulls</var> allows to retrieve or set the NULL values in
the object by name. If a non-existent name is specified, an <link
id="EJSON"/> exception is raised when reading. When writing, any existing
value is replaced by a <var>null</var> value.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Elements"/>
<link id="Integers"/>
<link id="Int64s"/>
<link id="Booleans"/>
<link id="Strings"/>
<link id="Floats"/>
<link id="Arrays"/>
<link id="Types"/>
<link id="Objects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Nulls.AName">
<short>Name of null value to retrieve</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.Floats">
<short>Named access to float values</short>
<descr>
<var>Floats</var> allows to retrieve or set the float values in
the object by name. If a non-existent name is specified, an <link
id="EJSON"/> exception is raised when reading. When writing, any existing
value is replaced by the specified floating-point value.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Elements"/>
<link id="Integers"/>
<link id="Int64s"/>
<link id="Booleans"/>
<link id="Strings"/>
<link id="Nulls"/>
<link id="Arrays"/>
<link id="Types"/>
<link id="Objects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Floats.AName">
<short>Name of float value</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.Integers">
<short>Named access to integer values</short>
<descr>
<var>Integers</var> allows to retrieve or set the integer values in
the object by name. If a non-existent name is specified, an <link
id="EJSON"/> exception is raised when reading. When writing, any existing
value is replaced by the specified integer value.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Elements"/>
<link id="Floats"/>
<link id="Int64s"/>
<link id="Booleans"/>
<link id="Strings"/>
<link id="Nulls"/>
<link id="Arrays"/>
<link id="Types"/>
<link id="Objects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Integers.AName">
<short>Name of integer value</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.Int64s">
<short>Named access to int64 values</short>
<descr>
<var>Int64s</var> allows to retrieve or set the int64 values in
the object by name. If a non-existent name is specified, an <link
id="EJSON"/> exception is raised when reading. When writing, any existing
value is replaced by the specified int64 value.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Elements"/>
<link id="Floats"/>
<link id="Integers"/>
<link id="Booleans"/>
<link id="Strings"/>
<link id="Nulls"/>
<link id="Arrays"/>
<link id="Types"/>
<link id="Objects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Int64s.AName">
<short>Name of int64 value</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.Strings">
<short>Named access to string values</short>
<descr>
<var>Strings</var> allows to retrieve or set the string values in
the object by name. If a non-existent name is specified, an <link
id="EJSON"/> exception is raised when reading. When writing, any existing
value is replaced by the specified string value.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Elements"/>
<link id="Floats"/>
<link id="Integers"/>
<link id="Booleans"/>
<link id="Int64s"/>
<link id="Nulls"/>
<link id="Arrays"/>
<link id="Types"/>
<link id="Objects"/>
<link id="UnicodeStrings"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Strings.AName">
<short>Name of string value</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.Booleans">
<short>Named access to boolean values</short>
<descr>
<var>Booleans</var> allows to retrieve or set the boolean values in
the object by name. If a non-existent name is specified, an <link
id="EJSON"/> exception is raised when reading. When writing, any existing
value is replaced by the specified boolean value.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Elements"/>
<link id="Floats"/>
<link id="Integers"/>
<link id="Strings"/>
<link id="Int64s"/>
<link id="Nulls"/>
<link id="Arrays"/>
<link id="Types"/>
<link id="Objects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Booleans.AName">
<short>Name of boolean value</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.Arrays">
<short>Named access to JSON array values</short>
<descr>
<var>Arrays</var> allows to retrieve or set the JSON array values in
the object by name. If a non-existent name is specified, an <link
id="EJSON"/> exception is raised when reading. When writing, any existing
value is replaced by the specified JSON array.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Elements"/>
<link id="Floats"/>
<link id="Integers"/>
<link id="Strings"/>
<link id="Int64s"/>
<link id="Nulls"/>
<link id="Booleans"/>
<link id="Types"/>
<link id="Objects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Arrays.AName">
<short>Name of JSON array value</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.Objects">
<short>Named access to JSON object values</short>
<descr>
<var>Objects</var> allows to retrieve or set the JSON object values in
the object by name. If a non-existent name is specified, an <link
id="EJSON"/> exception is raised when reading. When writing, any existing
value is replaced by the specified JSON object.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Elements"/>
<link id="Floats"/>
<link id="Integers"/>
<link id="Strings"/>
<link id="Int64s"/>
<link id="Nulls"/>
<link id="Booleans"/>
<link id="Types"/>
<link id="Arrays"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.Objects.AName">
<short>Name of JSON object value</short>
</element>
<!--
********************************************************************
#fcl.fpjson.EJSON
********************************************************************
-->
<!-- class Visibility: default -->
<element name="EJSON">
<short>JSON exception</short>
<descr>
<var>EJSON</var> is the exception raised by the JSON implementation to
report JSON error.
</descr>
</element>
<!-- function Visibility: default -->
<element name="StringToJSONString">
<short>Convert a string to a JSON-escaped string</short>
<descr>
<p>
<var>StringToJSONString</var> examines the string <var>S</var> and replaces
any special characters by an escaped string, as in the JSON specification.
The following characters are escaped:
</p>
<pre>
\ " #8 #9 #10 #12 #13.
</pre>
<p>
<var>Strict</var> indicates that only the absolutely necessary characters will be escaped (when set to <var>True</var>) when convering string values to JSON
If set to <var>False</var> <var>/</var> will also be escaped, although this is strictly speaking not necessary.
</p>
</descr>
<seealso>
<link id="JSONStringToString"/>
<link id="JSONTypeName"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="StringToJSONString.Result">
<short>properly escaped JSON string</short>
</element>
<!-- argument Visibility: default -->
<element name="StringToJSONString.S">
<short>String to convert to JSON string.</short>
</element>
<!-- function Visibility: default -->
<element name="JSONStringToString">
<short>Convert a JSON-escaped string to a string</short>
<descr>
<p>
<var>JSONStringToString</var> examines the string <var>S</var> and replaces
any special characters by an escaped string, as in the JSON specification.
The following escaped characters are recognized:
</p>
<pre>
\\ \" \/ \b \t \n \f \r \u000X
</pre>
</descr>
<seealso>
<link id="StringToJSONString"/>
<link id="JSONTypeName"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="JSONStringToString.Result">
<short>Pascal string with escaped characters replaced</short>
</element>
<!-- argument Visibility: default -->
<element name="JSONStringToString.S">
<short>JSON-escaped string to convert.</short>
</element>
<!-- function Visibility: default -->
<element name="JSONTypeName">
<short>Convert a JSON type to a string</short>
<descr>
<var>JSONTypeName</var> converts the <var>JSONType</var> to a string that
describes the type of JSON value.
</descr>
<seealso>
<link id="StringToJSONString"/>
<link id="JSONStringToString"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="JSONTypeName.Result">
<short>Name of JSON type</short>
</element>
<!-- argument Visibility: default -->
<element name="JSONTypeName.JSONType">
<short>JSON type to convert to a string</short>
</element>
<!-- enumeration type Visibility: default -->
<element name="TJSONInstanceType">
<short>Type of instance to create</short>
<descr>
<var>TJSONInstanceType</var> is used by the parser to determine what kind of
<link id="TJSONData"/> descendent to create for a particular data item. It
is a more fine-grained division than <link id="TJSONType"/>
</descr>
<seealso>
<link id="TJSONData"/>
<link id="TJSONType"/>
</seealso>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONInstanceType.jitUnknown">
<short>Unknown</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONInstanceType.jitNumberInteger">
<short>32-bit signed integer number value</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONInstanceType.jitNumberInt64">
<short>64-bit signed integer number value</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONInstanceType.jitNumberFloat">
<short>Floating point real number value</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONInstanceType.jitString">
<short>String value</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONInstanceType.jitBoolean">
<short>Boolean value</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONInstanceType.jitNull">
<short>Null value</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONInstanceType.jitArray">
<short>Array value</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONInstanceType.jitObject">
<short>Object value</short>
</element>
<!-- record type Visibility: default -->
<element name="TJSONEnum">
<short>JSON enumerator loop variable type</short>
<descr>
<var>TJSONEnum</var> is the loop variable type to use when implementing a JSON enumerator
(<var>for in</var>).
It contains 3 elements which are available in the loop: key, keynum
(numerical key) and the actual value (TJSONData).
</descr>
<seealso>
<link id="TBaseJSONEnumerator"/>
<link id="TJSONData.GetEnumerator"/>
</seealso>
</element>
<!-- variable Visibility: default -->
<element name="TJSONEnum.Key">
<short>String Key value</short>
</element>
<!-- variable Visibility: default -->
<element name="TJSONEnum.KeyNum">
<short>Numerical key value</short>
</element>
<!-- variable Visibility: default -->
<element name="TJSONEnum.Value">
<short>Actual value</short>
</element>
<!--
********************************************************************
#fcl.fpjson.TBaseJSONEnumerator
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TBaseJSONEnumerator">
<short>JSON enumerator</short>
<descr>
<p>
<var>TBaseJSONEnumerator</var> is the base type for the JSON enumerators.
It should not be used directly, instead use the enumerator support of Object
pascal to loop over values in JSON data.
</p>
<p>
The value of the <var>TBaseJSONEnumerator</var> enumerator is a record that
describes the key and value of a JSON value. The key can be string-based
(for records) or numerical (for arrays).
</p>
</descr>
<seealso>
<link id="TJSONEnum"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TBaseJSONEnumerator.GetCurrent">
<short>Return the current value of the enumerator</short>
<descr>
<var>GetCurrent</var> returns the current value of the enumerator. This is a
<link id="TJSONEnum"/> value.
</descr>
<seealso>
<link id="TJSONEnum"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TBaseJSONEnumerator.GetCurrent.Result">
<short>Current <var>TJSONEnum</var> value</short>
</element>
<!-- function Visibility: public -->
<element name="TBaseJSONEnumerator.MoveNext">
<short>Move to next value in array/object</short>
<descr>
<var>MoveNext</var> attempts to move to the next value. This will return
<var>True</var> if the move was successful, or <var>False</var> if not.
When <var>True</var> is returned, then
</descr>
<errors>
</errors>
<seealso>
<link id="TJSONEnum"/>
<link id="TJSONData"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TBaseJSONEnumerator.MoveNext.Result">
<short>True if the move was successful</short>
</element>
<!-- property Visibility: public -->
<element name="TBaseJSONEnumerator.Current">
<short>Return the current value of the enumerator</short>
<descr>
<var>Current</var> returns the current enumerator value of type <link
id="TJSONEnum"/>. It is only valid after <link id="MoveNext"/> returned
<var>True</var>.
</descr>
<seealso>
<link id="TJSONEnum"/>
<link id="TJSONData"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONData.GetEnumerator">
<short>Return an enumerator for the data</short>
<descr>
<var>GetEnumerator</var> returns an enumerator for the JSON data. For simple
types, the enumerator will just contain the current value. For arrays and
objects, the enumerator will loop over the values in the array. The return
value is not a <link id="TJSONData"/> type, but a <link id="TJSONEnum"/>
structure, which contains the value, and for structured types, the key
(numerical or string).
</descr>
<seealso>
<link id="TJSONEnum"/>
<link id="TJSONArray"/>
<link id="TJSONObject"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONData.GetEnumerator.Result">
<short>The new enumerator</short>
</element>
<!-- function Visibility: public -->
<element name="TJSONData.FindPath">
<short>Find data by name</short>
<descr>
<p>
<var>FindPath</var> finds a value based on its path. If none is found, <var>Nil</var> is returned.
The path elements are separated by dots and square brackets, as in object
member notation or array notation. The path is case sensitive.
</p>
<ul>
<li>For simple values, the path must be empty.</li>
<li>For <link id="TJSONObject">objects</link>, a member can be specified using its name,
and the object value itself can be retrieved with the empty path. </li>
<li>For <link id="TJSONObject">Arrays</link>, the elements can be
found based on an array index. The array value itself can be retrieved with
the empty path.</li>
</ul>
<p>
The following code will return the value itself, i.e. <var>E</var> will contain the same
element as D:
</p>
<code>
Var
D,E : TJSONData;
begin
D:=TJSONIntegerNumber.Create(123);
E:=D.FindPath('');
end.
</code>
<p>
The following code will not return anything:
</p>
<code>
Var
D,E : TJSONData;
begin
D:=TJSONIntegerNumber.Create(123);
E:=D.FindPath('a');
end.
</code>
<p>
The following code will return the third element from the array:
</p>
<code>
Var
D,E : TJSONData;
begin
D:=TJSONArray.Create([1,2,3,4,5]);
E:=D.FindPath('[2]');
Writeln(E.AsJSON);
end.
</code>
<p>The output of this program is 3.</p>
<p>The following code returns the element <var>Age</var> from the object:</p>
<code>
Var
D,E : TJSONData;
begin
D:=TJSONObject.Create(['Age',23,
'Lastame','Rodriguez',
'FirstName','Roberto']);
E:=D.FindPath('Age');
Writeln(E.AsJSON);
end.
</code>
<p>The code will print 23.</p>
<p>Obviously, this can be combined:</p>
<code>
Var
D,E : TJSONData;
begin
D:=TJSONObject.Create(['Age',23,
'Names', TJSONObject.Create([
'LastName','Rodriguez',
'FirstName','Roberto'])]);
E:=D.FindPath('Names.LastName');
Writeln(E.AsJSON);
end.
</code>
<p>And mixed:</p>
<code>
var
D,E : TJSONData;
begin
D:=TJSONObject.Create(['Children',
TJSONArray.Create([
TJSONObject.Create(['Age',23,
'Names', TJSONObject.Create([
'LastName','Rodriguez',
'FirstName','Roberto'])
]),
TJSONObject.Create(['Age',20,
'Names', TJSONObject.Create([
'LastName','Rodriguez',
'FirstName','Maria'])
])
])
]);
E:=D.FindPath('Children[1].Names.FirstName');
Writeln(E.AsJSON);
end.
</code>
</descr>
<errors>
</errors>
<seealso>
<link id="TJSONArray"/>
<link id="TJSONObject"/>
<link id="GetPath"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONData.FindPath.Result">
<short>The found data element, or nil</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONData.FindPath.APath">
<short>Path to search for</short>
</element>
<!-- function Visibility: public -->
<element name="TJSONData.GetPath">
<short>Get data by name</short>
<descr>
<var>GetPath</var> is identical to <link id="FindPath"/> but raises an
exception if no element was found. The exception message contains the piece
of path that was not found.
</descr>
<errors>
An <link id="EJSON"/> exception is raised if the path does not exist.
</errors>
<seealso>
<link id="FindPath"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONData.GetPath.Result">
<short>The found data element</short>
</element>
<!-- argument Visibility: public -->
<element name="TJSONData.GetPath.APath">
<short>The path of the data element to retrieve.</short>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONFloatNumberClass">
<short>Class of <var>TJSONFloatNumber</var></short>
<descr>
<var>TJSONFloatNumberClass</var> is the class type of <link id="TJSONFloatNumber"/>.
It is used in the factory methods.
</descr>
<seealso>
<link id="TJSONFloatNumber"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONIntegerNumberClass">
<short>Class of <var>TJSONIntegerNumber</var></short>
<descr>
<var>TJSONIntegerNumberClass</var> is the class type of <link
id="TJSONIntegerNumber"/>. It is used in the factory methods.
</descr>
<seealso>
<link id="TJSONIntegerNumber"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONInt64NumberClass">
<short>Class of <var>TJSONInt64Number</var></short>
<descr>
<var>TJSONInt64NumberClass</var> is the class type of <link
id="TJSONInt64Number"/>. It is used in the factory methods.
</descr>
<seealso>
<link id="TJSONInt64Number"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONStringClass">
<short>Class of <var>TJSONString</var></short>
<descr>
<var>TJSONStringClass</var> is the class type of <link
id="TJSONString"/>. It is used in the factory methods.
</descr>
<seealso>
<link id="TJSONString"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONBooleanClass">
<short>Class of <var>TJSONBoolean</var></short>
<descr>
<var>TJSONBooleanClass</var> is the class type of <link
id="TJSONBoolean"/>. It is used in the factory methods.
</descr>
<seealso>
<link id="TJSONBoolean"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONNullClass">
<short>Class of <var>TJSONNull</var></short>
<descr>
<var>TJSONNullClass</var> is the class type of <link
id="TJSONNull"/>. It is used in the factory methods.
</descr>
<seealso>
<link id="TJSONNull"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONArray.GetEnumerator">
<short>Get an array enumerator</short>
<descr>
<var>GetEnumerator</var> is overridden in <var>TJSONarray</var> so it returns an array
enumerator. The array enumerator will return all the elements in the array,
and stores their index in the <var>KeyNum</var> member of <link id="TJSONEnum"/>.
</descr>
<seealso>
<link id="TJSONEnum"/>
<link id="TJSONData.GetEnumerator"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONArray.GetEnumerator.Result">
<short>The array enumerator</short>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONArray">
<short>Class of <var>TJSONArray</var></short>
<descr>
<var>TJSONArrayClass</var> is the class type of <link
id="TJSONArray"/>. It is used in the factory methods.
</descr>
<seealso>
<link id="TJSONArray"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONObject.GetEnumerator">
<short>Get an object enumerator</short>
<descr>
<var>GetEnumerator</var> is overridden in <var>TJSONObject</var> so it returns an
object enumerator. The array enumerator will return all the elements in the array,
and stores their name in the <var>Key</var> and index in the <var>KeyNum</var>
members of <link id="TJSONEnum"/>.
</descr>
<seealso>
<link id="TJSONEnum"/>
<link id="TJSONData.GetEnumerator"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONObject.GetEnumerator.Result">
<short>The object enumerator</short>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONObject">
<short>Class of <var>TJSONObject</var></short>
<descr>
<var>TJSONObjectClass</var> is the class type of <link
id="TJSONObject"/>. It is used in the factory methods.
</descr>
<seealso>
<link id="TJSONObject"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- procedure type Visibility: default -->
<element name="TJSONParserHandler">
<short>Callback to parse JSON into <var>JSONData</var></short>
<descr>
<p>
<var>TJSONParserHandler</var> is a callback prototype used by the <link id="GetJSON"/>
function to do the actual parsing. It has 2 arguments: <var>AStream</var>,
which is the stream containing the JSON that must be parsed, and
<var>AUseUTF8</var>, which indicates whether the (ansi) strings contain UTF-8.
</p>
<p>
The result should be returned in <var>Data</var>.
</p>
<p>
The parser is expected to use the JSON class types registered using the <link
id="SetJSONInstanceType"/> method, the actual types can be retrieved with
<link id="GetJSONInstanceType"/>
</p>
</descr>
<seealso>
<link id="GetJSON"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TJSONParserHandler.AStream">
<short>Stream to parse.</short>
</element>
<!-- argument Visibility: default -->
<element name="TJSONParserHandler.AUseUTF8">
<short>Use UTF-8 in returned ansistrings</short>
</element>
<!-- argument Visibility: default -->
<element name="TJSONParserHandler.Data">
<short>Resulting JSON data.</short>
</element>
<!-- procedure Visibility: default -->
<element name="SetJSONInstanceType">
<short>JSON factory: Set the JSONData class types to use</short>
<descr>
<p>
<var>SetJSONInstanceType</var> can be used to register descendents of the
<link id="TJSONData"/> class, one for each possible kind of data. The class
type used to instantiate data of type <var>AType</var> is passed in
<var>AClass</var>.
</p>
<p>
The JSON parser will use the registered types to instantiate JSON Data
instanced: when the parser encounters a value of type <var>AType</var>,
it will instantiate a class of type <var>AClass</var>.
By default, the classes in the <var>fpJSON</var> unit are used.
</p>
<p>
The <link id="CreateJSON"/> functions also use the types registered here to
instantiate their data.
</p>
<p>
The return value is the previously registered instance type for the
<var>AType</var>.
</p>
</descr>
<errors>
If <var>AClass</var> is not suitable to contain data of type
<var>AType</var>, an exception is raised.
</errors>
<seealso>
<link id="GetJSONInstanceType"/>
<link id="CreateJSON"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="SetJSONInstanceType.AType">
<short>Type of data to register a class for</short>
</element>
<!-- argument Visibility: default -->
<element name="SetJSONInstanceType.AClass">
<short>Class to use when a data item of type <var>AType</var> is encountered.</short>
</element>
<!-- function Visibility: default -->
<element name="GetJSONInstanceType">
<short>JSON factory: Get the JSONData class types to use</short>
<descr>
<p>
<var>GetJSONInstanceType</var> can be used to retrieve the registered
descendents of the <link id="TJSONData"/> class, one for each possible
kind of data. The result is the class type used to instantiate data of
type <var>AType</var>.
</p>
<p>
The JSON parser and the <link id="CreateJSON"/> function will use the
registered types to instantiate JSON Data. When the parser encounters a value of type <var>AType</var>,
it will instantiate a class of the type returned by this function.
By default, the classes in the <var>fpJSON</var> unit are returned.
</p>
</descr>
<seealso>
<link id="CreateJSON"/>
<link id="TJSONData"/>
<link id="GetJSON"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="GetJSONInstanceType.Result">
<short>The class to instantiate for data of type <var>AType</var></short>
</element>
<!-- argument Visibility: default -->
<element name="GetJSONInstanceType.AType">
<short>Data type for which to return the class.</short>
</element>
<!-- function Visibility: default -->
<element name="CreateJSON">
<short>Create a JSON data item</short>
<descr>
<p>
<var>CreateJSON</var> will create a JSON Data item depending on the type of
data passed to it, and will use the classes returned by <link id="GetJSONInstanceType"/>
to do so. The classes to be used can be set using the <link id="SetJSONInstanceType"/>.
</p>
<p>
The JSON parser uses these functions to create instances of <link id="TJSONData"/>.
</p>
</descr>
<errors>
None.
</errors>
<seealso>
<link id="GetJSONInstanceType"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSON"/>
<link id="CreateJSONArray"/>
<link id="CreateJSONObject"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="CreateJSON.Result">
<short>The <var>TJSONData</var> descendant representing the value in <var>Data</var></short>
</element>
<!-- argument Visibility: default -->
<element name="CreateJSON.Data">
<short>The data to create as a JSON data item.</short>
</element>
<!-- function Visibility: default -->
<element name="CreateJSONArray">
<short>Create a JSON array</short>
<descr>
<var>CreateJSONArray</var> retrieves the class registered to represent JSON
array data, and creates an instance of this class, passing <var>Data</var> to the constructor.
For the <var>Data</var> array the same type conversion rules as for the constructor apply.
</descr>
<errors>
if one of the elements in <var>Data</var> cannot be converted to a JSON structure, an exception will be raised.
</errors>
<seealso>
<link id="GetJSONInstanceType"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSON"/>
<link id="CreateJSON"/>
<link id="TJSONArray"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="CreateJSONArray.Result">
<short>The <var>TJSONArray</var> instance representing <var>Data</var></short>
</element>
<!-- argument Visibility: default -->
<element name="CreateJSONArray.Data">
<short>Data to include in the array.</short>
</element>
<!-- function Visibility: default -->
<element name="CreateJSONObject">
<short>Create a JSON object</short>
<descr>
<var>CreateJSONObject</var> retrieves the class registered to represent JSON
object data, and
creates an instance of this class, passing <var>Data</var> to the constructor.
For the <var>Data</var> array the same type conversion rules as for the
<link id="TJSONObject.Create"/> constructor apply.
</descr>
<errors>
if one of the elements in <var>Data</var> cannot be converted to a JSON
structure, an exception will be raised.
</errors>
<seealso>
<link id="GetJSONInstanceType"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSON"/>
<link id="CreateJSON"/>
<link id="TJSONObject"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="CreateJSONObject.Result">
<short>The <var>TJSONObject</var> instance representing <var>Data</var></short>
</element>
<!-- argument Visibility: default -->
<element name="CreateJSONObject.Data">
<short>Data as (name, value) pairs to create a JSON object from</short>
</element>
<!-- function Visibility: default -->
<element name="GetJSON">
<short>Convert JSON string to JSON data structure</short>
<descr>
<p>
<var>GetJSON</var> will read the <var>JSON</var> argument (a string or
stream that contains a valid JSON data representation) and converts it to
native JSON objects. The stream must be positioned on the start of the JSON.
</p>
<p>
The <var>fpJSON</var> unit does not contain a JSON parser.
The <var>jsonparser</var> unit does contain a JSON parser,
and must be included once in the project to be able to parse JSON. The
<var>jsonparser</var> unit uses the <link id="SetJSONParserHandler"/> call
to set a callback that is used by <var>GetJSON</var> to parse the data.
</p>
<p>
If <var>UseUTF8</var> is set to true, then Unicode characters will be
encoded as UTF-8. Otherwise, they are converted to the nearest matching ansi
character.
</p>
</descr>
<errors>
An exception will be raised if the JSON data stream does not contain valid
JSON data.
</errors>
<seealso>
<link id="GetJSONParserHandler"/>
<link id="SetJSONParserHandler"/>
<link id="TJSONData"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="GetJSON.Result">
<short>The <var>TJSONData</var> data (tree) represented by JSON</short>
</element>
<!-- argument Visibility: default -->
<element name="GetJSON.JSON">
<short>The JSON to parse.</short>
</element>
<!-- argument Visibility: default -->
<element name="GetJSON.UseUTF8">
<short>Convert Unicode characters to UTF-8</short>
</element>
<!-- procedure Visibility: default -->
<element name="SetJSONParserHandler">
<short>Set the JSON parser handler</short>
<descr>
<p>
<var>SetJSONParserHandler</var> can be used to set the JSON parser handler
callback. The <var>fpJSON</var> unit does not contain a JSON parser in
itself: it contains simply the data structure and the ability to write JSON.
The parsing must be done using a separate unit, and is invoked through a
callback. <var>SetJSONParserHandler</var> must be used to set this callback.
</p>
<p>
The <var>jsonparser</var> unit does contain a JSON parser, and must be included
once in the project to be able to parse JSON. The <var>jsonparser</var> unit
uses the <var>SetJSONParserHandler</var> call to set the callback that is used
by <var>GetJSON</var> to parse the data. This is done once at the
initialization of that unit, so it is sufficient to include the unit in the
uses clause of the program.
</p>
<p>
The function returns the previously registered callback.
</p>
</descr>
<seealso>
<link id="GetJSONParserHandler"/>
<link id="TJSONParserHandler"/>
<link id="GetJSON"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="SetJSONParserHandler.AHandler">
<short>The new value for the handler</short>
</element>
<!-- function Visibility: default -->
<element name="GetJSONParserHandler">
<short>Get the current JSON parser handler</short>
<descr>
<p>
<var>GetJSONParserHandler</var> can be used to get the current value of the
JSON parser handler callback.
</p>
<p>
The <var>fpJSON</var> unit does not contain a JSON parser in itself: it contains
simply the data structure and the ability to write JSON. The parsing must be done
using a separate unit.
</p>
</descr>
<seealso>
<link id="GetJSONParserHandler"/>
<link id="TJSONParserHandler"/>
<link id="GetJSON"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="GetJSONParserHandler.Result">
<short>The current parser callback value</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONInstanceType.jitNumberQWord">
<short>Qword integer number type</short>
</element>
<!-- enumeration value Visibility: default -->
<element name="TFormatOption.foSkipWhiteSpace">
<short>Skip whitespace</short>
</element>
<!-- constant Visibility: default -->
<element name="AsCompressedJSON">
<short>Constant to format JSON with minimal whitespace</short>
<descr>
<var>AsCompressedJSON</var> can be used to let <link
id="TJSONData.FormatJSON">FormatJSON</link> behave as <link
id="TJSONData.AsJSON"/> with <link id="TJSONData.CompressedJSON"/> equal to
<var>True</var>
</descr>
<seealso>
<link id="TJSONData.FormatJSON"/>
<link id="TJSONData.AsJSON"/>
<link id="TJSONData.CompressedJSON"/>
</seealso>
</element>
<!-- constant Visibility: default -->
<element name="AsCompactJSON">
<short>Constant to format JSON with minimal whitespace and unquoted property names</short>
<descr>
<var>AsCompressedJSON</var> can be used to let <link
id="TJSONData.FormatJSON">FormatJSON</link> behave as <link id="TJSONData.AsJSON"/>
with <link id="TJSONData.CompressedJSON"/> equal to <var>True</var> and
<link id="TJSONData.UnquotedMemberNames"/> equal to <var>True</var>.
</descr>
<seealso>
<link id="TJSONData.FormatJSON"/>
<link id="TJSONData.AsJSON"/>
<link id="TJSONData.CompressedJSON"/>
<link id="TJSONObject.UnquotedMemberNames"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.CompressedJSON">
<short>Compress JSON - skip whitespace</short>
<descr>
<var>CompressedJSON</var> can be used to let <link id="TJSONData.AsJSON"/>
return JSON which does not contain any whitespace. By default it is
<var>False</var> and whitespace is inserted. If set to <var>True</var>,
output will contain no whitespace.
</descr>
<seealso>
<link id="TJSONData.FormatJSON"/>
<link id="TJSONData.AsJSON"/>
<link id="TJSONData.UnquotedMemberNames"/>
<link id="TJSONData.AsCompressedJSON"/>
<link id="TJSONObject.UnquotedMemberNames"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONData.DumpJSON">
<short>Fast, memory efficient dump of JSON in stream</short>
<descr>
<var>DumpJSON</var> writes the data as a JSON string to the stream <var>S</var>.
No intermediate strings are created, making this a more fast and memory efficient
operation than creating a string with <link id="TJSONData.AsJSON"/> and writing it to
stream.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="TJSONData.FormatJSON"/>
<link id="TJSONData.AsJSON"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONData.DumpJSON.S">
<short>Stream to write JSON to</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.AsQWord">
<short>Access the raw JSON value as an 64-bit unsigned integer</short>
<descr>
<p>
<var>AsQWord</var> allows access to the raw value as a 64-bit unsigned integer value.
When reading, it attempts to convert the native value of the data to a
64-bit unsigned integer value. When writing, it attempts to transform the 64-bit
unsigned integer value to a native value.
If either conversion fails, an <var>EConvertError</var> exception is raised.
</p>
<p>
For <link id="TJSONQwordNumber"/> this will return the native value.
</p>
<p>
For complex values, reading or writing this property will always result in an
<var>EConvertError</var> exception.
</p>
</descr>
<seealso>
<link id="AsFloat"/>
<link id="Value"/>
<link id="AsInteger"/>
<link id="AsInt64"/>
<link id="AsString"/>
<link id="AsBoolean"/>
<link id="IsNull"/>
<link id="AsJSON"/>
</seealso>
</element>
<!-- enumeration value Visibility: default -->
<element name="TJSONNumberType.ntQWord">
<short>64-bit unsigned integer value</short>
</element>
<!--
********************************************************************
#fcl.fpjson.TJSONQWordNumber
********************************************************************
-->
<!-- class Visibility: default -->
<element name="TJSONQWordNumber">
<short>Class to represent 64-bit unsigned integer JSON data.</short>
<descr>
<var>TJSONQWordNumber</var> must be used whenever 64-bit unsigned integer data must
be represented. For 32-bit integer data, <link id="TJSONIntegerNumber"/> must
be used.For 64-bit signed integer data, <link id="TJSONInt64Number"/> must
be used.
</descr>
<seealso>
<link id="TJSONFloatNumber"/>
<link id="TJSONIntegerNumber"/>
<link id="TJSONInt64Number"/>
</seealso>
</element>
<!-- constructor Visibility: public -->
<element name="TJSONQWordNumber.Create">
<short>Create a new instance of 64-bit unsigned integer JSON data</short>
<descr>
<var>Create</var> instantiates a new 64-bit unsigned integer JSON data and
initializes the value with <var>AValue</var>.
</descr>
<seealso>
<link id="TJSONIntegerNumber.Create"/>
<link id="TJSONInt64Number.Create"/>
<link id="TJSONFloatNumber.Create"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONQWordNumber.Create.AValue">
<short>Initial 64-bit unsigned integer value</short>
</element>
<!-- class function Visibility: public -->
<element name="TJSONQWordNumber.NumberType">
<short>Kind of numerical data managed by this class.</short>
<descr>
<var>NumberType</var> is overridden by <var>TJSONQwordNumber</var> to return
<var>ntQWord</var>.
</descr>
<seealso>
<link id="TJSONNumberType"/>
<link id="TJSONData.JSONtype"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONQWordNumber.NumberType.Result">
<short>Always <var>ntInt64</var></short>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONQWordNumber.Clear">
<short>Clear value</short>
<descr>
<var>Clear</var> is overridden by <var>TJSONQwordNumber</var> to set the value to 0.
</descr>
<seealso>
<link id="TJSONData.Clear"/>
</seealso>
</element>
<!-- function Visibility: public -->
<element name="TJSONQWordNumber.Clone">
<short>Clone 64-bit unsigned integer value</short>
<descr>
<var>Clone</var> overrides <link id="TJSONData.Clone"/> and creates an
instance of the same class with the 64-bit unsigned integer value.
</descr>
<seealso>
<link id="TJSONData.Clone"/>
</seealso>
</element>
<!-- function result Visibility: public -->
<element name="TJSONQWordNumber.Clone.Result">
<short>New instance of <var>TJSONQwordNumber</var> with the same QWord value</short>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONQWordNumberClass">
<short>Class of <var>TJSONQWordNumber</var></short>
<descr>
<var>TJSONQwordNumberClass</var> is the class type of <link
id="TJSONQWordNumber"/>. It is used in the factory methods.
</descr>
<seealso>
<link id="TJSONQwordNumber"/>
<link id="SetJSONInstanceType"/>
<link id="GetJSONInstanceType"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.QWords">
<short>Get or set elements as QWord values</short>
<descr>
<p>
<var>QWords</var> gives direct access to the <link id="TJSONData.AsQWord"/>
property when reading. Reading it is the equivalent to accessing
</p>
<code>
Items[Index].AsQWord
</code>
<p>
When writing, it will check if an 64-bit unsigned integer JSON value is located at the given
location, and replace it with the new value. If a non-64-bit unsigned integer JSON value is
there, it is replaced with the written QWord value.
</p>
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="TJSONData.IsNull"/>
<link id="TJSONArray.Types"/>
<link id="TJSONArray.Integers"/>
<link id="TJSONArray.QWords"/>
<link id="TJSONArray.Floats"/>
<link id="TJSONArray.Strings"/>
<link id="TJSONArray.Booleans"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.QWords.Index">
<short>Index of element to read/write</short>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONArrayClass">
<short>Class of TJSONArray</short>
<descr>
<var>TJSONArray</var> is the class type for the <link id="TJSONArray"/> class.
It is used in <link id="CreateJSONArray"/>.
</descr>
<seealso>
<link id="SetJSONInstanceType"/>
<link id="TJSONObjectClass"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.UnquotedMemberNames">
<short>Should member names be written unquoted or quoted in JSON</short>
<descr>
<p>
<var>UnquotedMemberNames</var> can be set to let <var>AsJSON</var> write the
member names of a JSON object without quotes (<var>True</var>) or with quotes
(<var>False</var>) around the member names.
</p>
<p>When the value is <var>False</var>, JSON is written as:</p>
<pre>
{
"name" : "Free Pascal",
"type" : "Compiler"
}
</pre>
<p>When the value is <var>True</var>, JSON is written as:</p>
<pre>
{
name : "Free Pascal",
type : "Compiler"
}
</pre>
<p>
Care must be taken when setting this property: The JSON standard requires
the quotes to be written, but since JSON is mostly consumed in a Javascipt
engine, the unquoted values are usually also accepted.
</p>
</descr>
<seealso>
<link id="TJSONData.CompressedJSON"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.QWords">
<short>Named access to QWord values</short>
<descr>
<var>QWords</var> allows to retrieve or set the QWord values in
the object by name. If a non-existent name is specified, an <link
id="EJSON"/> exception is raised when reading. When writing, any existing
value is replaced by the specified QWord value.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Elements"/>
<link id="Floats"/>
<link id="Integers"/>
<link id="QWords"/>
<link id="Booleans"/>
<link id="Strings"/>
<link id="Nulls"/>
<link id="Arrays"/>
<link id="Types"/>
<link id="Objects"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.QWords.AName">
<short>Name of QWord value</short>
</element>
<!-- "class of" type Visibility: default -->
<element name="TJSONObjectClass">
<short>Class of TJSONObject</short>
<descr>
<var>TJSONObject</var> is the class type for the <link id="TJSONObject"/> class.
It is used in <link id="CreateJSONObject"/>.
</descr>
<seealso>
<link id="SetJSONInstanceType"/>
<link id="TJSONArrayClass"/>
</seealso>
</element>
<!-- function result Visibility: default -->
<element name="SetJSONInstanceType.Result">
<short>Previous JSON instance type</short>
</element>
<!-- function result Visibility: default -->
<element name="SetJSONParserHandler.Result">
<short>Previous JSON Parser handler</short>
</element>
<!-- alias type Visibility: default -->
<element name="TJSONUnicodeStringType">
<short>Alias for Unicode strings</short>
<descr>
<var>TJSONUnicodeStringType</var> is an alias used wherever a Unicode
(double byte) string is used in the fpJSON code, in particular the <link
id="TJSONData.AsUnicodeString"/> property.
</descr>
<seealso>
<link id="TJSONData.AsUnicodeString"/>
</seealso>
</element>
<!-- constant Visibility: default -->
<element name="ValueJSONTypes">
<short>Set constant with JSON types of non-structured values</short>
<descr>
<var>ValueJSONTypes</var> is a set constant designating the JSON types that
have a single value, i.e., all types except array or object.
</descr>
<seealso>
<link id="ActualValueJSONTypes"/>
<link id="StructuredJSONTypes"/>
</seealso>
</element>
<!-- constant Visibility: default -->
<element name="ActualValueJSONTypes">
<short>Set constant with JSON types of non-structured values that are not null</short>
<descr>
<var>ActualValueJSONTypes</var> is a set constant designating the JSON types that
have a non-null single value, i.e., all types except array or object or null.
</descr>
<seealso>
<link id="ValueJSONTypes"/>
<link id="StructuredJSONTypes"/>
</seealso>
</element>
<!-- constant Visibility: default -->
<element name="StructuredJSONTypes">
<short>Set constant with JSON types of structured values</short>
<descr>
<var>StructuredJSONTypes</var> is a set constant designating the JSON types that
contain multiple values: array or object.
</descr>
<seealso>
<link id="ActualValueJSONTypes"/>
<link id="ValueJSONTypes"/>
</seealso>
</element>
<!-- property Visibility: public -->
<element name="TJSONData.AsUnicodeString">
<short>Return the value as a Unicode string</short>
<descr>
<var>AsUnicodeString</var> returns the value of a simple JSON value as a
Unicode string.
</descr>
<seealso>
<link id="TJSONData.AsString"/>
</seealso>
</element>
<!-- procedure Visibility: public -->
<element name="TJSONArray.Sort">
<short>Sort the items in the array</short>
<descr>
<var>Sort</var> can be used to perform a sort in an array. The array does
not compare elements, for this the <var>Compare</var> callback must be used,
to compare 2 elements from the array.
</descr>
<errors>
None.
</errors>
<seealso>
<link id="#rtl.classes.TListSortCompare"/>"
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.Sort.Compare">
<short>Callback to compare 2 elements in the list</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONArray.UnicodeStrings">
<short>Get or set elements as Unicode string values</short>
<descr>
<p>
<var>UNicodeStrings</var> gives direct access to the <link
id="TJSONData.AsUnicodeString"/>
property when reading. Reading it is the equivalent to accessing
</p>
<code>
Items[Index].AsUnicodeString
</code>
<p>
When writing, it will check if a UNicodeStrings JSON value is located at the given
location, and replace it with the new value. If a non-string value is
there, it is replaced with the written Unicode string value.
</p>
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="TJSONData.IsNull"/>
<link id="TJSONArray.Types"/>
<link id="TJSONArray.Integers"/>
<link id="TJSONArray.QWords"/>
<link id="TJSONArray.Floats"/>
<link id="TJSONArray.Int64s"/>
<link id="TJSONArray.Booleans"/>
<link id="TJSONArray.Strings"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONArray.UnicodeStrings.Index">
<short>Index of value to get or set</short>
</element>
<!-- property Visibility: public -->
<element name="TJSONObject.UnicodeStrings">
<short>Named access to Unicode string values</short>
<descr>
<var>Strings</var> allows to retrieve or set the Unicode string values in
the object by name. If a non-existent name is specified, an <link
id="EJSON"/> exception is raised when reading. When writing, any existing
value is replaced by the specified unicodestring value.
</descr>
<seealso>
<link id="TJSONData.Items"/>
<link id="Names"/>
<link id="Elements"/>
<link id="Floats"/>
<link id="Integers"/>
<link id="Booleans"/>
<link id="Int64s"/>
<link id="Nulls"/>
<link id="Arrays"/>
<link id="Types"/>
<link id="Objects"/>
<link id="Strings"/>
</seealso>
</element>
<!-- argument Visibility: public -->
<element name="TJSONObject.UnicodeStrings.AName">
<short>Name of element to get or set value </short>
</element>
<!-- uses unit Visibility: default -->
<element name="SysUtils">
<short>Exceptions and formatting routines</short>
</element>
<!-- uses unit Visibility: default -->
<element name="classes">
<short>Base classes (streams)</short>
</element>
<!-- uses unit Visibility: default -->
<element name="contnrs">
<short>Hash classes</short>
</element>
<!-- alias type Visibility: default -->
<element name="TJSONVariant">
<short>Variant alias type</short>
<descr>
<var>TJSONVariant</var> resolves to <var>Variant</var> on native platforms, <var>JSValue</var> in javascript runtimes.
</descr>
</element>
<!-- alias type Visibility: default -->
<element name="TFPJSStream">
<short>Stream alias type</short>
<descr>
<var>TFPJSStream</var> resolves to a <var>stream</var> on native platforms, <var>TJSArray</var> in javascript runtimes.
</descr>
</element>
<!-- enumeration value Visibility: default -->
<element name="TFormatOption.foSkipWhiteSpaceOnlyLeading">
<short>Only skip leading whitespace when formatting JSON</short>
</element>
<!-- variable Visibility: public -->
<element name="TJSONString.StrictEscaping">
<short>Use strict escaping</short>
<descr>
<var>StrictEscaping</var> indicates that only the absolutely necessary characters will be escaped (when set to <var>True</var>) when convering string values to JSON
If set to <var>False</var> <var>/</var> will also be escaped, although this is strictly speaking not necessary.
</descr>
<seealso>
<link id="StringToJSONString"/>
</seealso>
</element>
<!-- argument Visibility: default -->
<element name="TJSONObject.Find.key">
<short>Find key name</short>
</element>
<!-- argument Visibility: default -->
<element name="TJSONObject.Find.AValue">
<short>Value</short>
</element>
<!-- argument Visibility: default -->
<element name="StringToJSONString.Strict">
<short>If set to <var>true</var> the slash will also be escped.</short>
</element>
</module> <!-- fpjson -->
</package>
</fpdoc-descriptions>
|