diff --git a/README.md b/README.md index 68ef9b35..b23f2318 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,12 @@ Install required libraries and test dependencies: sudo apt install pkg-config libssl-dev zlib1g-dev libgtest-dev libgmock-dev ``` +Install [dconv](https://github.com/joinframework/dconv) from its release package: +```bash +wget https://github.com/joinframework/dconv/releases/download/v1.1.0/libdconv-dev_1.1.0_all.deb +sudo apt install ./libdconv-dev_1.1.0_all.deb +``` + > **Compilers:** GCC 11+ or Clang 16+ (C++20). Clang requires `libclang-rt-dev` for coverage instrumentation (`--coverage`). > **OpenSSL** provides the core TLS runtime. > **Platform:** Linux 5.11+ and glibc 2.35+ (`epoll_pwait2`). The io_uring backend requires Linux 6.0+ (multishot `recv`). diff --git a/cmake/joinConfig.cmake.in b/cmake/joinConfig.cmake.in index d37e70e2..c65561ac 100644 --- a/cmake/joinConfig.cmake.in +++ b/cmake/joinConfig.cmake.in @@ -23,6 +23,7 @@ foreach(comp ${join_FIND_COMPONENTS}) endforeach() if(@JOIN_ENABLE_DATA@ OR @JOIN_ENABLE_SERVICES@) + find_dependency(dconv 1.1.0) find_dependency(ZLIB) endif() diff --git a/cmake/packaging.cmake b/cmake/packaging.cmake index 0bc7df11..24b2d716 100644 --- a/cmake/packaging.cmake +++ b/cmake/packaging.cmake @@ -32,7 +32,7 @@ if(JOIN_ENABLE_CRYPTO) string(APPEND JOIN_DEV_DEPENDS ", libssl-dev") endif() if(JOIN_ENABLE_DATA) - string(APPEND JOIN_DEV_DEPENDS ", zlib1g-dev") + string(APPEND JOIN_DEV_DEPENDS ", libdconv-dev (>= 1.1.0), zlib1g-dev") endif() if(JOIN_ENABLE_IO_URING) string(APPEND JOIN_DEV_DEPENDS ", liburing-dev") diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index a99a0942..d42d3b11 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,15 +1,11 @@ cmake_minimum_required(VERSION 3.22.1) +find_package(dconv 1.1.0 REQUIRED) find_package(ZLIB REQUIRED) set(PUBLIC_HEADERS - include/join/diyfp.hpp - include/join/atodpow.hpp - include/join/dtoapow.hpp - include/join/dtoa.hpp include/join/utf8.hpp include/join/utf16.hpp - include/join/probe.hpp include/join/value.hpp include/join/value_builder.hpp include/join/sax_error.hpp @@ -47,6 +43,7 @@ target_include_directories(${JOIN_DATA} target_link_libraries(${JOIN_DATA} PUBLIC ${JOIN_CORE} + dconv::dconv ZLIB::ZLIB ) diff --git a/data/include/join/atodpow.hpp b/data/include/join/atodpow.hpp deleted file mode 100644 index 470689c2..00000000 --- a/data/include/join/atodpow.hpp +++ /dev/null @@ -1,362 +0,0 @@ -/** - * MIT License - * - * Copyright (c) 2025 Mathieu Rabine - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef JOIN_DATA_ATODPOW_HPP -#define JOIN_DATA_ATODPOW_HPP - -#include - -namespace join -{ - namespace details - { - struct Power - { - uint64_t hi; - uint64_t lo; - }; - - constexpr Power atodpow[] = { - {0xa5ced43b7e3e9188, 0x419ea3bd35385e2d}, {0xcf42894a5dce35ea, 0x52064cac828675b9}, - {0x818995ce7aa0e1b2, 0x7343efebd1940993}, {0xa1ebfb4219491a1f, 0x1014ebe6c5f90bf8}, - {0xca66fa129f9b60a6, 0xd41a26e077774ef6}, {0xfd00b897478238d0, 0x8920b098955522b4}, - {0x9e20735e8cb16382, 0x55b46e5f5d5535b0}, {0xc5a890362fddbc62, 0xeb2189f734aa831d}, - {0xf712b443bbd52b7b, 0xa5e9ec7501d523e4}, {0x9a6bb0aa55653b2d, 0x47b233c92125366e}, - {0xc1069cd4eabe89f8, 0x999ec0bb696e840a}, {0xf148440a256e2c76, 0xc00670ea43ca250d}, - {0x96cd2a865764dbca, 0x380406926a5e5728}, {0xbc807527ed3e12bc, 0xc605083704f5ecf2}, - {0xeba09271e88d976b, 0xf7864a44c633682e}, {0x93445b8731587ea3, 0x7ab3ee6afbe0211d}, - {0xb8157268fdae9e4c, 0x5960ea05bad82964}, {0xe61acf033d1a45df, 0x6fb92487298e33bd}, - {0x8fd0c16206306bab, 0xa5d3b6d479f8e056}, {0xb3c4f1ba87bc8696, 0x8f48a4899877186c}, - {0xe0b62e2929aba83c, 0x331acdabfe94de87}, {0x8c71dcd9ba0b4925, 0x9ff0c08b7f1d0b14}, - {0xaf8e5410288e1b6f, 0x07ecf0ae5ee44dd9}, {0xdb71e91432b1a24a, 0xc9e82cd9f69d6150}, - {0x892731ac9faf056e, 0xbe311c083a225cd2}, {0xab70fe17c79ac6ca, 0x6dbd630a48aaf406}, - {0xd64d3d9db981787d, 0x092cbbccdad5b108}, {0x85f0468293f0eb4e, 0x25bbf56008c58ea5}, - {0xa76c582338ed2621, 0xaf2af2b80af6f24e}, {0xd1476e2c07286faa, 0x1af5af660db4aee1}, - {0x82cca4db847945ca, 0x50d98d9fc890ed4d}, {0xa37fce126597973c, 0xe50ff107bab528a0}, - {0xcc5fc196fefd7d0c, 0x1e53ed49a96272c8}, {0xff77b1fcbebcdc4f, 0x25e8e89c13bb0f7a}, - {0x9faacf3df73609b1, 0x77b191618c54e9ac}, {0xc795830d75038c1d, 0xd59df5b9ef6a2417}, - {0xf97ae3d0d2446f25, 0x4b0573286b44ad1d}, {0x9becce62836ac577, 0x4ee367f9430aec32}, - {0xc2e801fb244576d5, 0x229c41f793cda73f}, {0xf3a20279ed56d48a, 0x6b43527578c1110f}, - {0x9845418c345644d6, 0x830a13896b78aaa9}, {0xbe5691ef416bd60c, 0x23cc986bc656d553}, - {0xedec366b11c6cb8f, 0x2cbfbe86b7ec8aa8}, {0x94b3a202eb1c3f39, 0x7bf7d71432f3d6a9}, - {0xb9e08a83a5e34f07, 0xdaf5ccd93fb0cc53}, {0xe858ad248f5c22c9, 0xd1b3400f8f9cff68}, - {0x91376c36d99995be, 0x23100809b9c21fa1}, {0xb58547448ffffb2d, 0xabd40a0c2832a78a}, - {0xe2e69915b3fff9f9, 0x16c90c8f323f516c}, {0x8dd01fad907ffc3b, 0xae3da7d97f6792e3}, - {0xb1442798f49ffb4a, 0x99cd11cfdf41779c}, {0xdd95317f31c7fa1d, 0x40405643d711d583}, - {0x8a7d3eef7f1cfc52, 0x482835ea666b2572}, {0xad1c8eab5ee43b66, 0xda3243650005eecf}, - {0xd863b256369d4a40, 0x90bed43e40076a82}, {0x873e4f75e2224e68, 0x5a7744a6e804a291}, - {0xa90de3535aaae202, 0x711515d0a205cb36}, {0xd3515c2831559a83, 0x0d5a5b44ca873e03}, - {0x8412d9991ed58091, 0xe858790afe9486c2}, {0xa5178fff668ae0b6, 0x626e974dbe39a872}, - {0xce5d73ff402d98e3, 0xfb0a3d212dc8128f}, {0x80fa687f881c7f8e, 0x7ce66634bc9d0b99}, - {0xa139029f6a239f72, 0x1c1fffc1ebc44e80}, {0xc987434744ac874e, 0xa327ffb266b56220}, - {0xfbe9141915d7a922, 0x4bf1ff9f0062baa8}, {0x9d71ac8fada6c9b5, 0x6f773fc3603db4a9}, - {0xc4ce17b399107c22, 0xcb550fb4384d21d3}, {0xf6019da07f549b2b, 0x7e2a53a146606a48}, - {0x99c102844f94e0fb, 0x2eda7444cbfc426d}, {0xc0314325637a1939, 0xfa911155fefb5308}, - {0xf03d93eebc589f88, 0x793555ab7eba27ca}, {0x96267c7535b763b5, 0x4bc1558b2f3458de}, - {0xbbb01b9283253ca2, 0x9eb1aaedfb016f16}, {0xea9c227723ee8bcb, 0x465e15a979c1cadc}, - {0x92a1958a7675175f, 0x0bfacd89ec191ec9}, {0xb749faed14125d36, 0xcef980ec671f667b}, - {0xe51c79a85916f484, 0x82b7e12780e7401a}, {0x8f31cc0937ae58d2, 0xd1b2ecb8b0908810}, - {0xb2fe3f0b8599ef07, 0x861fa7e6dcb4aa15}, {0xdfbdcece67006ac9, 0x67a791e093e1d49a}, - {0x8bd6a141006042bd, 0xe0c8bb2c5c6d24e0}, {0xaecc49914078536d, 0x58fae9f773886e18}, - {0xda7f5bf590966848, 0xaf39a475506a899e}, {0x888f99797a5e012d, 0x6d8406c952429603}, - {0xaab37fd7d8f58178, 0xc8e5087ba6d33b83}, {0xd5605fcdcf32e1d6, 0xfb1e4a9a90880a64}, - {0x855c3be0a17fcd26, 0x5cf2eea09a55067f}, {0xa6b34ad8c9dfc06f, 0xf42faa48c0ea481e}, - {0xd0601d8efc57b08b, 0xf13b94daf124da26}, {0x823c12795db6ce57, 0x76c53d08d6b70858}, - {0xa2cb1717b52481ed, 0x54768c4b0c64ca6e}, {0xcb7ddcdda26da268, 0xa9942f5dcf7dfd09}, - {0xfe5d54150b090b02, 0xd3f93b35435d7c4c}, {0x9efa548d26e5a6e1, 0xc47bc5014a1a6daf}, - {0xc6b8e9b0709f109a, 0x359ab6419ca1091b}, {0xf867241c8cc6d4c0, 0xc30163d203c94b62}, - {0x9b407691d7fc44f8, 0x79e0de63425dcf1d}, {0xc21094364dfb5636, 0x985915fc12f542e4}, - {0xf294b943e17a2bc4, 0x3e6f5b7b17b2939d}, {0x979cf3ca6cec5b5a, 0xa705992ceecf9c42}, - {0xbd8430bd08277231, 0x50c6ff782a838353}, {0xece53cec4a314ebd, 0xa4f8bf5635246428}, - {0x940f4613ae5ed136, 0x871b7795e136be99}, {0xb913179899f68584, 0x28e2557b59846e3f}, - {0xe757dd7ec07426e5, 0x331aeada2fe589cf}, {0x9096ea6f3848984f, 0x3ff0d2c85def7621}, - {0xb4bca50b065abe63, 0x0fed077a756b53a9}, {0xe1ebce4dc7f16dfb, 0xd3e8495912c62894}, - {0x8d3360f09cf6e4bd, 0x64712dd7abbbd95c}, {0xb080392cc4349dec, 0xbd8d794d96aacfb3}, - {0xdca04777f541c567, 0xecf0d7a0fc5583a0}, {0x89e42caaf9491b60, 0xf41686c49db57244}, - {0xac5d37d5b79b6239, 0x311c2875c522ced5}, {0xd77485cb25823ac7, 0x7d633293366b828b}, - {0x86a8d39ef77164bc, 0xae5dff9c02033197}, {0xa8530886b54dbdeb, 0xd9f57f830283fdfc}, - {0xd267caa862a12d66, 0xd072df63c324fd7b}, {0x8380dea93da4bc60, 0x4247cb9e59f71e6d}, - {0xa46116538d0deb78, 0x52d9be85f074e608}, {0xcd795be870516656, 0x67902e276c921f8b}, - {0x806bd9714632dff6, 0x00ba1cd8a3db53b6}, {0xa086cfcd97bf97f3, 0x80e8a40eccd228a4}, - {0xc8a883c0fdaf7df0, 0x6122cd128006b2cd}, {0xfad2a4b13d1b5d6c, 0x796b805720085f81}, - {0x9cc3a6eec6311a63, 0xcbe3303674053bb0}, {0xc3f490aa77bd60fc, 0xbedbfc4411068a9c}, - {0xf4f1b4d515acb93b, 0xee92fb5515482d44}, {0x991711052d8bf3c5, 0x751bdd152d4d1c4a}, - {0xbf5cd54678eef0b6, 0xd262d45a78a0635d}, {0xef340a98172aace4, 0x86fb897116c87c34}, - {0x9580869f0e7aac0e, 0xd45d35e6ae3d4da0}, {0xbae0a846d2195712, 0x8974836059cca109}, - {0xe998d258869facd7, 0x2bd1a438703fc94b}, {0x91ff83775423cc06, 0x7b6306a34627ddcf}, - {0xb67f6455292cbf08, 0x1a3bc84c17b1d542}, {0xe41f3d6a7377eeca, 0x20caba5f1d9e4a93}, - {0x8e938662882af53e, 0x547eb47b7282ee9c}, {0xb23867fb2a35b28d, 0xe99e619a4f23aa43}, - {0xdec681f9f4c31f31, 0x6405fa00e2ec94d4}, {0x8b3c113c38f9f37e, 0xde83bc408dd3dd04}, - {0xae0b158b4738705e, 0x9624ab50b148d445}, {0xd98ddaee19068c76, 0x3badd624dd9b0957}, - {0x87f8a8d4cfa417c9, 0xe54ca5d70a80e5d6}, {0xa9f6d30a038d1dbc, 0x5e9fcf4ccd211f4c}, - {0xd47487cc8470652b, 0x7647c3200069671f}, {0x84c8d4dfd2c63f3b, 0x29ecd9f40041e073}, - {0xa5fb0a17c777cf09, 0xf468107100525890}, {0xcf79cc9db955c2cc, 0x7182148d4066eeb4}, - {0x81ac1fe293d599bf, 0xc6f14cd848405530}, {0xa21727db38cb002f, 0xb8ada00e5a506a7c}, - {0xca9cf1d206fdc03b, 0xa6d90811f0e4851c}, {0xfd442e4688bd304a, 0x908f4a166d1da663}, - {0x9e4a9cec15763e2e, 0x9a598e4e043287fe}, {0xc5dd44271ad3cdba, 0x40eff1e1853f29fd}, - {0xf7549530e188c128, 0xd12bee59e68ef47c}, {0x9a94dd3e8cf578b9, 0x82bb74f8301958ce}, - {0xc13a148e3032d6e7, 0xe36a52363c1faf01}, {0xf18899b1bc3f8ca1, 0xdc44e6c3cb279ac1}, - {0x96f5600f15a7b7e5, 0x29ab103a5ef8c0b9}, {0xbcb2b812db11a5de, 0x7415d448f6b6f0e7}, - {0xebdf661791d60f56, 0x111b495b3464ad21}, {0x936b9fcebb25c995, 0xcab10dd900beec34}, - {0xb84687c269ef3bfb, 0x3d5d514f40eea742}, {0xe65829b3046b0afa, 0x0cb4a5a3112a5112}, - {0x8ff71a0fe2c2e6dc, 0x47f0e785eaba72ab}, {0xb3f4e093db73a093, 0x59ed216765690f56}, - {0xe0f218b8d25088b8, 0x306869c13ec3532c}, {0x8c974f7383725573, 0x1e414218c73a13fb}, - {0xafbd2350644eeacf, 0xe5d1929ef90898fa}, {0xdbac6c247d62a583, 0xdf45f746b74abf39}, - {0x894bc396ce5da772, 0x6b8bba8c328eb783}, {0xab9eb47c81f5114f, 0x066ea92f3f326564}, - {0xd686619ba27255a2, 0xc80a537b0efefebd}, {0x8613fd0145877585, 0xbd06742ce95f5f36}, - {0xa798fc4196e952e7, 0x2c48113823b73704}, {0xd17f3b51fca3a7a0, 0xf75a15862ca504c5}, - {0x82ef85133de648c4, 0x9a984d73dbe722fb}, {0xa3ab66580d5fdaf5, 0xc13e60d0d2e0ebba}, - {0xcc963fee10b7d1b3, 0x318df905079926a8}, {0xffbbcfe994e5c61f, 0xfdf17746497f7052}, - {0x9fd561f1fd0f9bd3, 0xfeb6ea8bedefa633}, {0xc7caba6e7c5382c8, 0xfe64a52ee96b8fc0}, - {0xf9bd690a1b68637b, 0x3dfdce7aa3c673b0}, {0x9c1661a651213e2d, 0x06bea10ca65c084e}, - {0xc31bfa0fe5698db8, 0x486e494fcff30a62}, {0xf3e2f893dec3f126, 0x5a89dba3c3efccfa}, - {0x986ddb5c6b3a76b7, 0xf89629465a75e01c}, {0xbe89523386091465, 0xf6bbb397f1135823}, - {0xee2ba6c0678b597f, 0x746aa07ded582e2c}, {0x94db483840b717ef, 0xa8c2a44eb4571cdc}, - {0xba121a4650e4ddeb, 0x92f34d62616ce413}, {0xe896a0d7e51e1566, 0x77b020baf9c81d17}, - {0x915e2486ef32cd60, 0x0ace1474dc1d122e}, {0xb5b5ada8aaff80b8, 0x0d819992132456ba}, - {0xe3231912d5bf60e6, 0x10e1fff697ed6c69}, {0x8df5efabc5979c8f, 0xca8d3ffa1ef463c1}, - {0xb1736b96b6fd83b3, 0xbd308ff8a6b17cb2}, {0xddd0467c64bce4a0, 0xac7cb3f6d05ddbde}, - {0x8aa22c0dbef60ee4, 0x6bcdf07a423aa96b}, {0xad4ab7112eb3929d, 0x86c16c98d2c953c6}, - {0xd89d64d57a607744, 0xe871c7bf077ba8b7}, {0x87625f056c7c4a8b, 0x11471cd764ad4972}, - {0xa93af6c6c79b5d2d, 0xd598e40d3dd89bcf}, {0xd389b47879823479, 0x4aff1d108d4ec2c3}, - {0x843610cb4bf160cb, 0xcedf722a585139ba}, {0xa54394fe1eedb8fe, 0xc2974eb4ee658828}, - {0xce947a3da6a9273e, 0x733d226229feea32}, {0x811ccc668829b887, 0x0806357d5a3f525f}, - {0xa163ff802a3426a8, 0xca07c2dcb0cf26f7}, {0xc9bcff6034c13052, 0xfc89b393dd02f0b5}, - {0xfc2c3f3841f17c67, 0xbbac2078d443ace2}, {0x9d9ba7832936edc0, 0xd54b944b84aa4c0d}, - {0xc5029163f384a931, 0x0a9e795e65d4df11}, {0xf64335bcf065d37d, 0x4d4617b5ff4a16d5}, - {0x99ea0196163fa42e, 0x504bced1bf8e4e45}, {0xc06481fb9bcf8d39, 0xe45ec2862f71e1d6}, - {0xf07da27a82c37088, 0x5d767327bb4e5a4c}, {0x964e858c91ba2655, 0x3a6a07f8d510f86f}, - {0xbbe226efb628afea, 0x890489f70a55368b}, {0xeadab0aba3b2dbe5, 0x2b45ac74ccea842e}, - {0x92c8ae6b464fc96f, 0x3b0b8bc90012929d}, {0xb77ada0617e3bbcb, 0x09ce6ebb40173744}, - {0xe55990879ddcaabd, 0xcc420a6a101d0515}, {0x8f57fa54c2a9eab6, 0x9fa946824a12232d}, - {0xb32df8e9f3546564, 0x47939822dc96abf9}, {0xdff9772470297ebd, 0x59787e2b93bc56f7}, - {0x8bfbea76c619ef36, 0x57eb4edb3c55b65a}, {0xaefae51477a06b03, 0xede622920b6b23f1}, - {0xdab99e59958885c4, 0xe95fab368e45eced}, {0x88b402f7fd75539b, 0x11dbcb0218ebb414}, - {0xaae103b5fcd2a881, 0xd652bdc29f26a119}, {0xd59944a37c0752a2, 0x4be76d3346f0495f}, - {0x857fcae62d8493a5, 0x6f70a4400c562ddb}, {0xa6dfbd9fb8e5b88e, 0xcb4ccd500f6bb952}, - {0xd097ad07a71f26b2, 0x7e2000a41346a7a7}, {0x825ecc24c873782f, 0x8ed400668c0c28c8}, - {0xa2f67f2dfa90563b, 0x728900802f0f32fa}, {0xcbb41ef979346bca, 0x4f2b40a03ad2ffb9}, - {0xfea126b7d78186bc, 0xe2f610c84987bfa8}, {0x9f24b832e6b0f436, 0x0dd9ca7d2df4d7c9}, - {0xc6ede63fa05d3143, 0x91503d1c79720dbb}, {0xf8a95fcf88747d94, 0x75a44c6397ce912a}, - {0x9b69dbe1b548ce7c, 0xc986afbe3ee11aba}, {0xc24452da229b021b, 0xfbe85badce996168}, - {0xf2d56790ab41c2a2, 0xfae27299423fb9c3}, {0x97c560ba6b0919a5, 0xdccd879fc967d41a}, - {0xbdb6b8e905cb600f, 0x5400e987bbc1c920}, {0xed246723473e3813, 0x290123e9aab23b68}, - {0x9436c0760c86e30b, 0xf9a0b6720aaf6521}, {0xb94470938fa89bce, 0xf808e40e8d5b3e69}, - {0xe7958cb87392c2c2, 0xb60b1d1230b20e04}, {0x90bd77f3483bb9b9, 0xb1c6f22b5e6f48c2}, - {0xb4ecd5f01a4aa828, 0x1e38aeb6360b1af3}, {0xe2280b6c20dd5232, 0x25c6da63c38de1b0}, - {0x8d590723948a535f, 0x579c487e5a38ad0e}, {0xb0af48ec79ace837, 0x2d835a9df0c6d851}, - {0xdcdb1b2798182244, 0xf8e431456cf88e65}, {0x8a08f0f8bf0f156b, 0x1b8e9ecb641b58ff}, - {0xac8b2d36eed2dac5, 0xe272467e3d222f3f}, {0xd7adf884aa879177, 0x5b0ed81dcc6abb0f}, - {0x86ccbb52ea94baea, 0x98e947129fc2b4e9}, {0xa87fea27a539e9a5, 0x3f2398d747b36224}, - {0xd29fe4b18e88640e, 0x8eec7f0d19a03aad}, {0x83a3eeeef9153e89, 0x1953cf68300424ac}, - {0xa48ceaaab75a8e2b, 0x5fa8c3423c052dd7}, {0xcdb02555653131b6, 0x3792f412cb06794d}, - {0x808e17555f3ebf11, 0xe2bbd88bbee40bd0}, {0xa0b19d2ab70e6ed6, 0x5b6aceaeae9d0ec4}, - {0xc8de047564d20a8b, 0xf245825a5a445275}, {0xfb158592be068d2e, 0xeed6e2f0f0d56712}, - {0x9ced737bb6c4183d, 0x55464dd69685606b}, {0xc428d05aa4751e4c, 0xaa97e14c3c26b886}, - {0xf53304714d9265df, 0xd53dd99f4b3066a8}, {0x993fe2c6d07b7fab, 0xe546a8038efe4029}, - {0xbf8fdb78849a5f96, 0xde98520472bdd033}, {0xef73d256a5c0f77c, 0x963e66858f6d4440}, - {0x95a8637627989aad, 0xdde7001379a44aa8}, {0xbb127c53b17ec159, 0x5560c018580d5d52}, - {0xe9d71b689dde71af, 0xaab8f01e6e10b4a6}, {0x9226712162ab070d, 0xcab3961304ca70e8}, - {0xb6b00d69bb55c8d1, 0x3d607b97c5fd0d22}, {0xe45c10c42a2b3b05, 0x8cb89a7db77c506a}, - {0x8eb98a7a9a5b04e3, 0x77f3608e92adb242}, {0xb267ed1940f1c61c, 0x55f038b237591ed3}, - {0xdf01e85f912e37a3, 0x6b6c46dec52f6688}, {0x8b61313bbabce2c6, 0x2323ac4b3b3da015}, - {0xae397d8aa96c1b77, 0xabec975e0a0d081a}, {0xd9c7dced53c72255, 0x96e7bd358c904a21}, - {0x881cea14545c7575, 0x7e50d64177da2e54}, {0xaa242499697392d2, 0xdde50bd1d5d0b9e9}, - {0xd4ad2dbfc3d07787, 0x955e4ec64b44e864}, {0x84ec3c97da624ab4, 0xbd5af13bef0b113e}, - {0xa6274bbdd0fadd61, 0xecb1ad8aeacdd58e}, {0xcfb11ead453994ba, 0x67de18eda5814af2}, - {0x81ceb32c4b43fcf4, 0x80eacf948770ced7}, {0xa2425ff75e14fc31, 0xa1258379a94d028d}, - {0xcad2f7f5359a3b3e, 0x096ee45813a04330}, {0xfd87b5f28300ca0d, 0x8bca9d6e188853fc}, - {0x9e74d1b791e07e48, 0x775ea264cf55347d}, {0xc612062576589dda, 0x95364afe032a819d}, - {0xf79687aed3eec551, 0x3a83ddbd83f52204}, {0x9abe14cd44753b52, 0xc4926a9672793542}, - {0xc16d9a0095928a27, 0x75b7053c0f178293}, {0xf1c90080baf72cb1, 0x5324c68b12dd6338}, - {0x971da05074da7bee, 0xd3f6fc16ebca5e03}, {0xbce5086492111aea, 0x88f4bb1ca6bcf584}, - {0xec1e4a7db69561a5, 0x2b31e9e3d06c32e5}, {0x9392ee8e921d5d07, 0x3aff322e62439fcf}, - {0xb877aa3236a4b449, 0x09befeb9fad487c2}, {0xe69594bec44de15b, 0x4c2ebe687989a9b3}, - {0x901d7cf73ab0acd9, 0x0f9d37014bf60a10}, {0xb424dc35095cd80f, 0x538484c19ef38c94}, - {0xe12e13424bb40e13, 0x2865a5f206b06fb9}, {0x8cbccc096f5088cb, 0xf93f87b7442e45d3}, - {0xafebff0bcb24aafe, 0xf78f69a51539d748}, {0xdbe6fecebdedd5be, 0xb573440e5a884d1b}, - {0x89705f4136b4a597, 0x31680a88f8953030}, {0xabcc77118461cefc, 0xfdc20d2b36ba7c3d}, - {0xd6bf94d5e57a42bc, 0x3d32907604691b4c}, {0x8637bd05af6c69b5, 0xa63f9a49c2c1b10f}, - {0xa7c5ac471b478423, 0x0fcf80dc33721d53}, {0xd1b71758e219652b, 0xd3c36113404ea4a8}, - {0x83126e978d4fdf3b, 0x645a1cac083126e9}, {0xa3d70a3d70a3d70a, 0x3d70a3d70a3d70a3}, - {0xcccccccccccccccc, 0xcccccccccccccccc}, {0x8000000000000000, 0x0000000000000000}, - {0xa000000000000000, 0x0000000000000000}, {0xc800000000000000, 0x0000000000000000}, - {0xfa00000000000000, 0x0000000000000000}, {0x9c40000000000000, 0x0000000000000000}, - {0xc350000000000000, 0x0000000000000000}, {0xf424000000000000, 0x0000000000000000}, - {0x9896800000000000, 0x0000000000000000}, {0xbebc200000000000, 0x0000000000000000}, - {0xee6b280000000000, 0x0000000000000000}, {0x9502f90000000000, 0x0000000000000000}, - {0xba43b74000000000, 0x0000000000000000}, {0xe8d4a51000000000, 0x0000000000000000}, - {0x9184e72a00000000, 0x0000000000000000}, {0xb5e620f480000000, 0x0000000000000000}, - {0xe35fa931a0000000, 0x0000000000000000}, {0x8e1bc9bf04000000, 0x0000000000000000}, - {0xb1a2bc2ec5000000, 0x0000000000000000}, {0xde0b6b3a76400000, 0x0000000000000000}, - {0x8ac7230489e80000, 0x0000000000000000}, {0xad78ebc5ac620000, 0x0000000000000000}, - {0xd8d726b7177a8000, 0x0000000000000000}, {0x878678326eac9000, 0x0000000000000000}, - {0xa968163f0a57b400, 0x0000000000000000}, {0xd3c21bcecceda100, 0x0000000000000000}, - {0x84595161401484a0, 0x0000000000000000}, {0xa56fa5b99019a5c8, 0x0000000000000000}, - {0xcecb8f27f4200f3a, 0x0000000000000000}, {0x813f3978f8940984, 0x4000000000000000}, - {0xa18f07d736b90be5, 0x5000000000000000}, {0xc9f2c9cd04674ede, 0xa400000000000000}, - {0xfc6f7c4045812296, 0x4d00000000000000}, {0x9dc5ada82b70b59d, 0xf020000000000000}, - {0xc5371912364ce305, 0x6c28000000000000}, {0xf684df56c3e01bc6, 0xc732000000000000}, - {0x9a130b963a6c115c, 0x3c7f400000000000}, {0xc097ce7bc90715b3, 0x4b9f100000000000}, - {0xf0bdc21abb48db20, 0x1e86d40000000000}, {0x96769950b50d88f4, 0x1314448000000000}, - {0xbc143fa4e250eb31, 0x17d955a000000000}, {0xeb194f8e1ae525fd, 0x5dcfab0800000000}, - {0x92efd1b8d0cf37be, 0x5aa1cae500000000}, {0xb7abc627050305ad, 0xf14a3d9e40000000}, - {0xe596b7b0c643c719, 0x6d9ccd05d0000000}, {0x8f7e32ce7bea5c6f, 0xe4820023a2000000}, - {0xb35dbf821ae4f38b, 0xdda2802c8a800000}, {0xe0352f62a19e306e, 0xd50b2037ad200000}, - {0x8c213d9da502de45, 0x4526f422cc340000}, {0xaf298d050e4395d6, 0x9670b12b7f410000}, - {0xdaf3f04651d47b4c, 0x3c0cdd765f114000}, {0x88d8762bf324cd0f, 0xa5880a69fb6ac800}, - {0xab0e93b6efee0053, 0x8eea0d047a457a00}, {0xd5d238a4abe98068, 0x72a4904598d6d880}, - {0x85a36366eb71f041, 0x47a6da2b7f864750}, {0xa70c3c40a64e6c51, 0x999090b65f67d924}, - {0xd0cf4b50cfe20765, 0xfff4b4e3f741cf6d}, {0x82818f1281ed449f, 0xbff8f10e7a8921a4}, - {0xa321f2d7226895c7, 0xaff72d52192b6a0d}, {0xcbea6f8ceb02bb39, 0x9bf4f8a69f764490}, - {0xfee50b7025c36a08, 0x02f236d04753d5b4}, {0x9f4f2726179a2245, 0x01d762422c946590}, - {0xc722f0ef9d80aad6, 0x424d3ad2b7b97ef5}, {0xf8ebad2b84e0d58b, 0xd2e0898765a7deb2}, - {0x9b934c3b330c8577, 0x63cc55f49f88eb2f}, {0xc2781f49ffcfa6d5, 0x3cbf6b71c76b25fb}, - {0xf316271c7fc3908a, 0x8bef464e3945ef7a}, {0x97edd871cfda3a56, 0x97758bf0e3cbb5ac}, - {0xbde94e8e43d0c8ec, 0x3d52eeed1cbea317}, {0xed63a231d4c4fb27, 0x4ca7aaa863ee4bdd}, - {0x945e455f24fb1cf8, 0x8fe8caa93e74ef6a}, {0xb975d6b6ee39e436, 0xb3e2fd538e122b44}, - {0xe7d34c64a9c85d44, 0x60dbbca87196b616}, {0x90e40fbeea1d3a4a, 0xbc8955e946fe31cd}, - {0xb51d13aea4a488dd, 0x6babab6398bdbe41}, {0xe264589a4dcdab14, 0xc696963c7eed2dd1}, - {0x8d7eb76070a08aec, 0xfc1e1de5cf543ca2}, {0xb0de65388cc8ada8, 0x3b25a55f43294bcb}, - {0xdd15fe86affad912, 0x49ef0eb713f39ebe}, {0x8a2dbf142dfcc7ab, 0x6e3569326c784337}, - {0xacb92ed9397bf996, 0x49c2c37f07965404}, {0xd7e77a8f87daf7fb, 0xdc33745ec97be906}, - {0x86f0ac99b4e8dafd, 0x69a028bb3ded71a3}, {0xa8acd7c0222311bc, 0xc40832ea0d68ce0c}, - {0xd2d80db02aabd62b, 0xf50a3fa490c30190}, {0x83c7088e1aab65db, 0x792667c6da79e0fa}, - {0xa4b8cab1a1563f52, 0x577001b891185938}, {0xcde6fd5e09abcf26, 0xed4c0226b55e6f86}, - {0x80b05e5ac60b6178, 0x544f8158315b05b4}, {0xa0dc75f1778e39d6, 0x696361ae3db1c721}, - {0xc913936dd571c84c, 0x03bc3a19cd1e38e9}, {0xfb5878494ace3a5f, 0x04ab48a04065c723}, - {0x9d174b2dcec0e47b, 0x62eb0d64283f9c76}, {0xc45d1df942711d9a, 0x3ba5d0bd324f8394}, - {0xf5746577930d6500, 0xca8f44ec7ee36479}, {0x9968bf6abbe85f20, 0x7e998b13cf4e1ecb}, - {0xbfc2ef456ae276e8, 0x9e3fedd8c321a67e}, {0xefb3ab16c59b14a2, 0xc5cfe94ef3ea101e}, - {0x95d04aee3b80ece5, 0xbba1f1d158724a12}, {0xbb445da9ca61281f, 0x2a8a6e45ae8edc97}, - {0xea1575143cf97226, 0xf52d09d71a3293bd}, {0x924d692ca61be758, 0x593c2626705f9c56}, - {0xb6e0c377cfa2e12e, 0x6f8b2fb00c77836c}, {0xe498f455c38b997a, 0x0b6dfb9c0f956447}, - {0x8edf98b59a373fec, 0x4724bd4189bd5eac}, {0xb2977ee300c50fe7, 0x58edec91ec2cb657}, - {0xdf3d5e9bc0f653e1, 0x2f2967b66737e3ed}, {0x8b865b215899f46c, 0xbd79e0d20082ee74}, - {0xae67f1e9aec07187, 0xecd8590680a3aa11}, {0xda01ee641a708de9, 0xe80e6f4820cc9495}, - {0x884134fe908658b2, 0x3109058d147fdcdd}, {0xaa51823e34a7eede, 0xbd4b46f0599fd415}, - {0xd4e5e2cdc1d1ea96, 0x6c9e18ac7007c91a}, {0x850fadc09923329e, 0x03e2cf6bc604ddb0}, - {0xa6539930bf6bff45, 0x84db8346b786151c}, {0xcfe87f7cef46ff16, 0xe612641865679a63}, - {0x81f14fae158c5f6e, 0x4fcb7e8f3f60c07e}, {0xa26da3999aef7749, 0xe3be5e330f38f09d}, - {0xcb090c8001ab551c, 0x5cadf5bfd3072cc5}, {0xfdcb4fa002162a63, 0x73d9732fc7c8f7f6}, - {0x9e9f11c4014dda7e, 0x2867e7fddcdd9afa}, {0xc646d63501a1511d, 0xb281e1fd541501b8}, - {0xf7d88bc24209a565, 0x1f225a7ca91a4226}, {0x9ae757596946075f, 0x3375788de9b06958}, - {0xc1a12d2fc3978937, 0x0052d6b1641c83ae}, {0xf209787bb47d6b84, 0xc0678c5dbd23a49a}, - {0x9745eb4d50ce6332, 0xf840b7ba963646e0}, {0xbd176620a501fbff, 0xb650e5a93bc3d898}, - {0xec5d3fa8ce427aff, 0xa3e51f138ab4cebe}, {0x93ba47c980e98cdf, 0xc66f336c36b10137}, - {0xb8a8d9bbe123f017, 0xb80b0047445d4184}, {0xe6d3102ad96cec1d, 0xa60dc059157491e5}, - {0x9043ea1ac7e41392, 0x87c89837ad68db2f}, {0xb454e4a179dd1877, 0x29babe4598c311fb}, - {0xe16a1dc9d8545e94, 0xf4296dd6fef3d67a}, {0x8ce2529e2734bb1d, 0x1899e4a65f58660c}, - {0xb01ae745b101e9e4, 0x5ec05dcff72e7f8f}, {0xdc21a1171d42645d, 0x76707543f4fa1f73}, - {0x899504ae72497eba, 0x6a06494a791c53a8}, {0xabfa45da0edbde69, 0x0487db9d17636892}, - {0xd6f8d7509292d603, 0x45a9d2845d3c42b6}, {0x865b86925b9bc5c2, 0x0b8a2392ba45a9b2}, - {0xa7f26836f282b732, 0x8e6cac7768d7141e}, {0xd1ef0244af2364ff, 0x3207d795430cd926}, - {0x8335616aed761f1f, 0x7f44e6bd49e807b8}, {0xa402b9c5a8d3a6e7, 0x5f16206c9c6209a6}, - {0xcd036837130890a1, 0x36dba887c37a8c0f}, {0x802221226be55a64, 0xc2494954da2c9789}, - {0xa02aa96b06deb0fd, 0xf2db9baa10b7bd6c}, {0xc83553c5c8965d3d, 0x6f92829494e5acc7}, - {0xfa42a8b73abbf48c, 0xcb772339ba1f17f9}, {0x9c69a97284b578d7, 0xff2a760414536efb}, - {0xc38413cf25e2d70d, 0xfef5138519684aba}, {0xf46518c2ef5b8cd1, 0x7eb258665fc25d69}, - {0x98bf2f79d5993802, 0xef2f773ffbd97a61}, {0xbeeefb584aff8603, 0xaafb550ffacfd8fa}, - {0xeeaaba2e5dbf6784, 0x95ba2a53f983cf38}, {0x952ab45cfa97a0b2, 0xdd945a747bf26183}, - {0xba756174393d88df, 0x94f971119aeef9e4}, {0xe912b9d1478ceb17, 0x7a37cd5601aab85d}, - {0x91abb422ccb812ee, 0xac62e055c10ab33a}, {0xb616a12b7fe617aa, 0x577b986b314d6009}, - {0xe39c49765fdf9d94, 0xed5a7e85fda0b80b}, {0x8e41ade9fbebc27d, 0x14588f13be847307}, - {0xb1d219647ae6b31c, 0x596eb2d8ae258fc8}, {0xde469fbd99a05fe3, 0x6fca5f8ed9aef3bb}, - {0x8aec23d680043bee, 0x25de7bb9480d5854}, {0xada72ccc20054ae9, 0xaf561aa79a10ae6a}, - {0xd910f7ff28069da4, 0x1b2ba1518094da04}, {0x87aa9aff79042286, 0x90fb44d2f05d0842}, - {0xa99541bf57452b28, 0x353a1607ac744a53}, {0xd3fa922f2d1675f2, 0x42889b8997915ce8}, - {0x847c9b5d7c2e09b7, 0x69956135febada11}, {0xa59bc234db398c25, 0x43fab9837e699095}, - {0xcf02b2c21207ef2e, 0x94f967e45e03f4bb}, {0x8161afb94b44f57d, 0x1d1be0eebac278f5}, - {0xa1ba1ba79e1632dc, 0x6462d92a69731732}, {0xca28a291859bbf93, 0x7d7b8f7503cfdcfe}, - {0xfcb2cb35e702af78, 0x5cda735244c3d43e}, {0x9defbf01b061adab, 0x3a0888136afa64a7}, - {0xc56baec21c7a1916, 0x088aaa1845b8fdd0}, {0xf6c69a72a3989f5b, 0x8aad549e57273d45}, - {0x9a3c2087a63f6399, 0x36ac54e2f678864b}, {0xc0cb28a98fcf3c7f, 0x84576a1bb416a7dd}, - {0xf0fdf2d3f3c30b9f, 0x656d44a2a11c51d5}, {0x969eb7c47859e743, 0x9f644ae5a4b1b325}, - {0xbc4665b596706114, 0x873d5d9f0dde1fee}, {0xeb57ff22fc0c7959, 0xa90cb506d155a7ea}, - {0x9316ff75dd87cbd8, 0x09a7f12442d588f2}, {0xb7dcbf5354e9bece, 0x0c11ed6d538aeb2f}, - {0xe5d3ef282a242e81, 0x8f1668c8a86da5fa}, {0x8fa475791a569d10, 0xf96e017d694487bc}, - {0xb38d92d760ec4455, 0x37c981dcc395a9ac}, {0xe070f78d3927556a, 0x85bbe253f47b1417}, - {0x8c469ab843b89562, 0x93956d7478ccec8e}, {0xaf58416654a6babb, 0x387ac8d1970027b2}, - {0xdb2e51bfe9d0696a, 0x06997b05fcc0319e}, {0x88fcf317f22241e2, 0x441fece3bdf81f03}, - {0xab3c2fddeeaad25a, 0xd527e81cad7626c3}, {0xd60b3bd56a5586f1, 0x8a71e223d8d3b074}, - {0x85c7056562757456, 0xf6872d5667844e49}, {0xa738c6bebb12d16c, 0xb428f8ac016561db}, - {0xd106f86e69d785c7, 0xe13336d701beba52}, {0x82a45b450226b39c, 0xecc0024661173473}, - {0xa34d721642b06084, 0x27f002d7f95d0190}, {0xcc20ce9bd35c78a5, 0x31ec038df7b441f4}, - {0xff290242c83396ce, 0x7e67047175a15271}, {0x9f79a169bd203e41, 0x0f0062c6e984d386}, - {0xc75809c42c684dd1, 0x52c07b78a3e60868}, {0xf92e0c3537826145, 0xa7709a56ccdf8a82}, - {0x9bbcc7a142b17ccb, 0x88a66076400bb691}, {0xc2abf989935ddbfe, 0x6acff893d00ea435}, - {0xf356f7ebf83552fe, 0x0583f6b8c4124d43}, {0x98165af37b2153de, 0xc3727a337a8b704a}, - {0xbe1bf1b059e9a8d6, 0x744f18c0592e4c5c}, {0xeda2ee1c7064130c, 0x1162def06f79df73}, - {0x9485d4d1c63e8be7, 0x8addcb5645ac2ba8}, {0xb9a74a0637ce2ee1, 0x6d953e2bd7173692}, - {0xe8111c87c5c1ba99, 0xc8fa8db6ccdd0437}, {0x910ab1d4db9914a0, 0x1d9c9892400a22a2}, - {0xb54d5e4a127f59c8, 0x2503beb6d00cab4b}, {0xe2a0b5dc971f303a, 0x2e44ae64840fd61d}, - {0x8da471a9de737e24, 0x5ceaecfed289e5d2}, {0xb10d8e1456105dad, 0x7425a83e872c5f47}, - {0xdd50f1996b947518, 0xd12f124e28f77719}, {0x8a5296ffe33cc92f, 0x82bd6b70d99aaa6f}, - {0xace73cbfdc0bfb7b, 0x636cc64d1001550b}, {0xd8210befd30efa5a, 0x3c47f7e05401aa4e}, - {0x8714a775e3e95c78, 0x65acfaec34810a71}, {0xa8d9d1535ce3b396, 0x7f1839a741a14d0d}, - {0xd31045a8341ca07c, 0x1ede48111209a050}, {0x83ea2b892091e44d, 0x934aed0aab460432}, - {0xa4e4b66b68b65d60, 0xf81da84d5617853f}, {0xce1de40642e3f4b9, 0x36251260ab9d668e}, - {0x80d2ae83e9ce78f3, 0xc1d72b7c6b426019}, {0xa1075a24e4421730, 0xb24cf65b8612f81f}, - {0xc94930ae1d529cfc, 0xdee033f26797b627}, {0xfb9b7cd9a4a7443c, 0x169840ef017da3b1}, - {0x9d412e0806e88aa5, 0x8e1f289560ee864e}, {0xc491798a08a2ad4e, 0xf1a6f2bab92a27e2}, - {0xf5b5d7ec8acb58a2, 0xae10af696774b1db}, {0x9991a6f3d6bf1765, 0xacca6da1e0a8ef29}, - {0xbff610b0cc6edd3f, 0x17fd090a58d32af3}, {0xeff394dcff8a948e, 0xddfc4b4cef07f5b0}, - {0x95f83d0a1fb69cd9, 0x4abdaf101564f98e}, {0xbb764c4ca7a4440f, 0x9d6d1ad41abe37f1}, - {0xea53df5fd18d5513, 0x84c86189216dc5ed}, {0x92746b9be2f8552c, 0x32fd3cf5b4e49bb4}, - {0xb7118682dbb66a77, 0x3fbc8c33221dc2a1}, {0xe4d5e82392a40515, 0x0fabaf3feaa5334a}, - {0x8f05b1163ba6832d, 0x29cb4d87f2a7400e}, {0xb2c71d5bca9023f8, 0x743e20e9ef511012}, - {0xdf78e4b2bd342cf6, 0x914da9246b255416}, {0x8bab8eefb6409c1a, 0x1ad089b6c2f7548e}, - {0xae9672aba3d0c320, 0xa184ac2473b529b1}, {0xda3c0f568cc4f3e8, 0xc9e5d72d90a2741e}, - {0x8865899617fb1871, 0x7e2fa67c7a658892}, {0xaa7eebfb9df9de8d, 0xddbb901b98feeab7}, - {0xd51ea6fa85785631, 0x552a74227f3ea565}, {0x8533285c936b35de, 0xd53a88958f87275f}, - {0xa67ff273b8460356, 0x8a892abaf368f137}, {0xd01fef10a657842c, 0x2d2b7569b0432d85}, - {0x8213f56a67f6b29b, 0x9c3b29620e29fc73}, {0xa298f2c501f45f42, 0x8349f3ba91b47b8f}, - {0xcb3f2f7642717713, 0x241c70a936219a73}, {0xfe0efb53d30dd4d7, 0xed238cd383aa0110}, - {0x9ec95d1463e8a506, 0xf4363804324a40aa}, {0xc67bb4597ce2ce48, 0xb143c6053edcd0d5}, - {0xf81aa16fdc1b81da, 0xdd94b7868e94050a}, {0x9b10a4e5e9913128, 0xca7cf2b4191c8326}, - {0xc1d4ce1f63f57d72, 0xfd1c2f611f63a3f0}, {0xf24a01a73cf2dccf, 0xbc633b39673c8cec}, - {0x976e41088617ca01, 0xd5be0503e085d813}, {0xbd49d14aa79dbc82, 0x4b2d8644d8a74e18}, - {0xec9c459d51852ba2, 0xddf8e7d60ed1219e}, {0x93e1ab8252f33b45, 0xcabb90e5c942b503}, - {0xb8da1662e7b00a17, 0x3d6a751f3b936243}, {0xe7109bfba19c0c9d, 0x0cc512670a783ad4}, - {0x906a617d450187e2, 0x27fb2b80668b24c5}, {0xb484f9dc9641e9da, 0xb1f9f660802dedf6}, - {0xe1a63853bbd26451, 0x5e7873f8a0396973}, {0x8d07e33455637eb2, 0xdb0b487b6423e1e8}, - {0xb049dc016abc5e5f, 0x91ce1a9a3d2cda62}, {0xdc5c5301c56b75f7, 0x7641a140cc7810fb}, - {0x89b9b3e11b6329ba, 0xa9e904c87fcb0a9d}, {0xac2820d9623bf429, 0x546345fa9fbdcd44}, - {0xd732290fbacaf133, 0xa97c177947ad4095}, {0x867f59a9d4bed6c0, 0x49ed8eabcccc485d}, - {0xa81f301449ee8c70, 0x5c68f256bfff5a74}, {0xd226fc195c6a2f8c, 0x73832eec6fff3111}, - {0x83585d8fd9c25db7, 0xc831fd53c5ff7eab}, {0xa42e74f3d032f525, 0xba3e7ca8b77f5e55}, - {0xcd3a1230c43fb26f, 0x28ce1bd2e55f35eb}, {0x80444b5e7aa7cf85, 0x7980d163cf5b81b3}, - {0xa0555e361951c366, 0xd7e105bcc332621f}, {0xc86ab5c39fa63440, 0x8dd9472bf3fefaa7}, - {0xfa856334878fc150, 0xb14f98f6f0feb951}, {0x9c935e00d4b9d8d2, 0x6ed1bf9a569f33d3}, - {0xc3b8358109e84f07, 0x0a862f80ec4700c8}, {0xf4a642e14c6262c8, 0xcd27bb612758c0fa}, - {0x98e7e9cccfbd7dbd, 0x8038d51cb897789c}, {0xbf21e44003acdd2c, 0xe0470a63e6bd56c3}, - {0xeeea5d5004981478, 0x1858ccfce06cac74}, {0x95527a5202df0ccb, 0x0f37801e0c43ebc8}, - {0xbaa718e68396cffd, 0xd30560258f54e6ba}, {0xe950df20247c83fd, 0x47c6b82ef32a2069}, - {0x91d28b7416cdd27e, 0x4cdc331d57fa5441}, {0xb6472e511c81471d, 0xe0133fe4adf8e952}, - {0xe3d8f9e563a198e5, 0x58180fddd97723a6}, {0x8e679c2f5e44ff8f, 0x570f09eaa7ea7648}, - }; - } -} - -#endif diff --git a/data/include/join/diyfp.hpp b/data/include/join/diyfp.hpp deleted file mode 100644 index 83274185..00000000 --- a/data/include/join/diyfp.hpp +++ /dev/null @@ -1,252 +0,0 @@ -/** - * MIT License - * - * Copyright (c) 2021 Mathieu Rabine - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef JOIN_DATA_DIYFP_HPP -#define JOIN_DATA_DIYFP_HPP - -// C++. -#include - -// C. -#include -#include - -namespace join -{ - /** - * @brief hand made floating point. - */ - class DiyFp - { - public: - /** - * @brief default constructor. - */ - constexpr DiyFp () noexcept = default; - - /** - * @brief copy constructor. - * @param other object to copy. - */ - constexpr DiyFp (const DiyFp& other) noexcept = default; - - /** - * @brief copy assignment. - * @param other object to copy. - * @return a reference of the current object. - */ - constexpr DiyFp& operator= (const DiyFp& other) noexcept = default; - - /** - * @brief create floating point using double. - * @param value double value. - */ - explicit DiyFp (double value) noexcept - { - uint64_t u64 = 0; - memcpy (&u64, &value, sizeof (double)); - - _mantissa = u64 & _mantissaMask; - _exponent = static_cast ((u64 & _exponentMask) >> _mantissaSize); - - if (_exponent) - { - _mantissa += _hiddenBit; - _exponent -= _exponentBias; - } - else - { - _exponent = 1 - _exponentBias; - } - } - - /** - * @brief create floating point using mantissa and exponent. - * @param mantissa mantissa. - * @param exponent exponent. - */ - constexpr DiyFp (uint64_t mantissa, int exponent) noexcept - : _mantissa (mantissa) - , _exponent (exponent) - { - } - - /** - * @brief destroy instance. - */ - ~DiyFp () = default; - - /** - * @brief normalize floating point. - * @return a reference of the current object. - */ - inline constexpr DiyFp& normalize () noexcept - { - if (_mantissa == 0) - { - return *this; - } - - int shift = __builtin_clzll (_mantissa); - _mantissa <<= shift; - _exponent -= shift; - - return *this; - } - - private: - /** - * @brief normalize boundary. - * @return a reference of the current object. - */ - inline constexpr DiyFp& normalizeBoundary () noexcept - { - if (_mantissa != 0) - { - int shift = __builtin_clzll (_mantissa) - (64 - _mantissaSize - 2); - if (shift > 0) - { - _mantissa <<= shift; - _exponent -= shift; - } - } - - constexpr int shift = _diyMantissaSize - _mantissaSize - 2; - _mantissa <<= shift; - _exponent -= shift; - - return *this; - } - - public: - /** - * @brief get normalized boundaries. - * @return normalized boundaries. - */ - constexpr void normalizedBoundaries (DiyFp& minus, DiyFp& plus) const noexcept - { - plus._mantissa = (_mantissa << 1) + 1; - plus._exponent = _exponent - 1; - plus.normalizeBoundary (); - - const bool special = __builtin_expect (_mantissa == _hiddenBit, 0); - minus._mantissa = (_mantissa << (special ? 2 : 1)) - 1; - minus._exponent = _exponent - (special ? 2 : 1); - - const int diff = minus._exponent - plus._exponent; - minus._mantissa <<= diff; - minus._exponent = plus._exponent; - } - - /** - * @brief minus operator - * @param rhs floating point. - * @return a reference of the current object. - */ - inline constexpr DiyFp& operator-= (const DiyFp& rhs) noexcept - { - _mantissa -= rhs._mantissa; - return *this; - } - - /** - * @brief multiplication operator. - * @param rhs floating point. - * @return a reference of the current object. - */ - inline constexpr DiyFp& operator*= (const DiyFp& rhs) noexcept - { -#if defined(__SIZEOF_INT128__) - __uint128_t product = static_cast<__uint128_t> (_mantissa) * static_cast<__uint128_t> (rhs._mantissa); - _mantissa = static_cast ((product >> 64) + ((product >> 63) & 1)); -#else - uint64_t M32 = 0xFFFFFFFFU; - - uint64_t a = _mantissa >> 32; - uint64_t b = _mantissa & M32; - uint64_t c = rhs._mantissa >> 32; - uint64_t d = rhs._mantissa & M32; - - uint64_t ac = a * c; - uint64_t bc = b * c; - uint64_t ad = a * d; - uint64_t bd = b * d; - - uint64_t tmp = (bd >> 32) + (ad & M32) + (bc & M32) + (1U << 31); - _mantissa = ac + (ad >> 32) + (bc >> 32) + (tmp >> 32); -#endif - _exponent += rhs._exponent + 64; - - return *this; - } - - /// home made double mantissa size. - static constexpr int _diyMantissaSize = std::numeric_limits::digits; - - /// double mantissa size. - static constexpr int _mantissaSize = std::numeric_limits::digits - 1; - - /// exponent bias. - static constexpr int _exponentBias = 0x3FF + _mantissaSize; - - /// mantissa mask. - static constexpr uint64_t _mantissaMask = 0x000FFFFFFFFFFFFFLLU; - - /// exponent mask. - static constexpr uint64_t _exponentMask = 0x7FF0000000000000LLU; - - /// hidden bit. - static constexpr uint64_t _hiddenBit = 0x0010000000000000LLU; - - /// mantissa. - uint64_t _mantissa = 0; - - /// exponent. - int _exponent = 0; - }; - - /** - * @brief minus operator - * @param lhs floating point. - * @param rhs floating point. - * @return a floating point from lhs minus rhs. - */ - inline constexpr DiyFp operator- (const DiyFp& lhs, const DiyFp& rhs) - { - return DiyFp (lhs) -= rhs; - } - - /** - * @brief multiplication operator. - * @param lhs floating point. - * @param rhs floating point. - * @return a floating point from lhs multiplied by rhs. - */ - inline constexpr DiyFp operator* (const DiyFp& lhs, const DiyFp& rhs) - { - return DiyFp (lhs) *= rhs; - } -} - -#endif diff --git a/data/include/join/dtoa.hpp b/data/include/join/dtoa.hpp deleted file mode 100644 index c79309fd..00000000 --- a/data/include/join/dtoa.hpp +++ /dev/null @@ -1,245 +0,0 @@ -/** - * MIT License - * - * Copyright (c) 2021 Mathieu Rabine - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef JOIN_DATA_DTOA_HPP -#define JOIN_DATA_DTOA_HPP - -// libjoin. -#include - -// C. -#include -#include - -namespace join -{ - namespace details - { - inline char* writeExponent (char* buffer, int k) noexcept - { - *buffer = '-'; - buffer += (k < 0); - k = (k < 0) ? -k : k; - if (k >= 100) - { - *buffer++ = '0' + k / 100; - k %= 100; - *buffer++ = '0' + k / 10; - k %= 10; - } - else if (k >= 10) - { - *buffer++ = '0' + k / 10; - k %= 10; - } - *buffer++ = '0' + k; - return buffer; - } - - inline char* prettify (char* buffer, int length, int k) noexcept - { - assert (length > 0); - const int kk = length + k; - - if ((length <= kk) && (kk <= 21)) - { - memset (buffer + length, '0', kk - length); - buffer[kk] = '.'; - buffer[kk + 1] = '0'; - return &buffer[kk + 2]; - } - else if ((0 < kk) && (kk <= 21)) - { - if ((length - kk <= 16) && (kk <= 7)) - { - char tmp[16]; - memcpy (tmp, &buffer[kk], 16); - memcpy (&buffer[kk + 1], tmp, 16); - } - else - { - memmove (&buffer[kk + 1], &buffer[kk], length - kk); - } - buffer[kk] = '.'; - return &buffer[length + 1]; - } - else if ((-6 < kk) && (kk <= 0)) - { - int offset = 2 - kk; - memmove (&buffer[offset], &buffer[0], length); - buffer[0] = '0'; - buffer[1] = '.'; - memset (&buffer[2], '0', offset - 2); - return &buffer[length + offset]; - } - else if (length == 1) - { - buffer[1] = 'e'; - return writeExponent (&buffer[2], kk - 1); - } - else - { - memmove (&buffer[2], &buffer[1], length - 1); - buffer[1] = '.'; - buffer[length + 1] = 'e'; - return writeExponent (&buffer[length + 2], kk - 1); - } - } - - inline void grisuRound (char* buffer, int length, uint64_t delta, uint64_t rest, uint64_t ten_kappa, - uint64_t wp_w) noexcept - { - while ((rest < wp_w && delta - rest >= ten_kappa) && - (rest + ten_kappa < wp_w || wp_w - rest > rest + ten_kappa - wp_w)) - { - --buffer[length - 1]; - rest += ten_kappa; - } - } - - constexpr int digitsCount (uint32_t n) noexcept - { - if (n < 10) - return 1; - if (n < 100) - return 2; - if (n < 1000) - return 3; - if (n < 10000) - return 4; - if (n < 100000) - return 5; - if (n < 1000000) - return 6; - if (n < 10000000) - return 7; - if (n < 100000000) - return 8; - if (n < 1000000000) - return 9; - return 10; - } - - inline void digitsGen (const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int& length, - int& k) noexcept - { - const DiyFp one (static_cast (1) << -Mp._exponent, Mp._exponent); - const DiyFp wp_w = Mp - W; - uint32_t p1 = static_cast (Mp._mantissa >> -one._exponent); - uint64_t p2 = Mp._mantissa & (one._mantissa - 1); - int kappa = digitsCount (p1); - length = 0; - - while (kappa > 0) - { - assert (kappa >= 1 && kappa <= 10); - uint32_t d = p1 / pow10[kappa - 1]; - p1 %= pow10[kappa - 1]; - if (d || length) - { - buffer[length++] = '0' + d; - } - --kappa; - uint64_t tmp = (static_cast (p1) << -one._exponent) + p2; - if (tmp <= delta) - { - k += kappa; - grisuRound (buffer, length, delta, tmp, static_cast (pow10[kappa]) << -one._exponent, - wp_w._mantissa); - return; - } - } - - uint64_t unit = 1; - for (;;) - { - assert (unit <= UINT64_MAX / 10); - p2 *= 10; - delta *= 10; - unit *= 10; - char d = static_cast (p2 >> -one._exponent); - buffer[length] = '0' + d; - length += (d || length); - p2 &= one._mantissa - 1; - --kappa; - if (p2 < delta) - { - k += kappa; - grisuRound (buffer, length, delta, p2, one._mantissa, wp_w._mantissa * unit); - return; - } - } - } - - inline void grisu2 (char* buffer, int& length, int& k, double value) noexcept - { - DiyFp val (value), minus, plus; - val.normalizedBoundaries (minus, plus); - - const int expr = -59 - (plus._exponent + 64) + 63; - const int mk = (expr * 30103 + 99999) / 100000; - - assert (mk + 343 >= 0 && mk + 343 < 687); - const DiyFp& c_mk = dtoapow[mk + 343]; - - minus *= c_mk; - plus *= c_mk; - - ++minus._mantissa; - --plus._mantissa; - - k = -mk; - digitsGen (val.normalize () * c_mk, plus, plus._mantissa - minus._mantissa, buffer, length, k); - } - } - - /** - * @brief double to string conversion. - * @param buffer buffer to write the string representation to (must point to at least 25 writable bytes). - * @param value value to convert. - * @return end position. - */ - inline char* dtoa (char* buffer, double value) noexcept - { - uint64_t bits; - memcpy (&bits, &value, sizeof (double)); - bool is_negative = (bits >> 63) != 0; - - *buffer = '-'; - buffer += is_negative; - value = is_negative ? -value : value; - - if (value == 0.0) - { - memcpy (buffer, "0.0", 3); - return buffer + 3; - } - - int length = 0, k = 0; - details::grisu2 (buffer, length, k, value); - return details::prettify (buffer, length, k); - } -} - -#endif diff --git a/data/include/join/dtoapow.hpp b/data/include/join/dtoapow.hpp deleted file mode 100644 index 1ecb846a..00000000 --- a/data/include/join/dtoapow.hpp +++ /dev/null @@ -1,270 +0,0 @@ -/** - * MIT License - * - * Copyright (c) 2025 Mathieu Rabine - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef JOIN_DATA_DTOAPOW_HPP -#define JOIN_DATA_DTOAPOW_HPP - -// join. -#include - -namespace join -{ - namespace details - { - constexpr uint32_t pow10[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000}; - - constexpr DiyFp dtoapow[] = { - {0xbf29dcaba82fdeae, -1203}, {0xeef453d6923bd65a, -1200}, {0x9558b4661b6565f8, -1196}, - {0xbaaee17fa23ebf76, -1193}, {0xe95a99df8ace6f54, -1190}, {0x91d8a02bb6c10594, -1186}, - {0xb64ec836a47146fa, -1183}, {0xe3e27a444d8d98b8, -1180}, {0x8e6d8c6ab0787f73, -1176}, - {0xb208ef855c969f50, -1173}, {0xde8b2b66b3bc4724, -1170}, {0x8b16fb203055ac76, -1166}, - {0xaddcb9e83c6b1794, -1163}, {0xd953e8624b85dd79, -1160}, {0x87d4713d6f33aa6c, -1156}, - {0xa9c98d8ccb009506, -1153}, {0xd43bf0effdc0ba48, -1150}, {0x84a57695fe98746d, -1146}, - {0xa5ced43b7e3e9188, -1143}, {0xcf42894a5dce35ea, -1140}, {0x818995ce7aa0e1b2, -1136}, - {0xa1ebfb4219491a1f, -1133}, {0xca66fa129f9b60a7, -1130}, {0xfd00b897478238d1, -1127}, - {0x9e20735e8cb16382, -1123}, {0xc5a890362fddbc63, -1120}, {0xf712b443bbd52b7c, -1117}, - {0x9a6bb0aa55653b2d, -1113}, {0xc1069cd4eabe89f9, -1110}, {0xf148440a256e2c77, -1107}, - {0x96cd2a865764dbca, -1103}, {0xbc807527ed3e12bd, -1100}, {0xeba09271e88d976c, -1097}, - {0x93445b8731587ea3, -1093}, {0xb8157268fdae9e4c, -1090}, {0xe61acf033d1a45df, -1087}, - {0x8fd0c16206306bac, -1083}, {0xb3c4f1ba87bc8697, -1080}, {0xe0b62e2929aba83c, -1077}, - {0x8c71dcd9ba0b4926, -1073}, {0xaf8e5410288e1b6f, -1070}, {0xdb71e91432b1a24b, -1067}, - {0x892731ac9faf056f, -1063}, {0xab70fe17c79ac6ca, -1060}, {0xd64d3d9db981787d, -1057}, - {0x85f0468293f0eb4e, -1053}, {0xa76c582338ed2622, -1050}, {0xd1476e2c07286faa, -1047}, - {0x82cca4db847945ca, -1043}, {0xa37fce126597973d, -1040}, {0xcc5fc196fefd7d0c, -1037}, - {0xff77b1fcbebcdc4f, -1034}, {0x9faacf3df73609b1, -1030}, {0xc795830d75038c1e, -1027}, - {0xf97ae3d0d2446f25, -1024}, {0x9becce62836ac577, -1020}, {0xc2e801fb244576d5, -1017}, - {0xf3a20279ed56d48a, -1014}, {0x9845418c345644d7, -1010}, {0xbe5691ef416bd60c, -1007}, - {0xedec366b11c6cb8f, -1004}, {0x94b3a202eb1c3f39, -1000}, {0xb9e08a83a5e34f08, -997}, - {0xe858ad248f5c22ca, -994}, {0x91376c36d99995be, -990}, {0xb58547448ffffb2e, -987}, - {0xe2e69915b3fff9f9, -984}, {0x8dd01fad907ffc3c, -980}, {0xb1442798f49ffb4b, -977}, - {0xdd95317f31c7fa1d, -974}, {0x8a7d3eef7f1cfc52, -970}, {0xad1c8eab5ee43b67, -967}, - {0xd863b256369d4a41, -964}, {0x873e4f75e2224e68, -960}, {0xa90de3535aaae202, -957}, - {0xd3515c2831559a83, -954}, {0x8412d9991ed58092, -950}, {0xa5178fff668ae0b6, -947}, - {0xce5d73ff402d98e4, -944}, {0x80fa687f881c7f8e, -940}, {0xa139029f6a239f72, -937}, - {0xc987434744ac874f, -934}, {0xfbe9141915d7a922, -931}, {0x9d71ac8fada6c9b5, -927}, - {0xc4ce17b399107c23, -924}, {0xf6019da07f549b2b, -921}, {0x99c102844f94e0fb, -917}, - {0xc0314325637a193a, -914}, {0xf03d93eebc589f88, -911}, {0x96267c7535b763b5, -907}, - {0xbbb01b9283253ca3, -904}, {0xea9c227723ee8bcb, -901}, {0x92a1958a7675175f, -897}, - {0xb749faed14125d37, -894}, {0xe51c79a85916f485, -891}, {0x8f31cc0937ae58d3, -887}, - {0xb2fe3f0b8599ef08, -884}, {0xdfbdcece67006ac9, -881}, {0x8bd6a141006042be, -877}, - {0xaecc49914078536d, -874}, {0xda7f5bf590966849, -871}, {0x888f99797a5e012d, -867}, - {0xaab37fd7d8f58179, -864}, {0xd5605fcdcf32e1d7, -861}, {0x855c3be0a17fcd26, -857}, - {0xa6b34ad8c9dfc070, -854}, {0xd0601d8efc57b08c, -851}, {0x823c12795db6ce57, -847}, - {0xa2cb1717b52481ed, -844}, {0xcb7ddcdda26da269, -841}, {0xfe5d54150b090b03, -838}, - {0x9efa548d26e5a6e2, -834}, {0xc6b8e9b0709f109a, -831}, {0xf867241c8cc6d4c1, -828}, - {0x9b407691d7fc44f8, -824}, {0xc21094364dfb5637, -821}, {0xf294b943e17a2bc4, -818}, - {0x979cf3ca6cec5b5b, -814}, {0xbd8430bd08277231, -811}, {0xece53cec4a314ebe, -808}, - {0x940f4613ae5ed137, -804}, {0xb913179899f68584, -801}, {0xe757dd7ec07426e5, -798}, - {0x9096ea6f3848984f, -794}, {0xb4bca50b065abe63, -791}, {0xe1ebce4dc7f16dfc, -788}, - {0x8d3360f09cf6e4bd, -784}, {0xb080392cc4349ded, -781}, {0xdca04777f541c568, -778}, - {0x89e42caaf9491b61, -774}, {0xac5d37d5b79b6239, -771}, {0xd77485cb25823ac7, -768}, - {0x86a8d39ef77164bd, -764}, {0xa8530886b54dbdec, -761}, {0xd267caa862a12d67, -758}, - {0x8380dea93da4bc60, -754}, {0xa46116538d0deb78, -751}, {0xcd795be870516656, -748}, - {0x806bd9714632dff6, -744}, {0xa086cfcd97bf97f4, -741}, {0xc8a883c0fdaf7df0, -738}, - {0xfad2a4b13d1b5d6c, -735}, {0x9cc3a6eec6311a64, -731}, {0xc3f490aa77bd60fd, -728}, - {0xf4f1b4d515acb93c, -725}, {0x991711052d8bf3c5, -721}, {0xbf5cd54678eef0b7, -718}, - {0xef340a98172aace5, -715}, {0x9580869f0e7aac0f, -711}, {0xbae0a846d2195713, -708}, - {0xe998d258869facd7, -705}, {0x91ff83775423cc06, -701}, {0xb67f6455292cbf08, -698}, - {0xe41f3d6a7377eeca, -695}, {0x8e938662882af53e, -691}, {0xb23867fb2a35b28e, -688}, - {0xdec681f9f4c31f31, -685}, {0x8b3c113c38f9f37f, -681}, {0xae0b158b4738705f, -678}, - {0xd98ddaee19068c76, -675}, {0x87f8a8d4cfa417ca, -671}, {0xa9f6d30a038d1dbc, -668}, - {0xd47487cc8470652b, -665}, {0x84c8d4dfd2c63f3b, -661}, {0xa5fb0a17c777cf0a, -658}, - {0xcf79cc9db955c2cc, -655}, {0x81ac1fe293d599c0, -651}, {0xa21727db38cb0030, -648}, - {0xca9cf1d206fdc03c, -645}, {0xfd442e4688bd304b, -642}, {0x9e4a9cec15763e2f, -638}, - {0xc5dd44271ad3cdba, -635}, {0xf7549530e188c129, -632}, {0x9a94dd3e8cf578ba, -628}, - {0xc13a148e3032d6e8, -625}, {0xf18899b1bc3f8ca2, -622}, {0x96f5600f15a7b7e5, -618}, - {0xbcb2b812db11a5de, -615}, {0xebdf661791d60f56, -612}, {0x936b9fcebb25c996, -608}, - {0xb84687c269ef3bfb, -605}, {0xe65829b3046b0afa, -602}, {0x8ff71a0fe2c2e6dc, -598}, - {0xb3f4e093db73a093, -595}, {0xe0f218b8d25088b8, -592}, {0x8c974f7383725573, -588}, - {0xafbd2350644eead0, -585}, {0xdbac6c247d62a584, -582}, {0x894bc396ce5da772, -578}, - {0xab9eb47c81f5114f, -575}, {0xd686619ba27255a3, -572}, {0x8613fd0145877586, -568}, - {0xa798fc4196e952e7, -565}, {0xd17f3b51fca3a7a1, -562}, {0x82ef85133de648c5, -558}, - {0xa3ab66580d5fdaf6, -555}, {0xcc963fee10b7d1b3, -552}, {0xffbbcfe994e5c620, -549}, - {0x9fd561f1fd0f9bd4, -545}, {0xc7caba6e7c5382c9, -542}, {0xf9bd690a1b68637b, -539}, - {0x9c1661a651213e2d, -535}, {0xc31bfa0fe5698db8, -532}, {0xf3e2f893dec3f126, -529}, - {0x986ddb5c6b3a76b8, -525}, {0xbe89523386091466, -522}, {0xee2ba6c0678b597f, -519}, - {0x94db483840b717f0, -515}, {0xba121a4650e4ddec, -512}, {0xe896a0d7e51e1566, -509}, - {0x915e2486ef32cd60, -505}, {0xb5b5ada8aaff80b8, -502}, {0xe3231912d5bf60e6, -499}, - {0x8df5efabc5979c90, -495}, {0xb1736b96b6fd83b4, -492}, {0xddd0467c64bce4a1, -489}, - {0x8aa22c0dbef60ee4, -485}, {0xad4ab7112eb3929e, -482}, {0xd89d64d57a607745, -479}, - {0x87625f056c7c4a8b, -475}, {0xa93af6c6c79b5d2e, -472}, {0xd389b47879823479, -469}, - {0x843610cb4bf160cc, -465}, {0xa54394fe1eedb8ff, -462}, {0xce947a3da6a9273e, -459}, - {0x811ccc668829b887, -455}, {0xa163ff802a3426a9, -452}, {0xc9bcff6034c13053, -449}, - {0xfc2c3f3841f17c68, -446}, {0x9d9ba7832936edc1, -442}, {0xc5029163f384a931, -439}, - {0xf64335bcf065d37d, -436}, {0x99ea0196163fa42e, -432}, {0xc06481fb9bcf8d3a, -429}, - {0xf07da27a82c37088, -426}, {0x964e858c91ba2655, -422}, {0xbbe226efb628afeb, -419}, - {0xeadab0aba3b2dbe5, -416}, {0x92c8ae6b464fc96f, -412}, {0xb77ada0617e3bbcb, -409}, - {0xe55990879ddcaabe, -406}, {0x8f57fa54c2a9eab7, -402}, {0xb32df8e9f3546564, -399}, - {0xdff9772470297ebd, -396}, {0x8bfbea76c619ef36, -392}, {0xaefae51477a06b04, -389}, - {0xdab99e59958885c5, -386}, {0x88b402f7fd75539b, -382}, {0xaae103b5fcd2a882, -379}, - {0xd59944a37c0752a2, -376}, {0x857fcae62d8493a5, -372}, {0xa6dfbd9fb8e5b88f, -369}, - {0xd097ad07a71f26b2, -366}, {0x825ecc24c8737830, -362}, {0xa2f67f2dfa90563b, -359}, - {0xcbb41ef979346bca, -356}, {0xfea126b7d78186bd, -353}, {0x9f24b832e6b0f436, -349}, - {0xc6ede63fa05d3144, -346}, {0xf8a95fcf88747d94, -343}, {0x9b69dbe1b548ce7d, -339}, - {0xc24452da229b021c, -336}, {0xf2d56790ab41c2a3, -333}, {0x97c560ba6b0919a6, -329}, - {0xbdb6b8e905cb600f, -326}, {0xed246723473e3813, -323}, {0x9436c0760c86e30c, -319}, - {0xb94470938fa89bcf, -316}, {0xe7958cb87392c2c3, -313}, {0x90bd77f3483bb9ba, -309}, - {0xb4ecd5f01a4aa828, -306}, {0xe2280b6c20dd5232, -303}, {0x8d590723948a535f, -299}, - {0xb0af48ec79ace837, -296}, {0xdcdb1b2798182245, -293}, {0x8a08f0f8bf0f156b, -289}, - {0xac8b2d36eed2dac6, -286}, {0xd7adf884aa879177, -283}, {0x86ccbb52ea94baeb, -279}, - {0xa87fea27a539e9a5, -276}, {0xd29fe4b18e88640f, -273}, {0x83a3eeeef9153e89, -269}, - {0xa48ceaaab75a8e2b, -266}, {0xcdb02555653131b6, -263}, {0x808e17555f3ebf12, -259}, - {0xa0b19d2ab70e6ed6, -256}, {0xc8de047564d20a8c, -253}, {0xfb158592be068d2f, -250}, - {0x9ced737bb6c4183d, -246}, {0xc428d05aa4751e4d, -243}, {0xf53304714d9265e0, -240}, - {0x993fe2c6d07b7fac, -236}, {0xbf8fdb78849a5f97, -233}, {0xef73d256a5c0f77d, -230}, - {0x95a8637627989aae, -226}, {0xbb127c53b17ec159, -223}, {0xe9d71b689dde71b0, -220}, - {0x9226712162ab070e, -216}, {0xb6b00d69bb55c8d1, -213}, {0xe45c10c42a2b3b06, -210}, - {0x8eb98a7a9a5b04e3, -206}, {0xb267ed1940f1c61c, -203}, {0xdf01e85f912e37a3, -200}, - {0x8b61313bbabce2c6, -196}, {0xae397d8aa96c1b78, -193}, {0xd9c7dced53c72256, -190}, - {0x881cea14545c7575, -186}, {0xaa242499697392d3, -183}, {0xd4ad2dbfc3d07788, -180}, - {0x84ec3c97da624ab5, -176}, {0xa6274bbdd0fadd62, -173}, {0xcfb11ead453994ba, -170}, - {0x81ceb32c4b43fcf5, -166}, {0xa2425ff75e14fc32, -163}, {0xcad2f7f5359a3b3e, -160}, - {0xfd87b5f28300ca0e, -157}, {0x9e74d1b791e07e48, -153}, {0xc612062576589ddb, -150}, - {0xf79687aed3eec551, -147}, {0x9abe14cd44753b53, -143}, {0xc16d9a0095928a27, -140}, - {0xf1c90080baf72cb1, -137}, {0x971da05074da7bef, -133}, {0xbce5086492111aeb, -130}, - {0xec1e4a7db69561a5, -127}, {0x9392ee8e921d5d07, -123}, {0xb877aa3236a4b449, -120}, - {0xe69594bec44de15b, -117}, {0x901d7cf73ab0acd9, -113}, {0xb424dc35095cd80f, -110}, - {0xe12e13424bb40e13, -107}, {0x8cbccc096f5088cc, -103}, {0xafebff0bcb24aaff, -100}, - {0xdbe6fecebdedd5bf, -97}, {0x89705f4136b4a597, -93}, {0xabcc77118461cefd, -90}, - {0xd6bf94d5e57a42bc, -87}, {0x8637bd05af6c69b6, -83}, {0xa7c5ac471b478423, -80}, - {0xd1b71758e219652c, -77}, {0x83126e978d4fdf3b, -73}, {0xa3d70a3d70a3d70a, -70}, - {0xcccccccccccccccd, -67}, {0x8000000000000000, -63}, {0xa000000000000000, -60}, - {0xc800000000000000, -57}, {0xfa00000000000000, -54}, {0x9c40000000000000, -50}, - {0xc350000000000000, -47}, {0xf424000000000000, -44}, {0x9896800000000000, -40}, - {0xbebc200000000000, -37}, {0xee6b280000000000, -34}, {0x9502f90000000000, -30}, - {0xba43b74000000000, -27}, {0xe8d4a51000000000, -24}, {0x9184e72a00000000, -20}, - {0xb5e620f480000000, -17}, {0xe35fa931a0000000, -14}, {0x8e1bc9bf04000000, -10}, - {0xb1a2bc2ec5000000, -7}, {0xde0b6b3a76400000, -4}, {0x8ac7230489e80000, 0}, - {0xad78ebc5ac620000, 3}, {0xd8d726b7177a8000, 6}, {0x878678326eac9000, 10}, - {0xa968163f0a57b400, 13}, {0xd3c21bcecceda100, 16}, {0x84595161401484a0, 20}, - {0xa56fa5b99019a5c8, 23}, {0xcecb8f27f4200f3a, 26}, {0x813f3978f8940984, 30}, - {0xa18f07d736b90be5, 33}, {0xc9f2c9cd04674edf, 36}, {0xfc6f7c4045812296, 39}, - {0x9dc5ada82b70b59e, 43}, {0xc5371912364ce305, 46}, {0xf684df56c3e01bc7, 49}, - {0x9a130b963a6c115c, 53}, {0xc097ce7bc90715b3, 56}, {0xf0bdc21abb48db20, 59}, - {0x96769950b50d88f4, 63}, {0xbc143fa4e250eb31, 66}, {0xeb194f8e1ae525fd, 69}, - {0x92efd1b8d0cf37be, 73}, {0xb7abc627050305ae, 76}, {0xe596b7b0c643c719, 79}, - {0x8f7e32ce7bea5c70, 83}, {0xb35dbf821ae4f38c, 86}, {0xe0352f62a19e306f, 89}, - {0x8c213d9da502de45, 93}, {0xaf298d050e4395d7, 96}, {0xdaf3f04651d47b4c, 99}, - {0x88d8762bf324cd10, 103}, {0xab0e93b6efee0054, 106}, {0xd5d238a4abe98068, 109}, - {0x85a36366eb71f041, 113}, {0xa70c3c40a64e6c52, 116}, {0xd0cf4b50cfe20766, 119}, - {0x82818f1281ed44a0, 123}, {0xa321f2d7226895c8, 126}, {0xcbea6f8ceb02bb3a, 129}, - {0xfee50b7025c36a08, 132}, {0x9f4f2726179a2245, 136}, {0xc722f0ef9d80aad6, 139}, - {0xf8ebad2b84e0d58c, 142}, {0x9b934c3b330c8577, 146}, {0xc2781f49ffcfa6d5, 149}, - {0xf316271c7fc3908b, 152}, {0x97edd871cfda3a57, 156}, {0xbde94e8e43d0c8ec, 159}, - {0xed63a231d4c4fb27, 162}, {0x945e455f24fb1cf9, 166}, {0xb975d6b6ee39e437, 169}, - {0xe7d34c64a9c85d44, 172}, {0x90e40fbeea1d3a4b, 176}, {0xb51d13aea4a488dd, 179}, - {0xe264589a4dcdab15, 182}, {0x8d7eb76070a08aed, 186}, {0xb0de65388cc8ada8, 189}, - {0xdd15fe86affad912, 192}, {0x8a2dbf142dfcc7ab, 196}, {0xacb92ed9397bf996, 199}, - {0xd7e77a8f87daf7fc, 202}, {0x86f0ac99b4e8dafd, 206}, {0xa8acd7c0222311bd, 209}, - {0xd2d80db02aabd62c, 212}, {0x83c7088e1aab65db, 216}, {0xa4b8cab1a1563f52, 219}, - {0xcde6fd5e09abcf27, 222}, {0x80b05e5ac60b6178, 226}, {0xa0dc75f1778e39d6, 229}, - {0xc913936dd571c84c, 232}, {0xfb5878494ace3a5f, 235}, {0x9d174b2dcec0e47b, 239}, - {0xc45d1df942711d9a, 242}, {0xf5746577930d6501, 245}, {0x9968bf6abbe85f20, 249}, - {0xbfc2ef456ae276e9, 252}, {0xefb3ab16c59b14a3, 255}, {0x95d04aee3b80ece6, 259}, - {0xbb445da9ca61281f, 262}, {0xea1575143cf97227, 265}, {0x924d692ca61be758, 269}, - {0xb6e0c377cfa2e12e, 272}, {0xe498f455c38b997a, 275}, {0x8edf98b59a373fec, 279}, - {0xb2977ee300c50fe7, 282}, {0xdf3d5e9bc0f653e1, 285}, {0x8b865b215899f46d, 289}, - {0xae67f1e9aec07188, 292}, {0xda01ee641a708dea, 295}, {0x884134fe908658b2, 299}, - {0xaa51823e34a7eedf, 302}, {0xd4e5e2cdc1d1ea96, 305}, {0x850fadc09923329e, 309}, - {0xa6539930bf6bff46, 312}, {0xcfe87f7cef46ff17, 315}, {0x81f14fae158c5f6e, 319}, - {0xa26da3999aef774a, 322}, {0xcb090c8001ab551c, 325}, {0xfdcb4fa002162a63, 328}, - {0x9e9f11c4014dda7e, 332}, {0xc646d63501a1511e, 335}, {0xf7d88bc24209a565, 338}, - {0x9ae757596946075f, 342}, {0xc1a12d2fc3978937, 345}, {0xf209787bb47d6b85, 348}, - {0x9745eb4d50ce6333, 352}, {0xbd176620a501fc00, 355}, {0xec5d3fa8ce427b00, 358}, - {0x93ba47c980e98ce0, 362}, {0xb8a8d9bbe123f018, 365}, {0xe6d3102ad96cec1e, 368}, - {0x9043ea1ac7e41393, 372}, {0xb454e4a179dd1877, 375}, {0xe16a1dc9d8545e95, 378}, - {0x8ce2529e2734bb1d, 382}, {0xb01ae745b101e9e4, 385}, {0xdc21a1171d42645d, 388}, - {0x899504ae72497eba, 392}, {0xabfa45da0edbde69, 395}, {0xd6f8d7509292d603, 398}, - {0x865b86925b9bc5c2, 402}, {0xa7f26836f282b733, 405}, {0xd1ef0244af2364ff, 408}, - {0x8335616aed761f1f, 412}, {0xa402b9c5a8d3a6e7, 415}, {0xcd036837130890a1, 418}, - {0x802221226be55a65, 422}, {0xa02aa96b06deb0fe, 425}, {0xc83553c5c8965d3d, 428}, - {0xfa42a8b73abbf48d, 431}, {0x9c69a97284b578d8, 435}, {0xc38413cf25e2d70e, 438}, - {0xf46518c2ef5b8cd1, 441}, {0x98bf2f79d5993803, 445}, {0xbeeefb584aff8604, 448}, - {0xeeaaba2e5dbf6785, 451}, {0x952ab45cfa97a0b3, 455}, {0xba756174393d88e0, 458}, - {0xe912b9d1478ceb17, 461}, {0x91abb422ccb812ef, 465}, {0xb616a12b7fe617aa, 468}, - {0xe39c49765fdf9d95, 471}, {0x8e41ade9fbebc27d, 475}, {0xb1d219647ae6b31c, 478}, - {0xde469fbd99a05fe3, 481}, {0x8aec23d680043bee, 485}, {0xada72ccc20054aea, 488}, - {0xd910f7ff28069da4, 491}, {0x87aa9aff79042287, 495}, {0xa99541bf57452b28, 498}, - {0xd3fa922f2d1675f2, 501}, {0x847c9b5d7c2e09b7, 505}, {0xa59bc234db398c25, 508}, - {0xcf02b2c21207ef2f, 511}, {0x8161afb94b44f57d, 515}, {0xa1ba1ba79e1632dc, 518}, - {0xca28a291859bbf93, 521}, {0xfcb2cb35e702af78, 524}, {0x9defbf01b061adab, 528}, - {0xc56baec21c7a1916, 531}, {0xf6c69a72a3989f5c, 534}, {0x9a3c2087a63f6399, 538}, - {0xc0cb28a98fcf3c80, 541}, {0xf0fdf2d3f3c30b9f, 544}, {0x969eb7c47859e744, 548}, - {0xbc4665b596706115, 551}, {0xeb57ff22fc0c795a, 554}, {0x9316ff75dd87cbd8, 558}, - {0xb7dcbf5354e9bece, 561}, {0xe5d3ef282a242e82, 564}, {0x8fa475791a569d11, 568}, - {0xb38d92d760ec4455, 571}, {0xe070f78d3927556b, 574}, {0x8c469ab843b89563, 578}, - {0xaf58416654a6babb, 581}, {0xdb2e51bfe9d0696a, 584}, {0x88fcf317f22241e2, 588}, - {0xab3c2fddeeaad25b, 591}, {0xd60b3bd56a5586f2, 594}, {0x85c7056562757457, 598}, - {0xa738c6bebb12d16d, 601}, {0xd106f86e69d785c8, 604}, {0x82a45b450226b39d, 608}, - {0xa34d721642b06084, 611}, {0xcc20ce9bd35c78a5, 614}, {0xff290242c83396ce, 617}, - {0x9f79a169bd203e41, 621}, {0xc75809c42c684dd1, 624}, {0xf92e0c3537826146, 627}, - {0x9bbcc7a142b17ccc, 631}, {0xc2abf989935ddbfe, 634}, {0xf356f7ebf83552fe, 637}, - {0x98165af37b2153df, 641}, {0xbe1bf1b059e9a8d6, 644}, {0xeda2ee1c7064130c, 647}, - {0x9485d4d1c63e8be8, 651}, {0xb9a74a0637ce2ee1, 654}, {0xe8111c87c5c1ba9a, 657}, - {0x910ab1d4db9914a0, 661}, {0xb54d5e4a127f59c8, 664}, {0xe2a0b5dc971f303a, 667}, - {0x8da471a9de737e24, 671}, {0xb10d8e1456105dad, 674}, {0xdd50f1996b947519, 677}, - {0x8a5296ffe33cc930, 681}, {0xace73cbfdc0bfb7b, 684}, {0xd8210befd30efa5a, 687}, - {0x8714a775e3e95c78, 691}, {0xa8d9d1535ce3b396, 694}, {0xd31045a8341ca07c, 697}, - {0x83ea2b892091e44e, 701}, {0xa4e4b66b68b65d61, 704}, {0xce1de40642e3f4b9, 707}, - {0x80d2ae83e9ce78f4, 711}, {0xa1075a24e4421731, 714}, {0xc94930ae1d529cfd, 717}, - {0xfb9b7cd9a4a7443c, 720}, {0x9d412e0806e88aa6, 724}, {0xc491798a08a2ad4f, 727}, - {0xf5b5d7ec8acb58a3, 730}, {0x9991a6f3d6bf1766, 734}, {0xbff610b0cc6edd3f, 737}, - {0xeff394dcff8a948f, 740}, {0x95f83d0a1fb69cd9, 744}, {0xbb764c4ca7a44410, 747}, - {0xea53df5fd18d5514, 750}, {0x92746b9be2f8552c, 754}, {0xb7118682dbb66a77, 757}, - {0xe4d5e82392a40515, 760}, {0x8f05b1163ba6832d, 764}, {0xb2c71d5bca9023f8, 767}, - {0xdf78e4b2bd342cf7, 770}, {0x8bab8eefb6409c1a, 774}, {0xae9672aba3d0c321, 777}, - {0xda3c0f568cc4f3e9, 780}, {0x8865899617fb1871, 784}, {0xaa7eebfb9df9de8e, 787}, - {0xd51ea6fa85785631, 790}, {0x8533285c936b35df, 794}, {0xa67ff273b8460357, 797}, - {0xd01fef10a657842c, 800}, {0x8213f56a67f6b29c, 804}, {0xa298f2c501f45f43, 807}, - {0xcb3f2f7642717713, 810}, {0xfe0efb53d30dd4d8, 813}, {0x9ec95d1463e8a507, 817}, - {0xc67bb4597ce2ce49, 820}, {0xf81aa16fdc1b81db, 823}, {0x9b10a4e5e9913129, 827}, - {0xc1d4ce1f63f57d73, 830}, {0xf24a01a73cf2dcd0, 833}, {0x976e41088617ca02, 837}, - {0xbd49d14aa79dbc82, 840}, {0xec9c459d51852ba3, 843}, {0x93e1ab8252f33b46, 847}, - {0xb8da1662e7b00a17, 850}, {0xe7109bfba19c0c9d, 853}, {0x906a617d450187e2, 857}, - {0xb484f9dc9641e9db, 860}, {0xe1a63853bbd26451, 863}, {0x8d07e33455637eb3, 867}, - {0xb049dc016abc5e60, 870}, {0xdc5c5301c56b75f7, 873}, {0x89b9b3e11b6329bb, 877}, - {0xac2820d9623bf429, 880}, {0xd732290fbacaf134, 883}, {0x867f59a9d4bed6c0, 887}, - {0xa81f301449ee8c70, 890}, {0xd226fc195c6a2f8c, 893}, {0x83585d8fd9c25db8, 897}, - {0xa42e74f3d032f526, 900}, {0xcd3a1230c43fb26f, 903}, {0x80444b5e7aa7cf85, 907}, - {0xa0555e361951c367, 910}, {0xc86ab5c39fa63441, 913}, {0xfa856334878fc151, 916}, - {0x9c935e00d4b9d8d2, 920}, {0xc3b8358109e84f07, 923}, {0xf4a642e14c6262c9, 926}, - {0x98e7e9cccfbd7dbe, 930}, {0xbf21e44003acdd2d, 933}, {0xeeea5d5004981478, 936}, - {0x95527a5202df0ccb, 940}, {0xbaa718e68396cffe, 943}, {0xe950df20247c83fd, 946}, - {0x91d28b7416cdd27e, 950}, {0xb6472e511c81471e, 953}, {0xe3d8f9e563a198e5, 956}, - {0x8e679c2f5e44ff8f, 960}, {0xb201833b35d63f73, 963}, {0xde81e40a034bcf50, 966}, - {0x8b112e86420f6192, 970}, {0xadd57a27d29339f6, 973}, {0xd94ad8b1c7380874, 976}, - {0x87cec76f1c830549, 980}, {0xa9c2794ae3a3c69b, 983}, {0xd433179d9c8cb841, 986}, - {0x849feec281d7f329, 990}, {0xa5c7ea73224deff3, 993}, {0xcf39e50feae16bf0, 996}, - {0x81842f29f2cce376, 1000}, {0xa1e53af46f801c53, 1003}, {0xca5e89b18b602368, 1006}, - {0xfcf62c1dee382c42, 1009}, {0x9e19db92b4e31ba9, 1013}, {0xc5a05277621be294, 1016}, - {0xf70867153aa2db39, 1019}, {0x9a65406d44a5c903, 1023}, {0xc0fe908895cf3b44, 1026}, - {0xf13e34aabb430a15, 1029}, {0x96c6e0eab509e64d, 1033}, {0xbc789925624c5fe1, 1036}, - {0xeb96bf6ebadf77d9, 1039}, {0x933e37a534cbaae8, 1043}, {0xb80dc58e81fe95a1, 1046}, - {0xe61136f2227e3b0a, 1049}, {0x8fcac257558ee4e6, 1053}, {0xb3bd72ed2af29e20, 1056}, - {0xe0accfa875af45a8, 1059}, {0x8c6c01c9498d8b89, 1063}, {0xaf87023b9bf0ee6b, 1066}, - {0xdb68c2ca82ed2a06, 1069}, {0x892179be91d43a44, 1073}, {0xab69d82e364948d4, 1076}}; - } -} - -#endif diff --git a/data/include/join/json.hpp b/data/include/join/json.hpp index 5df2cfa7..33ece3f6 100644 --- a/data/include/join/json.hpp +++ b/data/include/join/json.hpp @@ -25,14 +25,16 @@ #ifndef JOIN_DATA_JSON_HPP #define JOIN_DATA_JSON_HPP +// dconv. +#include +#include +#include + // libjoin. #include -#include #include #include #include -#include -#include #include // C++. @@ -43,7 +45,6 @@ #include #include #include -#include namespace join { @@ -87,18 +88,6 @@ namespace join constexpr char hexDigits[17] = "0123456789abcdef"; } - struct LocaleDelete - { - constexpr LocaleDelete () noexcept = default; - - void operator() (locale_t loc) noexcept - { - freelocale (loc); - } - }; - - using LocalePtr = std::unique_ptr, LocaleDelete>; - /** * @brief JSON error codes. */ @@ -788,7 +777,7 @@ namespace join if constexpr (WriteMode == JsonWriteMode::Canonical) { char buf[25]; - char* end = join::dtoa (buf, value); + char* end = dconv::dtoa (buf, value); for (char* pos = buf; pos < end; ++pos) { append (*pos); @@ -804,7 +793,7 @@ namespace join { flush (); } - _size = join::dtoa (_buffer + _size, value) - _buffer; + _size = dconv::dtoa (_buffer + _size, value) - _buffer; } } @@ -1156,7 +1145,7 @@ namespace join template int deserialize (const char* document, size_t length, Handler& handler) { - StringProbe in (document, length); + dconv::StringProbe in (document, length); return read (in, handler); } @@ -1170,7 +1159,7 @@ namespace join template int deserialize (const char* first, const char* last, Handler& handler) { - StringProbe in (first, last); + dconv::StringProbe in (first, last); return read (in, handler); } @@ -1183,7 +1172,7 @@ namespace join template int deserialize (std::string_view document, Handler& handler) { - StringProbe in (document.data (), document.size ()); + dconv::StringProbe in (document.data (), document.size ()); return read (in, handler); } @@ -1196,7 +1185,7 @@ namespace join template int deserialize (std::stringstream& document, Handler& handler) { - StringStreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } @@ -1209,7 +1198,7 @@ namespace join template int deserialize (std::istringstream& document, Handler& handler) { - StringStreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } @@ -1222,7 +1211,7 @@ namespace join template int deserialize (std::fstream& document, Handler& handler) { - FileStreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } @@ -1235,7 +1224,7 @@ namespace join template int deserialize (std::ifstream& document, Handler& handler) { - FileStreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } @@ -1248,7 +1237,7 @@ namespace join template int deserialize (std::iostream& document, Handler& handler) { - StreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } @@ -1261,7 +1250,7 @@ namespace join template int deserialize (std::istream& document, Handler& handler) { - StreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } @@ -1432,226 +1421,6 @@ namespace join return handler.setBool (false); } - /** - * @brief parse an infinity value. - * @param document document to parse. - * @param handler handler receiving the document. - * @return 0 on success, -1 otherwise. - */ - template - int readInf (ProbeType& document, Handler& handler, bool negative) - { - if (JOIN_UNLIKELY (!(document.getIfNoCase ('n') && document.getIfNoCase ('f')))) - { - join::lastError = make_error_code (SaxErrc::InvalidValue); - return -1; - } - - if (JOIN_UNLIKELY (document.getIfNoCase ('i') && - !(document.getIfNoCase ('n') && document.getIfNoCase ('i') && - document.getIfNoCase ('t') && document.getIfNoCase ('y')))) - { - join::lastError = make_error_code (SaxErrc::InvalidValue); - return -1; - } - - return handler.setDouble (negative ? -std::numeric_limits::infinity () - : std::numeric_limits::infinity ()); - } - - /** - * @brief parse a nan value. - * @param document document to parse. - * @param handler handler receiving the document. - * @return 0 on success, -1 otherwise. - */ - template - int readNan (ProbeType& document, Handler& handler, bool negative) - { - if (JOIN_UNLIKELY (!(document.getIfNoCase ('a') && document.getIfNoCase ('n')))) - { - join::lastError = make_error_code (SaxErrc::InvalidValue); - return -1; - } - - return handler.setDouble (negative ? -std::numeric_limits::quiet_NaN () - : std::numeric_limits::quiet_NaN ()); - } - - /** - * @brief multiply two 64 bits unsigned integers. - * @param a multiplicand. - * @param b multiplier. - * @param high high 64 bits of the 128-bit result. - * @param low low 64 bits of the 128-bit result. - */ - inline void umul128 (uint64_t a, uint64_t b, uint64_t& high, uint64_t& low) noexcept - { -#if defined(__SIZEOF_INT128__) - __uint128_t p = static_cast<__uint128_t> (a) * b; - - high = static_cast (p >> 64); - low = static_cast (p); -#else - uint64_t b_lo = static_cast (b); - uint64_t b_hi = b >> 32; - uint64_t p0 = (a & 0xFFFFFFFF) * b_lo; - uint64_t p1 = (a >> 32) * b_lo; - uint64_t p2 = (a & 0xFFFFFFFF) * b_hi; - uint64_t p3 = (a >> 32) * b_hi; - uint64_t carry = (p0 >> 32) + (p1 & 0xFFFFFFFF) + (p2 & 0xFFFFFFFF); - - low = (carry << 32) | (p0 & 0xFFFFFFFF); - high = (carry >> 32) + (p1 >> 32) + (p2 >> 32) + p3; -#endif - } - - /** - * @brief multiply 192 bits unsigned integer by 64 bits unsigned integer. - * @param hi high 64 bits of the 128-bit multiplicand. - * @param lo low 64 bits of the 128-bit multiplicand. - * @param significand 64-bit multiplier. - * @param high high 64 bits of the 192-bit result. - * @param middle middle 64 bits of the 192-bit result. - * @param low low 64 bits of the 192-bit result. - */ - inline void umul192 (uint64_t hi, uint64_t lo, uint64_t significand, uint64_t& high, uint64_t& middle, - uint64_t& low) noexcept - { - uint64_t hi_hi, hi_lo, lo_hi; - umul128 (hi, significand, hi_hi, hi_lo); - umul128 (lo, significand, lo_hi, low); - - middle = hi_lo + lo_hi; - high = hi_hi + (middle < hi_lo); - } - - /** - * @brief convert double using fast path. - * @param significand significand digits. - * @param exponent exponent. - * @param value converted value. - * @return true on success, false otherwise. - */ - inline bool strtodFast (uint64_t significand, int64_t exponent, double& value) - { - constexpr double pow10[] = {1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, - 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22}; - - value = static_cast (significand); - - if (JOIN_LIKELY ((exponent >= -22) && (exponent <= 22) && (value <= 9007199254740991.0))) - { - value = (exponent < 0) ? (value / pow10[-exponent]) : (value * pow10[exponent]); - return true; - } - - if (JOIN_UNLIKELY ((exponent > 22) && (exponent < (22 + 16)))) - { - const double scaled = value * pow10[exponent - 22]; - if (scaled <= 9007199254740991.0) - { - value = scaled * pow10[22]; - return true; - } - } - - if (JOIN_UNLIKELY (value == 0.0)) - { - return true; - } - - if (JOIN_UNLIKELY (exponent < -325 || exponent > 308)) - { - return false; - } - - uint64_t high, middle, low; - const details::Power& power = details::atodpow[exponent + 325]; - int64_t exp = ((exponent * 217706) >> 16) + 1087; - - umul128 (power.hi, significand, high, middle); - if (JOIN_LIKELY (high != 0)) - { - const int shift = __builtin_clzll (high); - const uint64_t top = (shift != 0) ? ((high << shift) | (middle >> (64 - shift))) : high; - const uint64_t frac = top & 0x7FF; - - if (JOIN_LIKELY (((frac < 0x3FE) || (frac > 0x400)) && (exp - shift > 0) && (exp - shift < 2047))) - { - uint64_t bits = (static_cast (exp - shift) << 52) | ((top >> 11) & 0xFFFFFFFFFFFFF); - bits += (frac > 0x400); - std::memcpy (&value, &bits, sizeof (double)); - return true; - } - } - umul192 (power.hi, power.lo, significand, high, middle, low); - - int lz; - if (high != 0) - { - lz = __builtin_clzll (high); - exp -= lz; - } - else if (middle != 0) - { - lz = __builtin_clzll (middle); - exp -= lz + 64; - } - else - { - return false; // LCOV_EXCL_LINE - } - - if (JOIN_UNLIKELY (exp <= 0 || exp >= 2047)) - { - return false; - } - - if (high == 0) - { - high = middle << lz; - middle = 0; - } - else if (lz != 0) - { - high = (high << lz) | (middle >> (64 - lz)); - middle <<= lz; - } - - middle |= (low != 0); - - uint64_t mant = (high >> 11) & 0xFFFFFFFFFFFFF; - uint64_t bits = (static_cast (exp) << 52) | mant; - uint64_t frac = high & 0x7FF; - - if (JOIN_UNLIKELY ((frac == 0x3FF) && ((middle >> 8) == (~0ULL >> 8)))) - { - return false; - } - - bool roundUp = (frac > 0x400) | ((frac == 0x400) && ((middle != 0) || (mant & 1))); - - bits += roundUp; - std::memcpy (&value, &bits, sizeof (double)); - - return true; - } - - /** - * @brief convert double using strtod. - * @param num number to convert. - * @param value converted value. - * @return true on success, false otherwise. - */ - inline bool strtodSlow (const std::string& num, double& d) - { - static LocalePtr locale (newlocale (LC_ALL_MASK, "C", nullptr)); - char* end = nullptr; - d = strtod_l (num.c_str (), &end, locale.get ()); - return (end && (*end == '\0')); - } - /** * @brief parse a number value. * @param document document to parse. @@ -1661,147 +1430,34 @@ namespace join template int readNumber (ProbeType& document, Handler& handler) { - BufferingProbe probe (document); - - bool negative = probe.getIf ('-'); - - uint64_t max64 = std::numeric_limits::max (); - if (negative) - { - max64 = static_cast (std::numeric_limits::max ()) + 1; - } - - uint64_t digits = 0; - bool isDouble = false; - uint64_t u = 0; + double value = 0.0; + uint64_t significand = 0; + int64_t exponent = 0; + bool negative = false; + std::error_code ec; - if (JOIN_UNLIKELY (probe.getIf ('0'))) + if (JOIN_LIKELY (dconv::atod (document, value, significand, exponent, negative, ec) == 0)) { - if (JOIN_UNLIKELY (isDigit (probe.peek ()))) - { - join::lastError = make_error_code (SaxErrc::InvalidValue); - return -1; - } + return handler.setDouble (value); } - else if (JOIN_LIKELY (isDigit (probe.peek ()))) - { - digits = probe.readDigits (u, 18); - - while (JOIN_LIKELY (isDigit (probe.peek ()))) - { - int digit = probe.peek () - '0'; - - if (JOIN_UNLIKELY (u > ((max64 - digit) / 10))) - { - isDouble = true; - break; - } - u = (u * 10) + (probe.get () - '0'); - ++digits; - } - } - else if (JOIN_LIKELY (document.getIfNoCase ('i'))) - { - return readInf (document, handler, negative); - } - else if (JOIN_LIKELY (document.getIfNoCase ('n'))) - { - return readNan (document, handler, negative); - } - else + if (JOIN_UNLIKELY (ec != dconv::Errc::NotDouble)) { join::lastError = make_error_code (SaxErrc::InvalidValue); return -1; } - if (isDouble) - { - digits += probe.readDigits (u); - } - - int64_t frac = 0; - if (probe.getIf ('.')) + if (!negative) { - isDouble = true; - - if (JOIN_UNLIKELY (digits == 0)) - { - while (probe.getIf ('0')) - { - --frac; - } - } - - size_t count = probe.readDigits (u); - digits += count; - frac -= static_cast (count); + return handler.setUint64 (significand); } - int64_t exponent = 0; - if (probe.getIf ('e') || probe.getIf ('E')) + if (significand <= static_cast (std::numeric_limits::max ()) + 1) { - isDouble = true; - - bool negExp = false; - if (isSign (probe.peek ())) - { - negExp = (probe.get () == '-'); - } - - if (JOIN_LIKELY (isDigit (probe.peek ()))) - { - exponent = (probe.get () - '0'); - - while (JOIN_LIKELY (isDigit (probe.peek ()))) - { - int digit = probe.get () - '0'; - - if (JOIN_LIKELY (exponent <= ((std::numeric_limits::max () - digit) / 10))) - { - exponent = (exponent * 10) + digit; - } - } - } - else - { - join::lastError = make_error_code (SaxErrc::InvalidValue); - return -1; - } - - if (negExp) - { - exponent = -exponent; - } - } - - if (!isDouble) - { - return negative ? handler.setInt64 (static_cast (-u)) : handler.setUint64 (u); - } - - if (JOIN_LIKELY (digits <= 19)) - { - double d = 0.0; - if (strtodFast (u, exponent + frac, d)) - { - return handler.setDouble (negative ? -d : d); - } + return handler.setInt64 (static_cast (-significand)); } - std::string number; - probe.snapshot (number); - - double d = 0.0; - if (strtodSlow (number, d)) - { - return handler.setDouble (d); - } - - // LCOV_EXCL_START - join::lastError = make_error_code (SaxErrc::InvalidValue); - return -1; - // LCOV_EXCL_STOP + return handler.setDouble (-static_cast (significand)); } /** @@ -2051,7 +1707,7 @@ namespace join int ch = document.get (); - if (JOIN_UNLIKELY (details::whitespaceLookup.data[static_cast (ch)])) + if (JOIN_UNLIKELY (dconv::details::whitespaceLookup.data[static_cast (ch)])) { if (JOIN_UNLIKELY (skipWhitespaces (document) == -1)) { @@ -2151,7 +1807,7 @@ namespace join int ch = document.get (); - if (JOIN_UNLIKELY (details::whitespaceLookup.data[static_cast (ch)])) + if (JOIN_UNLIKELY (dconv::details::whitespaceLookup.data[static_cast (ch)])) { if (JOIN_UNLIKELY (skipWhitespaces (document) == -1)) { @@ -2246,16 +1902,6 @@ namespace join { return static_cast (c - '0') <= 9u; } - - /** - * @brief check if sign. - * @param c character to check. - * @return true if sign, false otherwise. - */ - constexpr bool isSign (char c) noexcept - { - return ((c ^ '+') & (c ^ '-')) == 0; - } }; /// JSON default reader. diff --git a/data/include/join/pack.hpp b/data/include/join/pack.hpp index a56953ef..e55ef893 100644 --- a/data/include/join/pack.hpp +++ b/data/include/join/pack.hpp @@ -25,11 +25,13 @@ #ifndef JOIN_DATA_PACK_HPP #define JOIN_DATA_PACK_HPP +// dconv. +#include + // libjoin. #include #include #include -#include #include // C++. @@ -709,7 +711,7 @@ namespace join template int deserialize (const char* document, size_t length, Handler& handler) { - StringProbe in (document, length); + dconv::StringProbe in (document, length); return read (in, handler); } @@ -723,7 +725,7 @@ namespace join template int deserialize (const char* first, const char* last, Handler& handler) { - StringProbe in (first, last); + dconv::StringProbe in (first, last); return read (in, handler); } @@ -736,7 +738,7 @@ namespace join template int deserialize (std::string_view document, Handler& handler) { - StringProbe in (document.data (), document.size ()); + dconv::StringProbe in (document.data (), document.size ()); return read (in, handler); } @@ -749,7 +751,7 @@ namespace join template int deserialize (std::stringstream& document, Handler& handler) { - StringStreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } @@ -762,7 +764,7 @@ namespace join template int deserialize (std::istringstream& document, Handler& handler) { - StringStreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } @@ -775,7 +777,7 @@ namespace join template int deserialize (std::fstream& document, Handler& handler) { - FileStreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } @@ -788,7 +790,7 @@ namespace join template int deserialize (std::ifstream& document, Handler& handler) { - FileStreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } @@ -801,7 +803,7 @@ namespace join template int deserialize (std::iostream& document, Handler& handler) { - StreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } @@ -814,7 +816,7 @@ namespace join template int deserialize (std::istream& document, Handler& handler) { - StreamProbe in (document); + dconv::StreamProbe in (document); return read (in, handler); } diff --git a/data/include/join/probe.hpp b/data/include/join/probe.hpp deleted file mode 100644 index 009a3a29..00000000 --- a/data/include/join/probe.hpp +++ /dev/null @@ -1,946 +0,0 @@ -/** - * MIT License - * - * Copyright (c) 2021 Mathieu Rabine - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef JOIN_DATA_PROBE_HPP -#define JOIN_DATA_PROBE_HPP - -// libjoin. -#include - -// C++. -#include -#include -#include -#include -#include - -// C. -#include -#include - -namespace join -{ - namespace details - { - struct alignas (64) EscapedTable - { - uint8_t data[256]; - - constexpr EscapedTable () - : data{} - { - for (unsigned i = 0; i < 0x20; ++i) - { - data[i] = 1; - } - data[static_cast ('"')] = 1; - data[static_cast ('\\')] = 1; - } - }; - - constexpr EscapedTable escapedLookup{}; - - struct alignas (64) WhitespaceTable - { - uint8_t data[256]; - - constexpr WhitespaceTable () - : data{} - { - data[static_cast ('\t')] = 1; - data[static_cast ('\n')] = 1; - data[static_cast ('\r')] = 1; - data[static_cast (' ')] = 1; - } - }; - - constexpr WhitespaceTable whitespaceLookup{}; - } - - /** - * @brief string probe. - */ - class StringProbe - { - public: - using ProbePos = const char*; - - /** - * @brief default constructor. - * @param in input string. - * @param count number of characters. - */ - constexpr StringProbe (const char* in, size_t count) - : _cur (in) - , _beg (in) - , _end (in ? in + count : in) - { - } - - /** - * @brief default constructor. - * @param first pointer to the first character of the string. - * @param last pointer to the last character of the string. - */ - constexpr StringProbe (const char* first, const char* last) - : _cur (first) - , _beg (first) - , _end (last) - { - } - - /** - * @brief default constructor. - * @param in input string. - */ - StringProbe (const char* in) - : _cur (in) - , _beg (in) - , _end (in ? in + std::char_traits::length (in) : in) - { - } - - /** - * @brief copy constructor. - * @param other object to copy. - */ - StringProbe (const StringProbe& other) = default; - - /** - * @brief copy assignment. - * @param other object to copy. - * @return a reference of the current object. - */ - StringProbe& operator= (const StringProbe& other) = default; - - /** - * @brief move constructor. - * @param other object to move. - */ - StringProbe (StringProbe&& other) = default; - - /** - * @brief move assignment. - * @param other object to move. - * @return a reference of the current object. - */ - StringProbe& operator= (StringProbe&& other) = default; - - /** - * @brief destroy instance. - */ - ~StringProbe () = default; - - /** - * @brief get character without extracting it. - * @return extracted character. - */ - inline int peek () const noexcept - { - if (JOIN_LIKELY (_cur < _end)) - { - return static_cast (*_cur); - } - return std::char_traits::eof (); - } - - /** - * @brief extracts character. - * @return extracted character. - */ - inline int get () noexcept - { - if (JOIN_LIKELY (_cur < _end)) - { - return static_cast (*_cur++); - } - return std::char_traits::eof (); - } - - /** - * @brief extracts expected character. - * @param expected expected character. - * @return true if extracted, false otherwise. - */ - inline bool getIf (char expected) noexcept - { - if (JOIN_LIKELY (_cur < _end) && (*_cur == expected)) - { - ++_cur; - return true; - } - return false; - } - - /** - * @brief extracts expected character (case insensitive, ASCII-only). - * @param expected expected character. - * @return true if extracted, false otherwise. - */ - inline bool getIfNoCase (char expected) noexcept - { - if (JOIN_LIKELY (_cur < _end)) - { - const char c = *_cur; - if ((c | 32) == (expected | 32)) - { - ++_cur; - return true; - } - } - return false; - } - - /** - * @brief read consecutive digits. - * @param value value the digits are appended to. - * @param max maximum number of digits to read. - * @return number of digits read. - */ - inline size_t readDigits (uint64_t& value, size_t max = std::numeric_limits::max ()) noexcept - { - const char* cur = _cur; - const char* end = (static_cast (_end - _cur) > max) ? _cur + max : _end; - uint64_t word; - - while ((end - cur >= 8) && - (std::memcpy (&word, cur, 8), - ((word & 0xF0F0F0F0F0F0F0F0ULL) | - (((word + 0x0606060606060606ULL) & 0xF0F0F0F0F0F0F0F0ULL) >> 4)) == 0x3333333333333333ULL)) - { - word = ((word & 0x0F0F0F0F0F0F0F0FULL) * 2561) >> 8; - word = ((word & 0x00FF00FF00FF00FFULL) * 6553601) >> 16; - word = ((word & 0x0000FFFF0000FFFFULL) * 42949672960001ULL) >> 32; - value = (value * 100000000) + word; - cur += 8; - } - - while ((cur < end) && (static_cast (*cur - '0') < 10)) - { - value = (value * 10) + (*cur++ - '0'); - } - - size_t count = cur - _cur; - _cur = cur; - return count; - } - - /** - * @brief read characters. - * @param buf output buffer. - * @param count number of characters to read. - * @return number of characters read. - */ - inline size_t read (char* buf, size_t count) noexcept - { - const size_t available = _end - _cur; - const size_t nread = (count < available) ? count : available; - std::memcpy (buf, _cur, nread); - _cur += nread; - return nread; - } - - /** - * @brief read characters until escaped, without copying them. - * @return characters read. - */ - inline std::string_view readUntilEscaped () noexcept - { - const char* beg = _cur; - const char* cur = _cur; - const char* end = _end; - - while (end - cur >= 8) - { - uint64_t word, quote, backslash; - std::memcpy (&word, cur, 8); - quote = word ^ 0x2222222222222222ULL; - backslash = word ^ 0x5C5C5C5C5C5C5C5CULL; - uint64_t mask = - (((quote - 0x0101010101010101ULL) & ~quote) | ((backslash - 0x0101010101010101ULL) & ~backslash) | - ((word - 0x2020202020202020ULL) & ~word)) & - 0x8080808080808080ULL; - if (mask) - { - cur += __builtin_ctzll (mask) >> 3; - break; - } - cur += 8; - } - - while (cur < end && !details::escapedLookup.data[static_cast (*cur)]) - { - ++cur; - } - - _cur = cur; - return std::string_view (beg, static_cast (cur - beg)); - } - - /** - * @brief read characters until escaped. - * @param out output buffer. - */ - inline void readUntilEscaped (std::string& out) noexcept - { - out.append (readUntilEscaped ()); - } - - /** - * @brief skip whitespaces. - * @return 0 on success, -1 otherwise. - */ - inline int skipWhitespaces () noexcept - { - const char* cur = _cur; - const char* end = _end; - - while (cur < end && details::whitespaceLookup.data[static_cast (*cur)]) - { - ++cur; - - uint64_t word; - while ((end - cur >= 8) && (std::memcpy (&word, cur, 8), word == 0x2020202020202020ULL)) - { - cur += 8; - } - } - - _cur = cur; - - return 0; - } - - /** - * @brief skip whitespaces and comments. - * @return 0 on success, -1 otherwise. - */ - inline int skipWhitespacesAndComments () noexcept - { - const char* cur = _cur; - const char* end = _end; - - while (cur < end) - { - while (cur < end && details::whitespaceLookup.data[static_cast (*cur)]) - { - ++cur; - } - - if (cur >= end || *cur != '/') - { - break; - } - - if (++cur >= end) - { - return -1; - } - - if (*cur == '*') - { - ++cur; - bool closed = false; - while (cur < end) - { - if (*cur == '*' && (cur + 1 < end) && *(cur + 1) == '/') - { - cur += 2; - closed = true; - break; - } - ++cur; - } - if (!closed) - { - return -1; - } - } - else if (*cur == '/') - { - ++cur; - const char* p = static_cast (memchr (cur, '\n', end - cur)); - cur = p ? p : end; - } - else - { - return -1; - } - } - - _cur = cur; - - return 0; - } - - /** - * @brief get input position indicator. - * @return current position. - */ - inline ProbePos tell () const noexcept - { - return _cur; - } - - /** - * @brief seek to the specified position. - * @param pos position to seek to. - */ - inline void seek (ProbePos pos) noexcept - { - if (JOIN_LIKELY (pos >= _beg && pos <= _end)) - { - _cur = pos; - } - else if (pos < _beg) - { - _cur = _beg; - } - else - { - _cur = _end; - } - } - - private: - /// current position. - const char* _cur = nullptr; - - /// beginning position. - const char* _beg = nullptr; - - /// ending position. - const char* _end = nullptr; - }; - - /** - * @brief basic stream probe. - */ - template - class BasicStreamProbe - { - public: - using ProbePos = std::streampos; - - /** - * @brief default constructor. - * @param in input stream. - */ - BasicStreamProbe (std::istream& in) - : _in (in.rdbuf ()) - { - } - - /** - * @brief copy constructor. - * @param other object to copy. - */ - BasicStreamProbe (const BasicStreamProbe& other) = delete; - - /** - * @brief copy assignment. - * @param other object to copy. - * @return a reference of the current object. - */ - BasicStreamProbe& operator= (const BasicStreamProbe& other) = delete; - - /** - * @brief move constructor. - * @param other object to move. - */ - BasicStreamProbe (BasicStreamProbe&& other) = delete; - - /** - * @brief move assignment. - * @param other object to move. - * @return a reference of the current object. - */ - BasicStreamProbe& operator= (BasicStreamProbe&& other) = delete; - - /** - * @brief destroy instance. - */ - ~BasicStreamProbe () = default; - - /** - * @brief get character without extracting it. - * @return extracted character. - */ - inline int peek () const noexcept - { - return _in->sgetc (); - } - - /** - * @brief extracts character. - * @return extracted character. - */ - inline int get () noexcept - { - return _in->sbumpc (); - } - - /** - * @brief extracts expected character. - * @param expected expected character. - * @return true if extracted, false otherwise. - */ - inline bool getIf (char expected) noexcept - { - if (_in->sgetc () == static_cast (static_cast (expected))) - { - _in->sbumpc (); - return true; - } - return false; - } - - /** - * @brief extracts expected character (case insensitive, ASCII-only). - * @param expected expected character. - * @return true if extracted, false otherwise. - */ - inline bool getIfNoCase (char expected) noexcept - { - const int c = _in->sgetc (); - if (JOIN_LIKELY (c != std::char_traits::eof ())) - { - if ((static_cast (c) | 32) == (expected | 32)) - { - _in->sbumpc (); - return true; - } - } - return false; - } - - /** - * @brief read consecutive digits. - * @param value value the digits are appended to. - * @param max maximum number of digits to read. - * @return number of digits read. - */ - inline size_t readDigits (uint64_t& value, size_t max = std::numeric_limits::max ()) noexcept - { - size_t count = 0; - while ((count < max) && (static_cast (peek () - '0') < 10)) - { - value = (value * 10) + (get () - '0'); - ++count; - } - return count; - } - - /** - * @brief read characters. - * @param buf output buffer. - * @param count number of characters to read. - * @return number of characters read. - */ - inline size_t read (char* buf, size_t count) noexcept - { - return _in->sgetn (buf, count); - } - - /** - * @brief read characters until escaped. - * @param out output buffer. - */ - inline void readUntilEscaped (std::string& out) noexcept - { - int c; - while ((c = _in->sgetc ()) != std::char_traits::eof () && - !details::escapedLookup.data[static_cast (c)]) - { - out.push_back (static_cast (c)); - _in->sbumpc (); - } - } - - /** - * @brief skip whitespaces. - * @return 0 on success, -1 otherwise. - */ - inline int skipWhitespaces () noexcept - { - int c; - while ((c = _in->sgetc ()) != std::char_traits::eof () && - details::whitespaceLookup.data[static_cast (c)]) - { - _in->sbumpc (); - } - - return 0; - } - - /** - * @brief skip whitespaces and comments. - * @return 0 on success, -1 otherwise. - */ - inline int skipWhitespacesAndComments () noexcept - { - int c; - - while ((c = _in->sgetc ()) != std::char_traits::eof ()) - { - while ((c = _in->sgetc ()) != std::char_traits::eof () && - details::whitespaceLookup.data[static_cast (c)]) - { - _in->sbumpc (); - } - - if (c != '/') - { - break; - } - - _in->sbumpc (); - c = _in->sgetc (); - - if (c == std::char_traits::eof ()) - { - return -1; - } - - if (c == '*') - { - _in->sbumpc (); - bool closed = false; - - while ((c = _in->sbumpc ()) != std::char_traits::eof ()) - { - if (c == '*' && _in->sgetc () == '/') - { - _in->sbumpc (); - closed = true; - break; - } - } - - if (!closed) - { - return -1; - } - } - else if (c == '/') - { - _in->sbumpc (); - - while ((c = _in->sbumpc ()) != std::char_traits::eof () && c != '\n') - { - } - } - else - { - return -1; - } - } - - return 0; - } - - /** - * @brief get input position indicator. - * @return current position. - */ - inline ProbePos tell () const noexcept - requires Seekable - { - return _in->pubseekoff (0, std::ios::cur, std::ios::in); - } - - /** - * @brief seek to the specified position. - * @param pos position to seek to. - */ - inline void seek (ProbePos pos) noexcept - requires Seekable - { - _in->pubseekpos (pos, std::ios::in); - } - - private: - /// input stream buffer. - std::streambuf* _in; - }; - - /** - * @brief string stream probe (seekable). - */ - using StringStreamProbe = BasicStreamProbe; - - /** - * @brief file stream probe (seekable). - */ - using FileStreamProbe = BasicStreamProbe; - - /** - * @brief stream probe (non-seekable, for pipes/network streams). - */ - using StreamProbe = BasicStreamProbe; - - /** - * @brief trait to determine if a probe type is seekable. - */ - template - inline constexpr bool is_seekable_v = false; - - /** - * @brief specialization for StringProbe (seekable). - */ - template <> - inline constexpr bool is_seekable_v = true; - - /** - * @brief specialization for seekable probe. - */ - template <> - inline constexpr bool is_seekable_v> = true; - - /** - * @brief buffering probe adapter - */ - template > - class BufferingProbe; - - /** - * @brief buffering probe specialization for seekable probe. - */ - template - class BufferingProbe - { - public: - /** - * @brief default constructor. - * @param probe probe. - */ - explicit BufferingProbe (ProbeType& probe) - : _probe (probe) - , _beg (probe.tell ()) - { - } - - /** - * @brief get character without extracting it. - * @return extracted character. - */ - inline int peek () const noexcept - { - return _probe.peek (); - } - - /** - * @brief extracts character. - * @return extracted character. - */ - inline int get () noexcept - { - return _probe.get (); - } - - /** - * @brief extracts expected character. - * @param expected expected character. - * @return true if extracted, false otherwise. - */ - inline bool getIf (char expected) noexcept - { - return _probe.getIf (expected); - } - - /** - * @brief extracts expected character (case insensitive, ASCII-only). - * @param expected expected character. - * @return true if extracted, false otherwise. - */ - inline bool getIfNoCase (char expected) noexcept - { - return _probe.getIfNoCase (expected); - } - - /** - * @brief read consecutive digits. - * @param value value the digits are appended to. - * @param max maximum number of digits to read. - * @return number of digits read. - */ - inline size_t readDigits (uint64_t& value, size_t max = std::numeric_limits::max ()) noexcept - { - return _probe.readDigits (value, max); - } - - /** - * @brief get snapshot. - * @param out destination. - */ - inline void snapshot (std::string& out) - { - size_t len = _probe.tell () - _beg; - out.resize (len); - - _probe.seek (_beg); - _probe.read (&out[0], len); - } - - /** - * @brief consume buffered data. - * @param out destination. - */ - inline void consume (std::string& out) - { - snapshot (out); - _beg = _probe.tell (); - } - - private: - /// underlying probe. - ProbeType& _probe; - - /// start position. - typename ProbeType::ProbePos _beg; - }; - - /** - * @brief buffering probe specialization for non-seekable probe. - */ - template - class BufferingProbe - { - public: - /** - * @brief default constructor. - * @param probe probe. - */ - explicit BufferingProbe (ProbeType& probe) - : _probe (probe) - { - static thread_local std::vector buffer; - buffer.clear (); - buffer.reserve (32); - _buf = &buffer; - } - - /** - * @brief get character without extracting it. - * @return extracted character. - */ - inline int peek () const noexcept - { - return _probe.peek (); - } - - /** - * @brief extracts character. - * @return extracted character. - */ - inline int get () noexcept - { - const int c = _probe.get (); - if (JOIN_LIKELY (c != std::char_traits::eof ())) - { - _buf->push_back (static_cast (c)); - } - return c; - } - - /** - * @brief extracts expected character. - * @param expected expected character. - * @return true if extracted, false otherwise. - */ - inline bool getIf (char expected) noexcept - { - if (_probe.peek () == static_cast (static_cast (expected))) - { - _buf->push_back (static_cast (_probe.get ())); - return true; - } - return false; - } - - /** - * @brief extracts expected character (case insensitive, ASCII-only). - * @param expected expected character. - * @return true if extracted, false otherwise. - */ - inline bool getIfNoCase (char expected) noexcept - { - const int c = _probe.peek (); - if (JOIN_LIKELY (c != std::char_traits::eof ())) - { - if ((static_cast (c) | 32) == (expected | 32)) - { - _buf->push_back (static_cast (_probe.get ())); - return true; - } - } - return false; - } - - /** - * @brief read consecutive digits. - * @param value value the digits are appended to. - * @param max maximum number of digits to read. - * @return number of digits read. - */ - inline size_t readDigits (uint64_t& value, size_t max = std::numeric_limits::max ()) noexcept - { - size_t count = 0; - while ((count < max) && (static_cast (peek () - '0') < 10)) - { - value = (value * 10) + (get () - '0'); - ++count; - } - return count; - } - - /** - * @brief get snapshot. - * @param out destination. - */ - inline void snapshot (std::string& out) - { - out.assign (_buf->data (), _buf->size ()); - } - - /** - * @brief consume buffered data. - * @param out destination. - */ - inline void consume (std::string& out) - { - snapshot (out); - _buf->clear (); - } - - private: - /// underlying probe. - ProbeType& _probe; - - /// buffer for consumed data. - std::vector* _buf = nullptr; - }; -} - -#endif diff --git a/data/tests/CMakeLists.txt b/data/tests/CMakeLists.txt index 9e6e1582..4cb91ea9 100644 --- a/data/tests/CMakeLists.txt +++ b/data/tests/CMakeLists.txt @@ -12,21 +12,6 @@ target_link_libraries(utf16.gtest ${JOIN_DATA} GTest::gtest_main) add_test(NAME utf16.gtest COMMAND utf16.gtest) install(TARGETS utf16.gtest RUNTIME DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/test) -add_executable(dtoa.gtest dtoa_test.cpp) -target_link_libraries(dtoa.gtest ${JOIN_DATA} GTest::gtest_main) -add_test(NAME dtoa.gtest COMMAND dtoa.gtest) -install(TARGETS dtoa.gtest RUNTIME DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/test) - -add_executable(string_probe.gtest string_probe_test.cpp) -target_link_libraries(string_probe.gtest ${JOIN_DATA} GTest::gtest_main) -add_test(NAME string_probe.gtest COMMAND string_probe.gtest) -install(TARGETS string_probe.gtest RUNTIME DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/test) - -add_executable(stream_probe.gtest stream_probe_test.cpp) -target_link_libraries(stream_probe.gtest ${JOIN_DATA} GTest::gtest_main) -add_test(NAME stream_probe.gtest COMMAND stream_probe.gtest) -install(TARGETS stream_probe.gtest RUNTIME DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/test) - add_executable(value.gtest value_test.cpp) target_link_libraries(value.gtest ${JOIN_DATA} GTest::gtest_main) add_test(NAME value.gtest COMMAND value.gtest) diff --git a/data/tests/dtoa_test.cpp b/data/tests/dtoa_test.cpp deleted file mode 100644 index cd92d57c..00000000 --- a/data/tests/dtoa_test.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/** - * MIT License - * - * Copyright (c) 2021 Mathieu Rabine - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -// libjoin. -#include - -// libraries. -#include - -/** - * @brief digitsCount test. - */ -TEST (dtoa, digitsCount) -{ - EXPECT_EQ (join::details::digitsCount (0), 1); - EXPECT_EQ (join::details::digitsCount (9), 1); - EXPECT_EQ (join::details::digitsCount (10), 2); - EXPECT_EQ (join::details::digitsCount (99), 2); - EXPECT_EQ (join::details::digitsCount (100), 3); - EXPECT_EQ (join::details::digitsCount (999), 3); - EXPECT_EQ (join::details::digitsCount (1000), 4); - EXPECT_EQ (join::details::digitsCount (9999), 4); - EXPECT_EQ (join::details::digitsCount (10000), 5); - EXPECT_EQ (join::details::digitsCount (99999), 5); - EXPECT_EQ (join::details::digitsCount (100000), 6); - EXPECT_EQ (join::details::digitsCount (999999), 6); - EXPECT_EQ (join::details::digitsCount (1000000), 7); - EXPECT_EQ (join::details::digitsCount (9999999), 7); - EXPECT_EQ (join::details::digitsCount (10000000), 8); - EXPECT_EQ (join::details::digitsCount (99999999), 8); - EXPECT_EQ (join::details::digitsCount (100000000), 9); - EXPECT_EQ (join::details::digitsCount (999999999), 9); - EXPECT_EQ (join::details::digitsCount (1000000000), 10); - EXPECT_EQ (join::details::digitsCount (UINT32_MAX), 10); -} - -/** - * @brief dtoa test. - */ -TEST (dtoa, dtoa) -{ - char beg[25] = {}; - - char* end = join::dtoa (beg, 0.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "0.0"); - - end = join::dtoa (beg, -0.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "-0.0"); - - end = join::dtoa (beg, 0.1); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "0.1"); - - end = join::dtoa (beg, 0.12); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "0.12"); - - end = join::dtoa (beg, 0.123); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "0.123"); - - end = join::dtoa (beg, 0.1234); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "0.1234"); - - end = join::dtoa (beg, 1.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "1.0"); - - end = join::dtoa (beg, 1.1234); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "1.1234"); - - end = join::dtoa (beg, 1.5); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "1.5"); - - end = join::dtoa (beg, -1.5); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "-1.5"); - - end = join::dtoa (beg, 3.1416); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "3.1416"); - - end = join::dtoa (beg, 1E10); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "10000000000.0"); - - end = join::dtoa (beg, 1e10); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "10000000000.0"); - - end = join::dtoa (beg, 1E+10); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "10000000000.0"); - - end = join::dtoa (beg, 1E-10); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "1e-10"); - - end = join::dtoa (beg, -1E10); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "-10000000000.0"); - - end = join::dtoa (beg, -1e10); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "-10000000000.0"); - - end = join::dtoa (beg, -1E+10); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "-10000000000.0"); - - end = join::dtoa (beg, -1E-10); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "-1e-10"); - - end = join::dtoa (beg, 1.234E+10); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "12340000000.0"); - - end = join::dtoa (beg, 1.234E-10); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "1.234e-10"); - - end = join::dtoa (beg, 1.79769e+308); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "1.79769e308"); - - end = join::dtoa (beg, 2.22507e-308); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "2.22507e-308"); - - end = join::dtoa (beg, -1.79769e+308); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "-1.79769e308"); - - end = join::dtoa (beg, -2.22507e-308); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "-2.22507e-308"); - - end = join::dtoa (beg, -4.9406564584124654e-324); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "-5e-324"); - - end = join::dtoa (beg, 2.2250738585072009e-308); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "2.225073858507201e-308"); - - end = join::dtoa (beg, 2.2250738585072014e-308); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "2.2250738585072014e-308"); - - end = join::dtoa (beg, 1.7976931348623157e+308); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "1.7976931348623157e308"); - - end = join::dtoa (beg, 18446744073709551616.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "18446744073709552000.0"); - - end = join::dtoa (beg, -9223372036854775809.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "-9223372036854776000.0"); - - end = join::dtoa (beg, 0.9868011474609375); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "0.9868011474609375"); - - end = join::dtoa (beg, 123e34); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "1.23e36"); - - end = join::dtoa (beg, 45913141877270640000.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "45913141877270640000.0"); - - end = join::dtoa (beg, 2.2250738585072011e-308); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "2.225073858507201e-308"); - - end = join::dtoa (beg, 72057594037927928.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "72057594037927930.0"); - - end = join::dtoa (beg, 72057594037927936.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "72057594037927940.0"); - - end = join::dtoa (beg, 72057594037927936.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "72057594037927940.0"); - - end = join::dtoa (beg, 9223372036854774784.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "9223372036854775000.0"); - - end = join::dtoa (beg, 9223372036854775808.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "9223372036854776000.0"); - - end = join::dtoa (beg, 10141204801825834086073718800384.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "1.0141204801825834e31"); - - end = join::dtoa (beg, 10141204801825835211973625643008.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "1.0141204801825835e31"); - - end = join::dtoa (beg, 5708990770823838890407843763683279797179383808.0); - ASSERT_NE (end, nullptr); - EXPECT_STREQ (std::string (beg, end - beg).c_str (), "5.708990770823839e45"); -} - -/** - * @brief main function. - */ -int main (int argc, char** argv) -{ - testing::InitGoogleTest (&argc, argv); - return RUN_ALL_TESTS (); -} diff --git a/data/tests/stream_probe_test.cpp b/data/tests/stream_probe_test.cpp deleted file mode 100644 index 5589abde..00000000 --- a/data/tests/stream_probe_test.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/** - * MIT License - * - * Copyright (c) 2021 Mathieu Rabine - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -// libjoin. -#include - -// libraries. -#include - -// C++. -#include - -using join::StringStreamProbe; - -/** - * @brief create test. - */ -TEST (StreamProbe, create) -{ - std::stringstream msg ("hello world"); - StringStreamProbe probe (msg); - - ASSERT_NE (probe.peek (), std::char_traits::eof ()); -} - -/** - * @brief peek test. - */ -TEST (StreamProbe, peek) -{ - std::stringstream msg ("hello world"); - StringStreamProbe probe (msg); - - ASSERT_EQ (probe.peek (), 'h'); - ASSERT_EQ (probe.get (), 'h'); - ASSERT_EQ (probe.peek (), 'e'); - ASSERT_EQ (probe.get (), 'e'); - ASSERT_EQ (probe.peek (), 'l'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.peek (), 'l'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.peek (), 'o'); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.peek (), ' '); - ASSERT_EQ (probe.get (), ' '); - ASSERT_EQ (probe.peek (), 'w'); - ASSERT_EQ (probe.get (), 'w'); - ASSERT_EQ (probe.peek (), 'o'); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.peek (), 'r'); - ASSERT_EQ (probe.get (), 'r'); - ASSERT_EQ (probe.peek (), 'l'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.peek (), 'd'); - ASSERT_EQ (probe.get (), 'd'); - ASSERT_EQ (probe.peek (), std::char_traits::eof ()); -} - -/** - * @brief get test. - */ -TEST (StreamProbe, get) -{ - std::stringstream msg ("hello world"); - StringStreamProbe probe (msg); - - ASSERT_EQ (probe.get (), 'h'); - ASSERT_EQ (probe.get (), 'e'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.get (), ' '); - ASSERT_EQ (probe.get (), 'w'); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.get (), 'r'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.get (), 'd'); - ASSERT_EQ (probe.get (), std::char_traits::eof ()); -} - -/** - * @brief getIf test. - */ -TEST (StreamProbe, getIf) -{ - std::stringstream msg ("hello world"); - StringStreamProbe probe (msg); - - ASSERT_FALSE (probe.getIf ('X')); - ASSERT_FALSE (probe.getIf ('x')); - ASSERT_FALSE (probe.getIf ('H')); - ASSERT_TRUE (probe.getIf ('h')); - ASSERT_FALSE (probe.getIf ('E')); - ASSERT_TRUE (probe.getIf ('e')); -} - -/** - * @brief getIfNoCase test. - */ -TEST (StreamProbe, getIfNoCase) -{ - std::stringstream msg ("hello world"); - StringStreamProbe probe (msg); - - ASSERT_FALSE (probe.getIfNoCase ('x')); - ASSERT_FALSE (probe.getIfNoCase ('X')); - ASSERT_TRUE (probe.getIfNoCase ('h')); - ASSERT_TRUE (probe.getIfNoCase ('E')); - ASSERT_TRUE (probe.getIfNoCase ('l')); - ASSERT_TRUE (probe.getIfNoCase ('L')); -} - -/** - * @brief read test. - */ -TEST (StreamProbe, read) -{ - std::stringstream msg ("hello world"); - StringStreamProbe probe (msg); - char buf[8] = {}; - - ASSERT_EQ (probe.read (buf, 5), 5); - ASSERT_EQ (probe.read (buf, 8), 6); - ASSERT_EQ (probe.read (buf, 8), 0); -} - -/** - * @brief readUntilEscaped test. - */ -TEST (StreamProbe, readUntilEscaped) -{ - std::stringstream msg ("hello\"world"); - StringStreamProbe probe (msg); - std::string out; - - probe.readUntilEscaped (out); - ASSERT_EQ (out, "hello"); - ASSERT_EQ (probe.peek (), '"'); -} - -/** - * @brief skipWhitespaces test. - */ -TEST (StreamProbe, skipWhitespaces) -{ - std::stringstream msg (" hello"); - StringStreamProbe probe (msg); - std::string out; - - probe.skipWhitespaces (); - ASSERT_EQ (probe.peek (), 'h'); -} - -/** - * @brief skipWhitespacesAndComments test. - */ -TEST (StreamProbe, skipWhitespacesAndComments) -{ - std::stringstream msg (" // comment\nhello"); - StringStreamProbe probe1 (msg); - ASSERT_EQ (probe1.skipWhitespacesAndComments (), 0); - ASSERT_EQ (probe1.peek (), 'h'); - - msg.str (" /* comment */hello"); - msg.clear (); - StringStreamProbe probe2 (msg); - ASSERT_EQ (probe2.skipWhitespacesAndComments (), 0); - ASSERT_EQ (probe2.peek (), 'h'); - - msg.str ("// comment"); - msg.clear (); - StringStreamProbe probe3 (msg); - ASSERT_EQ (probe3.skipWhitespacesAndComments (), 0); - ASSERT_EQ (probe3.peek (), std::char_traits::eof ()); - - msg.str ("/* comment */"); - msg.clear (); - StringStreamProbe probe4 (msg); - ASSERT_EQ (probe4.skipWhitespacesAndComments (), 0); - ASSERT_EQ (probe4.peek (), std::char_traits::eof ()); - - msg.str ("/"); - msg.clear (); - StringStreamProbe probe5 (msg); - ASSERT_EQ (probe5.skipWhitespacesAndComments (), -1); - - msg.str ("/*"); - msg.clear (); - StringStreamProbe probe6 (msg); - ASSERT_EQ (probe6.skipWhitespacesAndComments (), -1); - - msg.str ("/!"); - msg.clear (); - StringStreamProbe probe7 (msg); - ASSERT_EQ (probe7.skipWhitespacesAndComments (), -1); -} - -/** - * @brief tell test. - */ -TEST (StreamProbe, tell) -{ - std::stringstream msg ("hello world"); - StringStreamProbe probe (msg); - auto beg = probe.tell (); - - ASSERT_EQ (probe.get (), 'h'); - ASSERT_EQ (probe.tell (), beg + std::streamoff (1)); - ASSERT_EQ (probe.get (), 'e'); - ASSERT_EQ (probe.tell (), beg + std::streamoff (2)); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.tell (), beg + std::streamoff (3)); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.tell (), beg + std::streamoff (4)); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.tell (), beg + std::streamoff (5)); - ASSERT_EQ (probe.get (), ' '); - ASSERT_EQ (probe.tell (), beg + std::streamoff (6)); - ASSERT_EQ (probe.get (), 'w'); - ASSERT_EQ (probe.tell (), beg + std::streamoff (7)); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.tell (), beg + std::streamoff (8)); - ASSERT_EQ (probe.get (), 'r'); - ASSERT_EQ (probe.tell (), beg + std::streamoff (9)); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.tell (), beg + std::streamoff (10)); - ASSERT_EQ (probe.get (), 'd'); - ASSERT_EQ (probe.tell (), beg + std::streamoff (11)); -} - -/** - * @brief seek test. - */ -TEST (StreamProbe, seek) -{ - std::stringstream msg ("hello world"); - StringStreamProbe probe (msg); - - ASSERT_EQ (probe.get (), 'h'); - ASSERT_EQ (probe.get (), 'e'); - ASSERT_EQ (probe.get (), 'l'); - probe.seek (probe.tell () - std::streamoff (2)); - ASSERT_EQ (probe.get (), 'e'); - ASSERT_EQ (probe.get (), 'l'); -} - -/** - * @brief main function. - */ -int main (int argc, char** argv) -{ - testing::InitGoogleTest (&argc, argv); - return RUN_ALL_TESTS (); -} diff --git a/data/tests/string_probe_test.cpp b/data/tests/string_probe_test.cpp deleted file mode 100644 index 4c63e7c2..00000000 --- a/data/tests/string_probe_test.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/** - * MIT License - * - * Copyright (c) 2021 Mathieu Rabine - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -// libjoin. -#include - -// libraries. -#include - -// C++. -#include - -using join::StringProbe; - -/** - * @brief create test. - */ -TEST (StringProbe, create) -{ - char msg[] = "hello world"; - - StringProbe probe1 (msg); - ASSERT_NE (probe1.peek (), std::char_traits::eof ()); - - StringProbe probe2 (msg, sizeof (msg) - 1); - ASSERT_NE (probe2.peek (), std::char_traits::eof ()); - - StringProbe probe3 (msg, msg + sizeof (msg) - 1); - ASSERT_NE (probe3.peek (), std::char_traits::eof ()); -} - -/** - * @brief peek test. - */ -TEST (StringProbe, peek) -{ - StringProbe probe ("hello world"); - - ASSERT_EQ (probe.peek (), 'h'); - ASSERT_EQ (probe.get (), 'h'); - ASSERT_EQ (probe.peek (), 'e'); - ASSERT_EQ (probe.get (), 'e'); - ASSERT_EQ (probe.peek (), 'l'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.peek (), 'l'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.peek (), 'o'); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.peek (), ' '); - ASSERT_EQ (probe.get (), ' '); - ASSERT_EQ (probe.peek (), 'w'); - ASSERT_EQ (probe.get (), 'w'); - ASSERT_EQ (probe.peek (), 'o'); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.peek (), 'r'); - ASSERT_EQ (probe.get (), 'r'); - ASSERT_EQ (probe.peek (), 'l'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.peek (), 'd'); - ASSERT_EQ (probe.get (), 'd'); - ASSERT_EQ (probe.peek (), std::char_traits::eof ()); -} - -/** - * @brief get test. - */ -TEST (StringProbe, get) -{ - StringProbe probe ("hello world"); - - ASSERT_EQ (probe.get (), 'h'); - ASSERT_EQ (probe.get (), 'e'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.get (), ' '); - ASSERT_EQ (probe.get (), 'w'); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.get (), 'r'); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.get (), 'd'); - ASSERT_EQ (probe.get (), std::char_traits::eof ()); -} - -/** - * @brief getIf test. - */ -TEST (StringProbe, getIf) -{ - StringProbe probe ("hello world"); - - ASSERT_FALSE (probe.getIf ('X')); - ASSERT_FALSE (probe.getIf ('x')); - ASSERT_FALSE (probe.getIf ('H')); - ASSERT_TRUE (probe.getIf ('h')); - ASSERT_FALSE (probe.getIf ('E')); - ASSERT_TRUE (probe.getIf ('e')); -} - -/** - * @brief getIfNoCase test. - */ -TEST (StringProbe, getIfNoCase) -{ - StringProbe probe ("hello world"); - - ASSERT_FALSE (probe.getIfNoCase ('x')); - ASSERT_FALSE (probe.getIfNoCase ('X')); - ASSERT_TRUE (probe.getIfNoCase ('h')); - ASSERT_TRUE (probe.getIfNoCase ('E')); - ASSERT_TRUE (probe.getIfNoCase ('l')); - ASSERT_TRUE (probe.getIfNoCase ('L')); -} - -/** - * @brief read test. - */ -TEST (StringProbe, read) -{ - StringProbe probe ("hello world"); - char buf[8] = {}; - - ASSERT_EQ (probe.read (buf, 5), 5); - ASSERT_EQ (probe.read (buf, 8), 6); - ASSERT_EQ (probe.read (buf, 8), 0); -} - -/** - * @brief readUntilEscaped test. - */ -TEST (StringProbe, readUntilEscaped) -{ - StringProbe probe ("hello\"world"); - std::string out; - - probe.readUntilEscaped (out); - ASSERT_EQ (out, "hello"); - ASSERT_EQ (probe.peek (), '"'); -} - -/** - * @brief skipWhitespaces test. - */ -TEST (StringProbe, skipWhitespaces) -{ - StringProbe probe (" hello"); - - probe.skipWhitespaces (); - ASSERT_EQ (probe.peek (), 'h'); -} - -/** - * @brief skipWhitespacesAndComments test. - */ -TEST (StringProbe, skipWhitespacesAndComments) -{ - StringProbe probe (" // comment\nhello"); - ASSERT_EQ (probe.skipWhitespacesAndComments (), 0); - ASSERT_EQ (probe.peek (), 'h'); - - probe = " /* comment */hello"; - ASSERT_EQ (probe.skipWhitespacesAndComments (), 0); - ASSERT_EQ (probe.peek (), 'h'); - - probe = "// comment"; - ASSERT_EQ (probe.skipWhitespacesAndComments (), 0); - ASSERT_EQ (probe.peek (), std::char_traits::eof ()); - - probe = "/* comment */"; - ASSERT_EQ (probe.skipWhitespacesAndComments (), 0); - ASSERT_EQ (probe.peek (), std::char_traits::eof ()); - - probe = "/"; - ASSERT_EQ (probe.skipWhitespacesAndComments (), -1); - - probe = "/*"; - ASSERT_EQ (probe.skipWhitespacesAndComments (), -1); - - probe = "/!"; - ASSERT_EQ (probe.skipWhitespacesAndComments (), -1); -} - -/** - * @brief tell test. - */ -TEST (StringProbe, tell) -{ - StringProbe probe ("hello world"); - auto beg = probe.tell (); - - ASSERT_EQ (probe.get (), 'h'); - ASSERT_EQ (probe.tell (), beg + 1); - ASSERT_EQ (probe.get (), 'e'); - ASSERT_EQ (probe.tell (), beg + 2); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.tell (), beg + 3); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.tell (), beg + 4); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.tell (), beg + 5); - ASSERT_EQ (probe.get (), ' '); - ASSERT_EQ (probe.tell (), beg + 6); - ASSERT_EQ (probe.get (), 'w'); - ASSERT_EQ (probe.tell (), beg + 7); - ASSERT_EQ (probe.get (), 'o'); - ASSERT_EQ (probe.tell (), beg + 8); - ASSERT_EQ (probe.get (), 'r'); - ASSERT_EQ (probe.tell (), beg + 9); - ASSERT_EQ (probe.get (), 'l'); - ASSERT_EQ (probe.tell (), beg + 10); - ASSERT_EQ (probe.get (), 'd'); - ASSERT_EQ (probe.tell (), beg + 11); -} - -/** - * @brief seek test. - */ -TEST (StringProbe, seek) -{ - StringProbe probe ("hello world"); - - ASSERT_EQ (probe.get (), 'h'); - probe.seek (probe.tell () - 10000); - ASSERT_EQ (probe.get (), 'h'); - ASSERT_EQ (probe.get (), 'e'); - ASSERT_EQ (probe.get (), 'l'); - probe.seek (probe.tell () - 2); - ASSERT_EQ (probe.get (), 'e'); - ASSERT_EQ (probe.get (), 'l'); - probe.seek (probe.tell () + 10000); - ASSERT_EQ (probe.get (), std::char_traits::eof ()); -} - -/** - * @brief main function. - */ -int main (int argc, char** argv) -{ - testing::InitGoogleTest (&argc, argv); - return RUN_ALL_TESTS (); -}