react-native-windows 0.85.0-preview.1 → 0.85.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Directory.Build.props +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +28 -46
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +0 -3
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +19 -13
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +107 -0
- package/Microsoft.ReactNative/Fabric/Composition/SelectionItemAutomationEvent.h +73 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +105 -32
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +7 -2
- package/PropertySheets/CIBuildOptimizations.props +2 -2
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/PropertySheets/JSEngine.props +1 -1
- package/PropertySheets/NuGet.LockFile.props +2 -9
- package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +54 -5
- package/Scripts/UpdateNightlyDependencies.ps1 +47 -0
- package/Scripts/creaternwapp.cmd +29 -9
- package/Scripts/creaternwlib.cmd +31 -15
- package/external/.clang-format +1 -0
- package/external/External.vcxitems +10 -0
- package/external/fast-float/.syncignore +10 -0
- package/external/fast-float/LICENSE-APACHE +190 -0
- package/external/fast-float/LICENSE-BOOST +23 -0
- package/external/fast-float/LICENSE-MIT +27 -0
- package/external/fast-float/README.md +545 -0
- package/external/fast-float/cgmanifest.json +15 -0
- package/external/fast-float/fast-float.vcxitems +14 -0
- package/external/fast-float/include/fast_float/ascii_number.h +588 -0
- package/external/fast-float/include/fast_float/bigint.h +638 -0
- package/external/fast-float/include/fast_float/constexpr_feature_detect.h +46 -0
- package/external/fast-float/include/fast_float/decimal_to_binary.h +212 -0
- package/external/fast-float/include/fast_float/digit_comparison.h +457 -0
- package/external/fast-float/include/fast_float/fast_float.h +59 -0
- package/external/fast-float/include/fast_float/fast_table.h +708 -0
- package/external/fast-float/include/fast_float/float_common.h +1240 -0
- package/external/fast-float/include/fast_float/parse_number.h +399 -0
- package/external/fast-float/sync-config.json +8 -0
- package/external/fmt/.syncignore +10 -0
- package/external/fmt/CONTRIBUTING.md +20 -0
- package/external/fmt/LICENSE +27 -0
- package/external/fmt/README.md +484 -0
- package/external/fmt/cgmanifest.json +15 -0
- package/external/fmt/doc/ChangeLog-old.md +3290 -0
- package/external/fmt/doc/api.md +650 -0
- package/external/fmt/doc/fmt.css +61 -0
- package/external/fmt/doc/fmt.js +4 -0
- package/external/fmt/doc/get-started.md +222 -0
- package/external/fmt/doc/index.md +151 -0
- package/external/fmt/doc/perf.svg +1 -0
- package/external/fmt/doc/python-license.txt +290 -0
- package/external/fmt/doc/syntax.md +887 -0
- package/external/fmt/fmt.vcxitems +28 -0
- package/external/fmt/include/fmt/args.h +228 -0
- package/external/fmt/include/fmt/base.h +3077 -0
- package/external/fmt/include/fmt/chrono.h +2432 -0
- package/external/fmt/include/fmt/color.h +612 -0
- package/external/fmt/include/fmt/compile.h +529 -0
- package/external/fmt/include/fmt/core.h +5 -0
- package/external/fmt/include/fmt/format-inl.h +1928 -0
- package/external/fmt/include/fmt/format.h +4427 -0
- package/external/fmt/include/fmt/os.h +439 -0
- package/external/fmt/include/fmt/ostream.h +211 -0
- package/external/fmt/include/fmt/printf.h +656 -0
- package/external/fmt/include/fmt/ranges.h +882 -0
- package/external/fmt/include/fmt/std.h +699 -0
- package/external/fmt/include/fmt/xchar.h +322 -0
- package/external/fmt/src/fmt.cc +135 -0
- package/external/fmt/src/format.cc +43 -0
- package/external/fmt/src/os.cc +403 -0
- package/external/fmt/sync-config.json +8 -0
- package/external/folly/.syncignore +60 -0
- package/external/folly/Folly.natvis +25 -0
- package/external/folly/LICENSE +200 -0
- package/external/folly/README.md +263 -0
- package/external/folly/cgmanifest.json +25 -0
- package/external/folly/folly/.clang-format +1 -0
- package/external/folly/folly/AtomicHashArray-inl.h +546 -0
- package/external/folly/folly/AtomicHashArray.h +431 -0
- package/external/folly/folly/AtomicHashMap-inl.h +653 -0
- package/external/folly/folly/AtomicHashMap.h +484 -0
- package/external/folly/folly/AtomicIntrusiveLinkedList.h +206 -0
- package/external/folly/folly/AtomicLinkedList.h +110 -0
- package/external/folly/folly/AtomicUnorderedMap.h +522 -0
- package/external/folly/folly/BUCK +1631 -0
- package/external/folly/folly/BUILD_MODE.bzl +72 -0
- package/external/folly/folly/Benchmark.cpp +986 -0
- package/external/folly/folly/Benchmark.h +680 -0
- package/external/folly/folly/BenchmarkUtil.h +47 -0
- package/external/folly/folly/Bits.h +17 -0
- package/external/folly/folly/CMakeLists.txt +110 -0
- package/external/folly/folly/CPortability.h +338 -0
- package/external/folly/folly/CancellationToken-inl.h +449 -0
- package/external/folly/folly/CancellationToken.cpp +250 -0
- package/external/folly/folly/CancellationToken.h +365 -0
- package/external/folly/folly/Chrono.h +132 -0
- package/external/folly/folly/ClockGettimeWrappers.cpp +93 -0
- package/external/folly/folly/ClockGettimeWrappers.h +29 -0
- package/external/folly/folly/ConcurrentBitSet.h +157 -0
- package/external/folly/folly/ConcurrentLazy.h +74 -0
- package/external/folly/folly/ConcurrentSkipList-inl.h +341 -0
- package/external/folly/folly/ConcurrentSkipList.h +824 -0
- package/external/folly/folly/ConstexprMath.h +978 -0
- package/external/folly/folly/ConstructorCallbackList.h +158 -0
- package/external/folly/folly/Conv.cpp +1205 -0
- package/external/folly/folly/Conv.h +2026 -0
- package/external/folly/folly/CppAttributes.h +170 -0
- package/external/folly/folly/CpuId.h +297 -0
- package/external/folly/folly/DefaultKeepAliveExecutor.h +172 -0
- package/external/folly/folly/Demangle.cpp +255 -0
- package/external/folly/folly/Demangle.h +73 -0
- package/external/folly/folly/DiscriminatedPtr.h +236 -0
- package/external/folly/folly/DynamicConverter.h +17 -0
- package/external/folly/folly/Exception.h +150 -0
- package/external/folly/folly/ExceptionString.cpp +51 -0
- package/external/folly/folly/ExceptionString.h +33 -0
- package/external/folly/folly/ExceptionWrapper-inl.h +264 -0
- package/external/folly/folly/ExceptionWrapper.cpp +37 -0
- package/external/folly/folly/ExceptionWrapper.h +377 -0
- package/external/folly/folly/Executor.cpp +111 -0
- package/external/folly/folly/Executor.h +351 -0
- package/external/folly/folly/Expected.h +1725 -0
- package/external/folly/folly/FBString.h +2888 -0
- package/external/folly/folly/FBVector.h +17 -0
- package/external/folly/folly/File.cpp +180 -0
- package/external/folly/folly/File.h +177 -0
- package/external/folly/folly/FileUtil.cpp +378 -0
- package/external/folly/folly/FileUtil.h +332 -0
- package/external/folly/folly/Fingerprint.cpp +135 -0
- package/external/folly/folly/Fingerprint.h +289 -0
- package/external/folly/folly/FixedString.h +2965 -0
- package/external/folly/folly/FollyMemcpy.cpp +30 -0
- package/external/folly/folly/FollyMemcpy.h +23 -0
- package/external/folly/folly/FollyMemset.cpp +29 -0
- package/external/folly/folly/FollyMemset.h +25 -0
- package/external/folly/folly/Format-inl.h +1152 -0
- package/external/folly/folly/Format.cpp +429 -0
- package/external/folly/folly/Format.h +463 -0
- package/external/folly/folly/FormatArg.h +285 -0
- package/external/folly/folly/FormatTraits.h +65 -0
- package/external/folly/folly/Function.h +1159 -0
- package/external/folly/folly/GLog.h +85 -0
- package/external/folly/folly/GroupVarint.cpp +153 -0
- package/external/folly/folly/GroupVarint.h +630 -0
- package/external/folly/folly/Hash.h +20 -0
- package/external/folly/folly/IPAddress.cpp +490 -0
- package/external/folly/folly/IPAddress.h +667 -0
- package/external/folly/folly/IPAddressException.h +82 -0
- package/external/folly/folly/IPAddressV4.cpp +305 -0
- package/external/folly/folly/IPAddressV4.h +495 -0
- package/external/folly/folly/IPAddressV6.cpp +541 -0
- package/external/folly/folly/IPAddressV6.h +627 -0
- package/external/folly/folly/Indestructible.h +164 -0
- package/external/folly/folly/IndexedMemPool.h +550 -0
- package/external/folly/folly/IntrusiveList.h +17 -0
- package/external/folly/folly/Lazy.h +142 -0
- package/external/folly/folly/Likely.h +76 -0
- package/external/folly/folly/MPMCPipeline.h +280 -0
- package/external/folly/folly/MPMCQueue.h +1556 -0
- package/external/folly/folly/MacAddress.cpp +188 -0
- package/external/folly/folly/MacAddress.h +260 -0
- package/external/folly/folly/MapUtil.h +17 -0
- package/external/folly/folly/Math.h +258 -0
- package/external/folly/folly/MaybeManagedPtr.h +120 -0
- package/external/folly/folly/Memory.h +900 -0
- package/external/folly/folly/MicroLock.cpp +76 -0
- package/external/folly/folly/MicroLock.h +354 -0
- package/external/folly/folly/MicroSpinLock.h +17 -0
- package/external/folly/folly/MoveWrapper.h +76 -0
- package/external/folly/folly/ObserverContainer.h +1026 -0
- package/external/folly/folly/Optional.h +743 -0
- package/external/folly/folly/Overload.h +325 -0
- package/external/folly/folly/PackedSyncPtr.h +147 -0
- package/external/folly/folly/Padded.h +464 -0
- package/external/folly/folly/Poly-inl.h +230 -0
- package/external/folly/folly/Poly.h +1095 -0
- package/external/folly/folly/PolyException.h +43 -0
- package/external/folly/folly/Portability.h +644 -0
- package/external/folly/folly/Preprocessor.h +236 -0
- package/external/folly/folly/ProducerConsumerQueue.h +182 -0
- package/external/folly/folly/RWSpinLock.h +17 -0
- package/external/folly/folly/Random-inl.h +86 -0
- package/external/folly/folly/Random.cpp +184 -0
- package/external/folly/folly/Random.h +434 -0
- package/external/folly/folly/Range.h +1772 -0
- package/external/folly/folly/Replaceable.h +636 -0
- package/external/folly/folly/ScopeGuard.cpp +29 -0
- package/external/folly/folly/ScopeGuard.h +420 -0
- package/external/folly/folly/SharedMutex.cpp +81 -0
- package/external/folly/folly/SharedMutex.h +1751 -0
- package/external/folly/folly/Singleton-inl.h +332 -0
- package/external/folly/folly/Singleton.cpp +512 -0
- package/external/folly/folly/Singleton.h +891 -0
- package/external/folly/folly/SingletonThreadLocal.cpp +53 -0
- package/external/folly/folly/SingletonThreadLocal.h +263 -0
- package/external/folly/folly/SocketAddress.cpp +786 -0
- package/external/folly/folly/SocketAddress.h +768 -0
- package/external/folly/folly/SpinLock.h +55 -0
- package/external/folly/folly/String-inl.h +668 -0
- package/external/folly/folly/String.cpp +777 -0
- package/external/folly/folly/String.h +767 -0
- package/external/folly/folly/Subprocess.cpp +1142 -0
- package/external/folly/folly/Subprocess.h +1055 -0
- package/external/folly/folly/Synchronized.h +1833 -0
- package/external/folly/folly/SynchronizedPtr.h +106 -0
- package/external/folly/folly/ThreadCachedInt.h +175 -0
- package/external/folly/folly/ThreadLocal.h +478 -0
- package/external/folly/folly/TimeoutQueue.cpp +78 -0
- package/external/folly/folly/TimeoutQueue.h +123 -0
- package/external/folly/folly/TokenBucket.h +673 -0
- package/external/folly/folly/Traits.h +1442 -0
- package/external/folly/folly/Try-inl.h +372 -0
- package/external/folly/folly/Try.cpp +23 -0
- package/external/folly/folly/Try.h +728 -0
- package/external/folly/folly/UTF8String.h +56 -0
- package/external/folly/folly/Unicode.cpp +201 -0
- package/external/folly/folly/Unicode.h +94 -0
- package/external/folly/folly/Unit.h +65 -0
- package/external/folly/folly/Uri-inl.h +101 -0
- package/external/folly/folly/Uri.cpp +190 -0
- package/external/folly/folly/Uri.h +142 -0
- package/external/folly/folly/Utility.h +932 -0
- package/external/folly/folly/VERSION +1 -0
- package/external/folly/folly/Varint.h +230 -0
- package/external/folly/folly/VirtualExecutor.h +17 -0
- package/external/folly/folly/algorithm/simd/BUCK +47 -0
- package/external/folly/folly/algorithm/simd/Contains.cpp +42 -0
- package/external/folly/folly/algorithm/simd/Contains.h +116 -0
- package/external/folly/folly/algorithm/simd/FindFixed.h +301 -0
- package/external/folly/folly/algorithm/simd/Ignore.h +52 -0
- package/external/folly/folly/algorithm/simd/Movemask.h +207 -0
- package/external/folly/folly/algorithm/simd/detail/BUCK +70 -0
- package/external/folly/folly/algorithm/simd/detail/ContainsImpl.h +91 -0
- package/external/folly/folly/algorithm/simd/detail/SimdAnyOf.h +83 -0
- package/external/folly/folly/algorithm/simd/detail/SimdForEach.h +209 -0
- package/external/folly/folly/algorithm/simd/detail/SimdPlatform.h +445 -0
- package/external/folly/folly/algorithm/simd/detail/Traits.h +125 -0
- package/external/folly/folly/algorithm/simd/detail/UnrollUtils.h +126 -0
- package/external/folly/folly/base64.h +264 -0
- package/external/folly/folly/chrono/BUCK +29 -0
- package/external/folly/folly/chrono/Clock.h +65 -0
- package/external/folly/folly/chrono/Conv.h +712 -0
- package/external/folly/folly/chrono/Hardware.h +155 -0
- package/external/folly/folly/chrono/test/BUCK +26 -0
- package/external/folly/folly/chrono/test/ClockTest.cpp +68 -0
- package/external/folly/folly/chrono/test/ConvTest.cpp +652 -0
- package/external/folly/folly/concurrency/AtomicSharedPtr.h +387 -0
- package/external/folly/folly/concurrency/BUCK +170 -0
- package/external/folly/folly/concurrency/CacheLocality.cpp +633 -0
- package/external/folly/folly/concurrency/CacheLocality.h +460 -0
- package/external/folly/folly/concurrency/ConcurrentHashMap.h +822 -0
- package/external/folly/folly/concurrency/CoreCachedSharedPtr.h +232 -0
- package/external/folly/folly/concurrency/DeadlockDetector.cpp +27 -0
- package/external/folly/folly/concurrency/DeadlockDetector.h +44 -0
- package/external/folly/folly/concurrency/DynamicBoundedQueue.h +751 -0
- package/external/folly/folly/concurrency/PriorityUnboundedQueueSet.h +207 -0
- package/external/folly/folly/concurrency/ProcessLocalUniqueId.cpp +46 -0
- package/external/folly/folly/concurrency/ProcessLocalUniqueId.h +38 -0
- package/external/folly/folly/concurrency/SingletonRelaxedCounter.h +325 -0
- package/external/folly/folly/concurrency/ThreadCachedSynchronized.h +227 -0
- package/external/folly/folly/concurrency/UnboundedQueue.h +891 -0
- package/external/folly/folly/concurrency/container/BUCK +77 -0
- package/external/folly/folly/concurrency/container/FlatCombiningPriorityQueue.h +426 -0
- package/external/folly/folly/concurrency/container/LockFreeRingBuffer.h +306 -0
- package/external/folly/folly/concurrency/container/RelaxedConcurrentPriorityQueue.h +1212 -0
- package/external/folly/folly/concurrency/container/SingleWriterFixedHashMap.h +322 -0
- package/external/folly/folly/concurrency/container/atomic_grow_array.h +564 -0
- package/external/folly/folly/concurrency/container/test/BUCK +75 -0
- package/external/folly/folly/concurrency/container/test/FlatCombiningPriorityQueueTest.cpp +570 -0
- package/external/folly/folly/concurrency/container/test/LockFreeRingBufferTest.cpp +276 -0
- package/external/folly/folly/concurrency/container/test/RelaxedConcurrentPriorityQueueTest.cpp +1570 -0
- package/external/folly/folly/concurrency/container/test/SingleWriterFixedHashMapTest.cpp +401 -0
- package/external/folly/folly/concurrency/container/test/atomic_grow_array_test.cpp +187 -0
- package/external/folly/folly/concurrency/detail/AtomicSharedPtr-detail.h +212 -0
- package/external/folly/folly/concurrency/detail/ConcurrentHashMap-detail.h +1911 -0
- package/external/folly/folly/concurrency/memory/AtomicReadMostlyMainPtr.cpp +43 -0
- package/external/folly/folly/concurrency/memory/AtomicReadMostlyMainPtr.h +190 -0
- package/external/folly/folly/concurrency/memory/BUCK +53 -0
- package/external/folly/folly/concurrency/memory/PrimaryPtr.h +338 -0
- package/external/folly/folly/concurrency/memory/ReadMostlySharedPtr.h +511 -0
- package/external/folly/folly/concurrency/memory/TLRefCount.h +228 -0
- package/external/folly/folly/concurrency/memory/test/AtomicReadMostlyMainPtrBenchmark.cpp +56 -0
- package/external/folly/folly/concurrency/memory/test/AtomicReadMostlyMainPtrTest.cpp +454 -0
- package/external/folly/folly/concurrency/memory/test/BUCK +95 -0
- package/external/folly/folly/concurrency/memory/test/PrimaryPtrTest.cpp +303 -0
- package/external/folly/folly/concurrency/memory/test/ReadMostlySharedPtrBenchmark.cpp +138 -0
- package/external/folly/folly/concurrency/memory/test/ReadMostlySharedPtrStressTest.cpp +75 -0
- package/external/folly/folly/concurrency/memory/test/ReadMostlySharedPtrTest.cpp +378 -0
- package/external/folly/folly/concurrency/memory/test/RefCountBenchmark.cpp +90 -0
- package/external/folly/folly/concurrency/memory/test/RefCountTest.cpp +168 -0
- package/external/folly/folly/concurrency/test/AtomicSharedPtrCounted.h +156 -0
- package/external/folly/folly/concurrency/test/AtomicSharedPtrPerformance.cpp +255 -0
- package/external/folly/folly/concurrency/test/AtomicSharedPtrTest.cpp +257 -0
- package/external/folly/folly/concurrency/test/BUCK +229 -0
- package/external/folly/folly/concurrency/test/CacheLocalityBenchmark.cpp +392 -0
- package/external/folly/folly/concurrency/test/CacheLocalityTest.cpp +1229 -0
- package/external/folly/folly/concurrency/test/ConcurrentHashMapBench.cpp +260 -0
- package/external/folly/folly/concurrency/test/ConcurrentHashMapTest.cpp +1242 -0
- package/external/folly/folly/concurrency/test/CoreCachedSharedPtrTest.cpp +408 -0
- package/external/folly/folly/concurrency/test/DynamicBoundedQueueTest.cpp +984 -0
- package/external/folly/folly/concurrency/test/PriorityUnboundedQueueSetTest.cpp +73 -0
- package/external/folly/folly/concurrency/test/ProcessLocalUniqueIdTest.cpp +66 -0
- package/external/folly/folly/concurrency/test/SingletonRelaxedCounterBench.cpp +101 -0
- package/external/folly/folly/concurrency/test/SingletonRelaxedCounterTest.cpp +185 -0
- package/external/folly/folly/concurrency/test/ThreadCachedSynchronizedBench.cpp +76 -0
- package/external/folly/folly/concurrency/test/ThreadCachedSynchronizedTest.cpp +93 -0
- package/external/folly/folly/concurrency/test/UnboundedQueueTest.cpp +1302 -0
- package/external/folly/folly/container/Access.h +57 -0
- package/external/folly/folly/container/Array.h +87 -0
- package/external/folly/folly/container/BUCK +353 -0
- package/external/folly/folly/container/BitIterator.h +203 -0
- package/external/folly/folly/container/Enumerate.h +162 -0
- package/external/folly/folly/container/EvictingCacheMap.h +730 -0
- package/external/folly/folly/container/F14.md +300 -0
- package/external/folly/folly/container/F14Map-fwd.h +113 -0
- package/external/folly/folly/container/F14Map.h +2108 -0
- package/external/folly/folly/container/F14Set-fwd.h +95 -0
- package/external/folly/folly/container/F14Set.h +1603 -0
- package/external/folly/folly/container/FBVector.h +1711 -0
- package/external/folly/folly/container/Foreach-inl.h +316 -0
- package/external/folly/folly/container/Foreach.h +209 -0
- package/external/folly/folly/container/HeterogeneousAccess-fwd.h +33 -0
- package/external/folly/folly/container/HeterogeneousAccess.h +171 -0
- package/external/folly/folly/container/IntrusiveHeap.h +268 -0
- package/external/folly/folly/container/IntrusiveList.h +131 -0
- package/external/folly/folly/container/Iterator.h +843 -0
- package/external/folly/folly/container/MapUtil.h +376 -0
- package/external/folly/folly/container/Merge.h +90 -0
- package/external/folly/folly/container/RegexMatchCache.cpp +521 -0
- package/external/folly/folly/container/RegexMatchCache.h +699 -0
- package/external/folly/folly/container/Reserve.h +109 -0
- package/external/folly/folly/container/SparseByteSet.h +123 -0
- package/external/folly/folly/container/View.h +81 -0
- package/external/folly/folly/container/WeightedEvictingCacheMap.h +651 -0
- package/external/folly/folly/container/detail/BUCK +115 -0
- package/external/folly/folly/container/detail/BitIteratorDetail.h +87 -0
- package/external/folly/folly/container/detail/F14Defaults.h +34 -0
- package/external/folly/folly/container/detail/F14IntrinsicsAvailability.h +67 -0
- package/external/folly/folly/container/detail/F14MapFallback.h +717 -0
- package/external/folly/folly/container/detail/F14Mask.h +235 -0
- package/external/folly/folly/container/detail/F14Policy.h +1523 -0
- package/external/folly/folly/container/detail/F14SetFallback.h +528 -0
- package/external/folly/folly/container/detail/F14Table.cpp +71 -0
- package/external/folly/folly/container/detail/F14Table.h +2680 -0
- package/external/folly/folly/container/detail/Util.h +303 -0
- package/external/folly/folly/container/detail/tape_detail.h +135 -0
- package/external/folly/folly/container/detail/test/BUCK +14 -0
- package/external/folly/folly/container/detail/test/F14DetailTest.cpp +47 -0
- package/external/folly/folly/container/heap_vector_types.h +1683 -0
- package/external/folly/folly/container/range_traits.h +81 -0
- package/external/folly/folly/container/small_vector.h +1476 -0
- package/external/folly/folly/container/sorted_vector_types.h +1652 -0
- package/external/folly/folly/container/span.h +408 -0
- package/external/folly/folly/container/tape.h +608 -0
- package/external/folly/folly/container/test/.clang-tidy +12 -0
- package/external/folly/folly/container/test/AccessTest.cpp +138 -0
- package/external/folly/folly/container/test/ArrayTest.cpp +84 -0
- package/external/folly/folly/container/test/BUCK +568 -0
- package/external/folly/folly/container/test/BitIteratorBench.cpp +112 -0
- package/external/folly/folly/container/test/BitIteratorTest.cpp +109 -0
- package/external/folly/folly/container/test/EnumerateTest.cpp +294 -0
- package/external/folly/folly/container/test/EvictingCacheMapBench.cpp +80 -0
- package/external/folly/folly/container/test/EvictingCacheMapTest.cpp +842 -0
- package/external/folly/folly/container/test/F14AsanSupportTest.cpp +143 -0
- package/external/folly/folly/container/test/F14FwdTest.cpp +37 -0
- package/external/folly/folly/container/test/F14InterprocessTest.cpp +404 -0
- package/external/folly/folly/container/test/F14MapTest.cpp +2543 -0
- package/external/folly/folly/container/test/F14PolicyTest.cpp +49 -0
- package/external/folly/folly/container/test/F14SetTest.cpp +1738 -0
- package/external/folly/folly/container/test/F14SmallOverheads.cpp +215 -0
- package/external/folly/folly/container/test/F14TestUtil.h +117 -0
- package/external/folly/folly/container/test/FBVectorBenchmark.cpp +380 -0
- package/external/folly/folly/container/test/FBVectorBenchmarks.cpp.h +100 -0
- package/external/folly/folly/container/test/FBVectorTest.cpp +326 -0
- package/external/folly/folly/container/test/FBVectorTests.cpp.h +304 -0
- package/external/folly/folly/container/test/ForeachBenchmark.cpp +388 -0
- package/external/folly/folly/container/test/ForeachTest.cpp +338 -0
- package/external/folly/folly/container/test/HashMapsBench.cpp +458 -0
- package/external/folly/folly/container/test/HeterogeneousAccessTest.cpp +242 -0
- package/external/folly/folly/container/test/IntrusiveHeapTest.cpp +262 -0
- package/external/folly/folly/container/test/IteratorTest.cpp +989 -0
- package/external/folly/folly/container/test/MapUtilTest.cpp +365 -0
- package/external/folly/folly/container/test/MergeTest.cpp +66 -0
- package/external/folly/folly/container/test/RegexMatchCacheTest.cpp +634 -0
- package/external/folly/folly/container/test/ReserveTest.cpp +173 -0
- package/external/folly/folly/container/test/SparseByteSetBenchmark.cpp +153 -0
- package/external/folly/folly/container/test/SparseByteSetTest.cpp +117 -0
- package/external/folly/folly/container/test/TrackingTypes.h +584 -0
- package/external/folly/folly/container/test/UtilTest.cpp +609 -0
- package/external/folly/folly/container/test/WeightedEvictingCacheMapTest.cpp +800 -0
- package/external/folly/folly/container/test/heap_vector_types_test.cpp +1774 -0
- package/external/folly/folly/container/test/range_traits_test.cpp +59 -0
- package/external/folly/folly/container/test/small_vector_test.cpp +1571 -0
- package/external/folly/folly/container/test/sorted_vector_test.cpp +1589 -0
- package/external/folly/folly/container/test/span_test.cpp +520 -0
- package/external/folly/folly/container/test/tape_bench.cpp +200 -0
- package/external/folly/folly/container/test/tape_test.cpp +590 -0
- package/external/folly/folly/defs.bzl +238 -0
- package/external/folly/folly/detail/AsyncTrace.cpp +36 -0
- package/external/folly/folly/detail/AsyncTrace.h +44 -0
- package/external/folly/folly/detail/AtomicHashUtils.h +42 -0
- package/external/folly/folly/detail/AtomicUnorderedMapUtils.h +80 -0
- package/external/folly/folly/detail/BUCK +406 -0
- package/external/folly/folly/detail/DiscriminatedPtrDetail.h +172 -0
- package/external/folly/folly/detail/FileUtilDetail.cpp +63 -0
- package/external/folly/folly/detail/FileUtilDetail.h +85 -0
- package/external/folly/folly/detail/FileUtilVectorDetail.h +81 -0
- package/external/folly/folly/detail/FingerprintPolynomial.h +132 -0
- package/external/folly/folly/detail/Futex-inl.h +123 -0
- package/external/folly/folly/detail/Futex.cpp +273 -0
- package/external/folly/folly/detail/Futex.h +109 -0
- package/external/folly/folly/detail/GroupVarintDetail.h +101 -0
- package/external/folly/folly/detail/IPAddress.cpp +37 -0
- package/external/folly/folly/detail/IPAddress.h +57 -0
- package/external/folly/folly/detail/IPAddressSource.h +278 -0
- package/external/folly/folly/detail/Iterators.h +156 -0
- package/external/folly/folly/detail/MPMCPipelineDetail.h +122 -0
- package/external/folly/folly/detail/MemoryIdler.cpp +233 -0
- package/external/folly/folly/detail/MemoryIdler.h +216 -0
- package/external/folly/folly/detail/PerfScoped.cpp +112 -0
- package/external/folly/folly/detail/PerfScoped.h +70 -0
- package/external/folly/folly/detail/PolyDetail.h +921 -0
- package/external/folly/folly/detail/RangeCommon.cpp +55 -0
- package/external/folly/folly/detail/RangeCommon.h +93 -0
- package/external/folly/folly/detail/RangeSse42.cpp +198 -0
- package/external/folly/folly/detail/RangeSse42.h +30 -0
- package/external/folly/folly/detail/SimpleSimdStringUtils.cpp +31 -0
- package/external/folly/folly/detail/SimpleSimdStringUtils.h +27 -0
- package/external/folly/folly/detail/SimpleSimdStringUtilsImpl.h +63 -0
- package/external/folly/folly/detail/Singleton.h +34 -0
- package/external/folly/folly/detail/SlowFingerprint.h +90 -0
- package/external/folly/folly/detail/SocketFastOpen.cpp +175 -0
- package/external/folly/folly/detail/SocketFastOpen.h +89 -0
- package/external/folly/folly/detail/SplitStringSimd.cpp +84 -0
- package/external/folly/folly/detail/SplitStringSimd.h +151 -0
- package/external/folly/folly/detail/SplitStringSimdImpl.h +149 -0
- package/external/folly/folly/detail/Sse.cpp +35 -0
- package/external/folly/folly/detail/Sse.h +45 -0
- package/external/folly/folly/detail/StaticSingletonManager.cpp +119 -0
- package/external/folly/folly/detail/StaticSingletonManager.h +298 -0
- package/external/folly/folly/detail/ThreadLocalDetail.cpp +492 -0
- package/external/folly/folly/detail/ThreadLocalDetail.h +800 -0
- package/external/folly/folly/detail/TrapOnAvx512.cpp +41 -0
- package/external/folly/folly/detail/TrapOnAvx512.h +21 -0
- package/external/folly/folly/detail/TurnSequencer.h +295 -0
- package/external/folly/folly/detail/TypeList.h +551 -0
- package/external/folly/folly/detail/UniqueInstance.cpp +136 -0
- package/external/folly/folly/detail/UniqueInstance.h +68 -0
- package/external/folly/folly/detail/base64_detail/BUCK +102 -0
- package/external/folly/folly/detail/base64_detail/Base64Api.cpp +40 -0
- package/external/folly/folly/detail/base64_detail/Base64Api.h +101 -0
- package/external/folly/folly/detail/base64_detail/Base64Common.h +80 -0
- package/external/folly/folly/detail/base64_detail/Base64Constants.h +79 -0
- package/external/folly/folly/detail/base64_detail/Base64HiddenConstants.h +129 -0
- package/external/folly/folly/detail/base64_detail/Base64SWAR.cpp +161 -0
- package/external/folly/folly/detail/base64_detail/Base64SWAR.h +32 -0
- package/external/folly/folly/detail/base64_detail/Base64Scalar.h +262 -0
- package/external/folly/folly/detail/base64_detail/Base64Simd.h +102 -0
- package/external/folly/folly/detail/base64_detail/Base64_SSE4_2.cpp +42 -0
- package/external/folly/folly/detail/base64_detail/Base64_SSE4_2.h +33 -0
- package/external/folly/folly/detail/base64_detail/Base64_SSE4_2_Platform.h +167 -0
- package/external/folly/folly/detail/base64_detail/README.md +392 -0
- package/external/folly/folly/detail/base64_detail/tests/BUCK +36 -0
- package/external/folly/folly/detail/base64_detail/tests/Base64AgainstScalarTest.cpp +141 -0
- package/external/folly/folly/detail/base64_detail/tests/Base64PlatformTest.cpp +273 -0
- package/external/folly/folly/detail/base64_detail/tests/Base64SpecialCasesTest.cpp +555 -0
- package/external/folly/folly/detail/test/AsyncTraceTest.cpp +43 -0
- package/external/folly/folly/detail/test/BUCK +118 -0
- package/external/folly/folly/detail/test/FileUtilDetailTest.cpp +56 -0
- package/external/folly/folly/detail/test/PerfScopedTest.cpp +107 -0
- package/external/folly/folly/detail/test/SimpleSimdStringUtilsTest.cpp +92 -0
- package/external/folly/folly/detail/test/SplitStringSimdTest.cpp +242 -0
- package/external/folly/folly/detail/test/StaticSingletonManagerTest.cpp +121 -0
- package/external/folly/folly/detail/test/ThreadLocalBenchmark.cpp +116 -0
- package/external/folly/folly/detail/test/ThreadLocalDetailTest.cpp +194 -0
- package/external/folly/folly/detail/test/TrapOnAvx512TestNegative.cpp +29 -0
- package/external/folly/folly/detail/test/UniqueInstanceTest.cpp +60 -0
- package/external/folly/folly/detail/thread_local_globals.cpp +69 -0
- package/external/folly/folly/detail/thread_local_globals.h +36 -0
- package/external/folly/folly/docs/AtomicHashMap.md +134 -0
- package/external/folly/folly/docs/Benchmark.md +310 -0
- package/external/folly/folly/docs/Conv.md +291 -0
- package/external/folly/folly/docs/Dynamic.md +220 -0
- package/external/folly/folly/docs/DynamicConverter.md +71 -0
- package/external/folly/folly/docs/Executors.md +63 -0
- package/external/folly/folly/docs/FBString.md +46 -0
- package/external/folly/folly/docs/FBVector.md +200 -0
- package/external/folly/folly/docs/Fbvector--graphical_solutions.png +0 -0
- package/external/folly/folly/docs/Format.md +177 -0
- package/external/folly/folly/docs/Function.md +92 -0
- package/external/folly/folly/docs/Futures.md +263 -0
- package/external/folly/folly/docs/GroupVarint.md +46 -0
- package/external/folly/folly/docs/Histogram.md +104 -0
- package/external/folly/folly/docs/MapUtils.md +80 -0
- package/external/folly/folly/docs/Overview.md +263 -0
- package/external/folly/folly/docs/PackedSyncPtr.md +77 -0
- package/external/folly/folly/docs/Poly.md +500 -0
- package/external/folly/folly/docs/ProducerConsumerQueue.md +82 -0
- package/external/folly/folly/docs/Rcu.md +218 -0
- package/external/folly/folly/docs/SmallLocks.md +24 -0
- package/external/folly/folly/docs/Synchronized.md +793 -0
- package/external/folly/folly/docs/ThreadCachedInt.md +98 -0
- package/external/folly/folly/docs/ThreadLocal.md +105 -0
- package/external/folly/folly/docs/Traits.md +161 -0
- package/external/folly/folly/docs/small_vector.md +64 -0
- package/external/folly/folly/docs/style.css +23 -0
- package/external/folly/folly/dynamic-inl.h +17 -0
- package/external/folly/folly/dynamic.h +17 -0
- package/external/folly/folly/folly_extended_library.bzl +28 -0
- package/external/folly/folly/functional/ApplyTuple.h +204 -0
- package/external/folly/folly/functional/BUCK +57 -0
- package/external/folly/folly/functional/Invoke.h +880 -0
- package/external/folly/folly/functional/Partial.h +130 -0
- package/external/folly/folly/functional/protocol.h +203 -0
- package/external/folly/folly/functional/test/ApplyTupleTest.cpp +549 -0
- package/external/folly/folly/functional/test/BUCK +57 -0
- package/external/folly/folly/functional/test/InvokeTest.cpp +483 -0
- package/external/folly/folly/functional/test/PartialTest.cpp +141 -0
- package/external/folly/folly/functional/test/protocol_test.cpp +177 -0
- package/external/folly/folly/functional/test/traits_test.cpp +551 -0
- package/external/folly/folly/functional/traits.h +675 -0
- package/external/folly/folly/hash/BUCK +86 -0
- package/external/folly/folly/hash/Checksum.cpp +275 -0
- package/external/folly/folly/hash/Checksum.h +94 -0
- package/external/folly/folly/hash/FarmHash.h +46 -0
- package/external/folly/folly/hash/Hash.h +1045 -0
- package/external/folly/folly/hash/MurmurHash.h +86 -0
- package/external/folly/folly/hash/SpookyHashV1.cpp +391 -0
- package/external/folly/folly/hash/SpookyHashV1.h +307 -0
- package/external/folly/folly/hash/SpookyHashV2.cpp +392 -0
- package/external/folly/folly/hash/SpookyHashV2.h +339 -0
- package/external/folly/folly/hash/detail/BUCK +26 -0
- package/external/folly/folly/hash/detail/ChecksumDetail.cpp +296 -0
- package/external/folly/folly/hash/detail/ChecksumDetail.h +137 -0
- package/external/folly/folly/hash/detail/Crc32CombineDetail.cpp +191 -0
- package/external/folly/folly/hash/detail/Crc32cDetail.cpp +303 -0
- package/external/folly/folly/hash/test/BUCK +132 -0
- package/external/folly/folly/hash/test/ChecksumBenchmark.cpp +91 -0
- package/external/folly/folly/hash/test/ChecksumTest.cpp +587 -0
- package/external/folly/folly/hash/test/FarmHashTest.cpp +41 -0
- package/external/folly/folly/hash/test/HashBenchmark.cpp +238 -0
- package/external/folly/folly/hash/test/HashTest.cpp +997 -0
- package/external/folly/folly/hash/test/MurmurHashTest.cpp +76 -0
- package/external/folly/folly/hash/test/SpookyHashV1Test.cpp +559 -0
- package/external/folly/folly/hash/test/SpookyHashV2Test.cpp +549 -0
- package/external/folly/folly/hash/test/traits_test.cpp +69 -0
- package/external/folly/folly/hash/traits.h +115 -0
- package/external/folly/folly/json/BUCK +155 -0
- package/external/folly/folly/json/DynamicConverter.h +464 -0
- package/external/folly/folly/json/DynamicParser-inl.h +316 -0
- package/external/folly/folly/json/DynamicParser.cpp +198 -0
- package/external/folly/folly/json/DynamicParser.h +394 -0
- package/external/folly/folly/json/JSONSchema.cpp +1030 -0
- package/external/folly/folly/json/JSONSchema.h +73 -0
- package/external/folly/folly/json/JsonMockUtil.h +73 -0
- package/external/folly/folly/json/JsonTestUtil.cpp +167 -0
- package/external/folly/folly/json/JsonTestUtil.h +88 -0
- package/external/folly/folly/json/bser/BUCK +24 -0
- package/external/folly/folly/json/bser/Bser.h +107 -0
- package/external/folly/folly/json/bser/Dump.cpp +253 -0
- package/external/folly/folly/json/bser/Load.cpp +246 -0
- package/external/folly/folly/json/bser/test/BUCK +14 -0
- package/external/folly/folly/json/bser/test/BserTest.cpp +149 -0
- package/external/folly/folly/json/dynamic-inl.h +1438 -0
- package/external/folly/folly/json/dynamic.cpp +552 -0
- package/external/folly/folly/json/dynamic.h +1346 -0
- package/external/folly/folly/json/json.cpp +1118 -0
- package/external/folly/folly/json/json.h +238 -0
- package/external/folly/folly/json/json_patch.cpp +325 -0
- package/external/folly/folly/json/json_patch.h +126 -0
- package/external/folly/folly/json/json_pointer.cpp +114 -0
- package/external/folly/folly/json/json_pointer.h +87 -0
- package/external/folly/folly/json/test/BUCK +147 -0
- package/external/folly/folly/json/test/DynamicBenchmark.cpp +146 -0
- package/external/folly/folly/json/test/DynamicConverterTest.cpp +518 -0
- package/external/folly/folly/json/test/DynamicOtherTest.cpp +344 -0
- package/external/folly/folly/json/test/DynamicParserTest.cpp +443 -0
- package/external/folly/folly/json/test/DynamicTest.cpp +1647 -0
- package/external/folly/folly/json/test/JSONSchemaTest.cpp +450 -0
- package/external/folly/folly/json/test/JsonBenchmark.cpp +264 -0
- package/external/folly/folly/json/test/JsonOtherTest.cpp +51 -0
- package/external/folly/folly/json/test/JsonTest.cpp +1153 -0
- package/external/folly/folly/json/test/JsonTestUtilTest.cpp +97 -0
- package/external/folly/folly/json/test/json_patch_test.cpp +361 -0
- package/external/folly/folly/json/test/json_pointer_test.cpp +58 -0
- package/external/folly/folly/json/tool/BUCK +13 -0
- package/external/folly/folly/json/tool/JSONSchemaTester.cpp +58 -0
- package/external/folly/folly/json.h +17 -0
- package/external/folly/folly/json_patch.h +17 -0
- package/external/folly/folly/json_pointer.h +17 -0
- package/external/folly/folly/lang/Access.h +29 -0
- package/external/folly/folly/lang/Align.h +240 -0
- package/external/folly/folly/lang/Aligned.h +92 -0
- package/external/folly/folly/lang/Assume.h +82 -0
- package/external/folly/folly/lang/BUCK +287 -0
- package/external/folly/folly/lang/Badge.h +108 -0
- package/external/folly/folly/lang/Bits.h +570 -0
- package/external/folly/folly/lang/BitsClass.h +312 -0
- package/external/folly/folly/lang/Builtin.h +74 -0
- package/external/folly/folly/lang/CArray.h +34 -0
- package/external/folly/folly/lang/CString.cpp +86 -0
- package/external/folly/folly/lang/CString.h +55 -0
- package/external/folly/folly/lang/Cast.h +51 -0
- package/external/folly/folly/lang/CheckedMath.h +253 -0
- package/external/folly/folly/lang/CustomizationPoint.h +58 -0
- package/external/folly/folly/lang/Exception.cpp +822 -0
- package/external/folly/folly/lang/Exception.h +716 -0
- package/external/folly/folly/lang/Extern.h +55 -0
- package/external/folly/folly/lang/Hint-inl.h +144 -0
- package/external/folly/folly/lang/Hint.h +238 -0
- package/external/folly/folly/lang/Keep.h +98 -0
- package/external/folly/folly/lang/New.h +124 -0
- package/external/folly/folly/lang/Ordering.h +140 -0
- package/external/folly/folly/lang/Pretty.h +159 -0
- package/external/folly/folly/lang/PropagateConst.h +413 -0
- package/external/folly/folly/lang/RValueReferenceWrapper.h +152 -0
- package/external/folly/folly/lang/SafeAssert.cpp +589 -0
- package/external/folly/folly/lang/SafeAssert.h +188 -0
- package/external/folly/folly/lang/StaticConst.h +33 -0
- package/external/folly/folly/lang/Thunk.h +100 -0
- package/external/folly/folly/lang/ToAscii.cpp +348 -0
- package/external/folly/folly/lang/ToAscii.h +182 -0
- package/external/folly/folly/lang/TypeInfo.h +58 -0
- package/external/folly/folly/lang/UncaughtExceptions.cpp +17 -0
- package/external/folly/folly/lang/UncaughtExceptions.h +19 -0
- package/external/folly/folly/lang/test/AlignTest.cpp +87 -0
- package/external/folly/folly/lang/test/AlignedTest.cpp +130 -0
- package/external/folly/folly/lang/test/BUCK +258 -0
- package/external/folly/folly/lang/test/BadgeTest.cpp +89 -0
- package/external/folly/folly/lang/test/BitsBenchmark.cpp +164 -0
- package/external/folly/folly/lang/test/BitsClassBenchmark.cpp +122 -0
- package/external/folly/folly/lang/test/BitsClassTest.cpp +379 -0
- package/external/folly/folly/lang/test/BitsTest.cpp +577 -0
- package/external/folly/folly/lang/test/CStringTest.cpp +60 -0
- package/external/folly/folly/lang/test/CastTest.cpp +47 -0
- package/external/folly/folly/lang/test/CheckedMathTest.cpp +394 -0
- package/external/folly/folly/lang/test/ExceptionBench.cpp +427 -0
- package/external/folly/folly/lang/test/ExceptionTest.cpp +413 -0
- package/external/folly/folly/lang/test/ExternTest.cpp +39 -0
- package/external/folly/folly/lang/test/HintTest.cpp +100 -0
- package/external/folly/folly/lang/test/NewTest.cpp +38 -0
- package/external/folly/folly/lang/test/OrderingTest.cpp +105 -0
- package/external/folly/folly/lang/test/PrettyTest.cpp +44 -0
- package/external/folly/folly/lang/test/PropagateConstTest.cpp +356 -0
- package/external/folly/folly/lang/test/RValueReferenceWrapperTest.cpp +85 -0
- package/external/folly/folly/lang/test/SafeAssertTest.cpp +75 -0
- package/external/folly/folly/lang/test/ThunkTest.cpp +105 -0
- package/external/folly/folly/lang/test/ToAsciiBench.cpp +466 -0
- package/external/folly/folly/lang/test/ToAsciiTest.cpp +266 -0
- package/external/folly/folly/lang/test/TypeInfoTest.cpp +56 -0
- package/external/folly/folly/memcpy.S +292 -0
- package/external/folly/folly/memcpy_select_aarch64.cpp +145 -0
- package/external/folly/folly/memory/Arena-inl.h +83 -0
- package/external/folly/folly/memory/Arena.h +325 -0
- package/external/folly/folly/memory/BUCK +191 -0
- package/external/folly/folly/memory/JemallocHugePageAllocator.cpp +449 -0
- package/external/folly/folly/memory/JemallocHugePageAllocator.h +105 -0
- package/external/folly/folly/memory/JemallocHugePageAllocatorTest.cpp +341 -0
- package/external/folly/folly/memory/JemallocNodumpAllocator.cpp +176 -0
- package/external/folly/folly/memory/JemallocNodumpAllocator.h +119 -0
- package/external/folly/folly/memory/JemallocNodumpAllocatorTest.cpp +61 -0
- package/external/folly/folly/memory/MallctlHelper.cpp +37 -0
- package/external/folly/folly/memory/MallctlHelper.h +167 -0
- package/external/folly/folly/memory/Malloc.h +551 -0
- package/external/folly/folly/memory/MemoryResource.h +57 -0
- package/external/folly/folly/memory/ReentrantAllocator.cpp +162 -0
- package/external/folly/folly/memory/ReentrantAllocator.h +261 -0
- package/external/folly/folly/memory/SanitizeAddress.cpp +75 -0
- package/external/folly/folly/memory/SanitizeAddress.h +117 -0
- package/external/folly/folly/memory/SanitizeLeak.cpp +119 -0
- package/external/folly/folly/memory/SanitizeLeak.h +108 -0
- package/external/folly/folly/memory/ThreadCachedArena.cpp +53 -0
- package/external/folly/folly/memory/ThreadCachedArena.h +90 -0
- package/external/folly/folly/memory/UninitializedMemoryHacks.h +426 -0
- package/external/folly/folly/memory/detail/BUCK +10 -0
- package/external/folly/folly/memory/detail/MallocImpl.cpp +52 -0
- package/external/folly/folly/memory/detail/MallocImpl.h +97 -0
- package/external/folly/folly/memory/not_null-inl.h +522 -0
- package/external/folly/folly/memory/not_null.h +449 -0
- package/external/folly/folly/memory/test/ArenaTest.cpp +354 -0
- package/external/folly/folly/memory/test/BUCK +146 -0
- package/external/folly/folly/memory/test/MallctlHelperTest.cpp +169 -0
- package/external/folly/folly/memory/test/MallocBenchmark.cpp +91 -0
- package/external/folly/folly/memory/test/MallocTest.cpp +78 -0
- package/external/folly/folly/memory/test/MemoryResourceTest.cpp +31 -0
- package/external/folly/folly/memory/test/ReentrantAllocatorTest.cpp +144 -0
- package/external/folly/folly/memory/test/SanitizeAddressTest.cpp +67 -0
- package/external/folly/folly/memory/test/SanitizeLeakTest.cpp +139 -0
- package/external/folly/folly/memory/test/ThreadCachedArenaTest.cpp +276 -0
- package/external/folly/folly/memory/test/UninitializedMemoryHacksODR.cpp +21 -0
- package/external/folly/folly/memory/test/UninitializedMemoryHacksTest.cpp +327 -0
- package/external/folly/folly/memory/test/not_null_test.cpp +608 -0
- package/external/folly/folly/memset.S +245 -0
- package/external/folly/folly/memset_select_aarch64.cpp +72 -0
- package/external/folly/folly/portability/Asm.h +50 -0
- package/external/folly/folly/portability/Atomic.h +31 -0
- package/external/folly/folly/portability/BUCK +456 -0
- package/external/folly/folly/portability/Builtins.cpp +31 -0
- package/external/folly/folly/portability/Builtins.h +161 -0
- package/external/folly/folly/portability/Config.h +43 -0
- package/external/folly/folly/portability/Constexpr.h +145 -0
- package/external/folly/folly/portability/Dirent.cpp +140 -0
- package/external/folly/folly/portability/Dirent.h +41 -0
- package/external/folly/folly/portability/Event.h +44 -0
- package/external/folly/folly/portability/Fcntl.cpp +120 -0
- package/external/folly/folly/portability/Fcntl.h +67 -0
- package/external/folly/folly/portability/Filesystem.cpp +67 -0
- package/external/folly/folly/portability/Filesystem.h +114 -0
- package/external/folly/folly/portability/FmtCompile.h +40 -0
- package/external/folly/folly/portability/GFlags.h +139 -0
- package/external/folly/folly/portability/GMock.h +35 -0
- package/external/folly/folly/portability/GTest.h +35 -0
- package/external/folly/folly/portability/IOVec.h +34 -0
- package/external/folly/folly/portability/Libgen.cpp +59 -0
- package/external/folly/folly/portability/Libgen.h +29 -0
- package/external/folly/folly/portability/Libunwind.h +21 -0
- package/external/folly/folly/portability/Malloc.cpp +31 -0
- package/external/folly/folly/portability/Malloc.h +53 -0
- package/external/folly/folly/portability/Math.h +90 -0
- package/external/folly/folly/portability/Memory.h +26 -0
- package/external/folly/folly/portability/OpenSSL.cpp +17 -0
- package/external/folly/folly/portability/OpenSSL.h +102 -0
- package/external/folly/folly/portability/PThread.cpp +697 -0
- package/external/folly/folly/portability/PThread.h +148 -0
- package/external/folly/folly/portability/README.md +21 -0
- package/external/folly/folly/portability/Sched.cpp +41 -0
- package/external/folly/folly/portability/Sched.h +45 -0
- package/external/folly/folly/portability/Sockets.cpp +245 -0
- package/external/folly/folly/portability/Sockets.h +155 -0
- package/external/folly/folly/portability/SourceLocation.h +49 -0
- package/external/folly/folly/portability/Stdio.cpp +77 -0
- package/external/folly/folly/portability/Stdio.h +32 -0
- package/external/folly/folly/portability/Stdlib.cpp +172 -0
- package/external/folly/folly/portability/Stdlib.h +64 -0
- package/external/folly/folly/portability/String.cpp +53 -0
- package/external/folly/folly/portability/String.h +39 -0
- package/external/folly/folly/portability/SysFile.cpp +46 -0
- package/external/folly/folly/portability/SysFile.h +27 -0
- package/external/folly/folly/portability/SysMembarrier.cpp +104 -0
- package/external/folly/folly/portability/SysMembarrier.h +26 -0
- package/external/folly/folly/portability/SysMman.cpp +242 -0
- package/external/folly/folly/portability/SysMman.h +68 -0
- package/external/folly/folly/portability/SysResource.cpp +108 -0
- package/external/folly/folly/portability/SysResource.h +71 -0
- package/external/folly/folly/portability/SysStat.cpp +66 -0
- package/external/folly/folly/portability/SysStat.h +52 -0
- package/external/folly/folly/portability/SysSyscall.h +73 -0
- package/external/folly/folly/portability/SysTime.cpp +62 -0
- package/external/folly/folly/portability/SysTime.h +50 -0
- package/external/folly/folly/portability/SysTypes.h +44 -0
- package/external/folly/folly/portability/SysUio.cpp +179 -0
- package/external/folly/folly/portability/SysUio.h +51 -0
- package/external/folly/folly/portability/Syslog.h +39 -0
- package/external/folly/folly/portability/Time.cpp +357 -0
- package/external/folly/folly/portability/Time.h +74 -0
- package/external/folly/folly/portability/Unistd.cpp +33 -0
- package/external/folly/folly/portability/Unistd.h +111 -0
- package/external/folly/folly/portability/Windows.h +108 -0
- package/external/folly/folly/portability/openat2.c +30 -0
- package/external/folly/folly/portability/openat2.h +39 -0
- package/external/folly/folly/portability/test/BUCK +59 -0
- package/external/folly/folly/portability/test/ConstexprTest.cpp +102 -0
- package/external/folly/folly/portability/test/FilesystemTest.cpp +35 -0
- package/external/folly/folly/portability/test/LibgenTest.cpp +35 -0
- package/external/folly/folly/portability/test/OpenSSLPortabilityTest.cpp +108 -0
- package/external/folly/folly/portability/test/PThreadTest.cpp +80 -0
- package/external/folly/folly/portability/test/TimeTest.cpp +90 -0
- package/external/folly/folly/small_vector.h +17 -0
- package/external/folly/folly/somerge_defs.bzl +399 -0
- package/external/folly/folly/sorted_vector_types.h +17 -0
- package/external/folly/folly/stop_watch.h +317 -0
- package/external/folly/folly/synchronization/AsymmetricThreadFence.cpp +91 -0
- package/external/folly/folly/synchronization/AsymmetricThreadFence.h +60 -0
- package/external/folly/folly/synchronization/AtomicNotification-inl.h +146 -0
- package/external/folly/folly/synchronization/AtomicNotification.cpp +34 -0
- package/external/folly/folly/synchronization/AtomicNotification.h +117 -0
- package/external/folly/folly/synchronization/AtomicRef.h +181 -0
- package/external/folly/folly/synchronization/AtomicStruct.h +150 -0
- package/external/folly/folly/synchronization/AtomicUtil-inl.h +482 -0
- package/external/folly/folly/synchronization/AtomicUtil.h +179 -0
- package/external/folly/folly/synchronization/BUCK +418 -0
- package/external/folly/folly/synchronization/Baton.h +419 -0
- package/external/folly/folly/synchronization/CallOnce.h +263 -0
- package/external/folly/folly/synchronization/DelayedInit.h +179 -0
- package/external/folly/folly/synchronization/DistributedMutex-inl.h +1744 -0
- package/external/folly/folly/synchronization/DistributedMutex.cpp +27 -0
- package/external/folly/folly/synchronization/DistributedMutex.h +342 -0
- package/external/folly/folly/synchronization/EventCount.h +200 -0
- package/external/folly/folly/synchronization/FlatCombining.h +629 -0
- package/external/folly/folly/synchronization/Hazptr-fwd.h +217 -0
- package/external/folly/folly/synchronization/Hazptr.cpp +36 -0
- package/external/folly/folly/synchronization/Hazptr.h +209 -0
- package/external/folly/folly/synchronization/HazptrDomain.cpp +68 -0
- package/external/folly/folly/synchronization/HazptrDomain.h +832 -0
- package/external/folly/folly/synchronization/HazptrHolder.h +431 -0
- package/external/folly/folly/synchronization/HazptrObj.h +533 -0
- package/external/folly/folly/synchronization/HazptrObjLinked.h +315 -0
- package/external/folly/folly/synchronization/HazptrRec.h +68 -0
- package/external/folly/folly/synchronization/HazptrThrLocal.h +180 -0
- package/external/folly/folly/synchronization/HazptrThreadPoolExecutor.cpp +46 -0
- package/external/folly/folly/synchronization/HazptrThreadPoolExecutor.h +25 -0
- package/external/folly/folly/synchronization/Latch.h +160 -0
- package/external/folly/folly/synchronization/LifoSem.h +767 -0
- package/external/folly/folly/synchronization/Lock.h +887 -0
- package/external/folly/folly/synchronization/MicroSpinLock.h +154 -0
- package/external/folly/folly/synchronization/NativeSemaphore.h +187 -0
- package/external/folly/folly/synchronization/ParkingLot.cpp +37 -0
- package/external/folly/folly/synchronization/ParkingLot.h +330 -0
- package/external/folly/folly/synchronization/PicoSpinLock.h +167 -0
- package/external/folly/folly/synchronization/RWSpinLock.h +549 -0
- package/external/folly/folly/synchronization/Rcu.cpp +26 -0
- package/external/folly/folly/synchronization/Rcu.h +553 -0
- package/external/folly/folly/synchronization/RelaxedAtomic.h +336 -0
- package/external/folly/folly/synchronization/SanitizeThread.cpp +141 -0
- package/external/folly/folly/synchronization/SanitizeThread.h +166 -0
- package/external/folly/folly/synchronization/SaturatingSemaphore.h +324 -0
- package/external/folly/folly/synchronization/SmallLocks.h +36 -0
- package/external/folly/folly/synchronization/ThrottledLifoSem.h +362 -0
- package/external/folly/folly/synchronization/WaitOptions.cpp +25 -0
- package/external/folly/folly/synchronization/WaitOptions.h +75 -0
- package/external/folly/folly/synchronization/detail/AtomicUtils.h +59 -0
- package/external/folly/folly/synchronization/detail/BUCK +104 -0
- package/external/folly/folly/synchronization/detail/Hardware.cpp +192 -0
- package/external/folly/folly/synchronization/detail/Hardware.h +75 -0
- package/external/folly/folly/synchronization/detail/HazptrUtils.h +339 -0
- package/external/folly/folly/synchronization/detail/InlineFunctionRef.h +229 -0
- package/external/folly/folly/synchronization/detail/Sleeper.cpp +27 -0
- package/external/folly/folly/synchronization/detail/Sleeper.h +62 -0
- package/external/folly/folly/synchronization/detail/Spin.h +96 -0
- package/external/folly/folly/synchronization/detail/ThreadCachedLists.h +174 -0
- package/external/folly/folly/synchronization/detail/ThreadCachedReaders.h +189 -0
- package/external/folly/folly/synchronization/detail/ThreadCachedTag.h +26 -0
- package/external/folly/folly/synchronization/detail/test/BUCK +28 -0
- package/external/folly/folly/synchronization/detail/test/HardwareTest.cpp +74 -0
- package/external/folly/folly/synchronization/detail/test/InlineFunctionRefTest.cpp +286 -0
- package/external/folly/folly/synchronization/example/BUCK +27 -0
- package/external/folly/folly/synchronization/example/HazptrLockFreeLIFO.h +88 -0
- package/external/folly/folly/synchronization/example/HazptrSWMRSet.h +133 -0
- package/external/folly/folly/synchronization/example/HazptrWideCAS.h +62 -0
- package/external/folly/folly/synchronization/test/AtomicNotificationTest.cpp +236 -0
- package/external/folly/folly/synchronization/test/AtomicRefTest.cpp +170 -0
- package/external/folly/folly/synchronization/test/AtomicStructTest.cpp +65 -0
- package/external/folly/folly/synchronization/test/AtomicUtilBench.cpp +457 -0
- package/external/folly/folly/synchronization/test/AtomicUtilTest.cpp +650 -0
- package/external/folly/folly/synchronization/test/BUCK +495 -0
- package/external/folly/folly/synchronization/test/Barrier.h +52 -0
- package/external/folly/folly/synchronization/test/BarrierTest.cpp +56 -0
- package/external/folly/folly/synchronization/test/BatonBenchmark.cpp +77 -0
- package/external/folly/folly/synchronization/test/BatonTest.cpp +164 -0
- package/external/folly/folly/synchronization/test/BatonTestHelpers.h +118 -0
- package/external/folly/folly/synchronization/test/CallOnceBenchmark.cpp +72 -0
- package/external/folly/folly/synchronization/test/CallOnceTest.cpp +153 -0
- package/external/folly/folly/synchronization/test/DelayedInitTest.cpp +281 -0
- package/external/folly/folly/synchronization/test/DistributedMutexTest.cpp +2074 -0
- package/external/folly/folly/synchronization/test/EventCountTest.cpp +124 -0
- package/external/folly/folly/synchronization/test/FlatCombiningBenchmark.cpp +1789 -0
- package/external/folly/folly/synchronization/test/FlatCombiningExamples.h +222 -0
- package/external/folly/folly/synchronization/test/FlatCombiningTest.cpp +121 -0
- package/external/folly/folly/synchronization/test/FlatCombiningTestHelpers.h +227 -0
- package/external/folly/folly/synchronization/test/HazptrTest.cpp +1689 -0
- package/external/folly/folly/synchronization/test/LatchTest.cpp +224 -0
- package/external/folly/folly/synchronization/test/LifoSemBench.cpp +185 -0
- package/external/folly/folly/synchronization/test/LifoSemTests.cpp +353 -0
- package/external/folly/folly/synchronization/test/LockTest.cpp +1239 -0
- package/external/folly/folly/synchronization/test/NativeSemaphoreTest.cpp +37 -0
- package/external/folly/folly/synchronization/test/ParkingLotBenchmark.cpp +239 -0
- package/external/folly/folly/synchronization/test/ParkingLotTest.cpp +170 -0
- package/external/folly/folly/synchronization/test/RWSpinLockTest.cpp +235 -0
- package/external/folly/folly/synchronization/test/RcuBench.cpp +66 -0
- package/external/folly/folly/synchronization/test/RcuTest.cpp +330 -0
- package/external/folly/folly/synchronization/test/RelaxedAtomicTest.cpp +389 -0
- package/external/folly/folly/synchronization/test/SaturatingSemaphoreTest.cpp +166 -0
- package/external/folly/folly/synchronization/test/Semaphore.h +242 -0
- package/external/folly/folly/synchronization/test/SemaphoreTest.cpp +271 -0
- package/external/folly/folly/synchronization/test/SmallLocksBenchmark.cpp +1296 -0
- package/external/folly/folly/synchronization/test/SmallLocksTest.cpp +510 -0
- package/external/folly/folly/synchronization/test/ThreadCachedEpochBench.h +67 -0
- package/external/folly/folly/synchronization/test/ThreadCachedReadersBench.cpp +42 -0
- package/external/folly/folly/synchronization/test/ThreadCachedReadersTest.cpp +52 -0
- package/external/folly/folly/synchronization/test/ThrottledLifoSemTest.cpp +243 -0
- package/external/folly/folly/system/AtFork.cpp +205 -0
- package/external/folly/folly/system/AtFork.h +116 -0
- package/external/folly/folly/system/AuxVector.h +198 -0
- package/external/folly/folly/system/BUCK +144 -0
- package/external/folly/folly/system/EnvUtil.cpp +93 -0
- package/external/folly/folly/system/EnvUtil.h +113 -0
- package/external/folly/folly/system/HardwareConcurrency.cpp +39 -0
- package/external/folly/folly/system/HardwareConcurrency.h +23 -0
- package/external/folly/folly/system/MemoryMapping.cpp +477 -0
- package/external/folly/folly/system/MemoryMapping.h +287 -0
- package/external/folly/folly/system/Pid.cpp +87 -0
- package/external/folly/folly/system/Pid.h +34 -0
- package/external/folly/folly/system/Shell.cpp +33 -0
- package/external/folly/folly/system/Shell.h +93 -0
- package/external/folly/folly/system/ThreadId.cpp +89 -0
- package/external/folly/folly/system/ThreadId.h +62 -0
- package/external/folly/folly/system/ThreadName.cpp +330 -0
- package/external/folly/folly/system/ThreadName.h +72 -0
- package/external/folly/folly/system/test/AtForkTest.cpp +309 -0
- package/external/folly/folly/system/test/AuxVectorTest.cpp +55 -0
- package/external/folly/folly/system/test/BUCK +120 -0
- package/external/folly/folly/system/test/EnvUtilSubprocess.cpp +26 -0
- package/external/folly/folly/system/test/EnvUtilTest.cpp +197 -0
- package/external/folly/folly/system/test/MemoryMappingTest.cpp +179 -0
- package/external/folly/folly/system/test/PidTest.cpp +46 -0
- package/external/folly/folly/system/test/ShellTest.cpp +66 -0
- package/external/folly/folly/system/test/ThreadIdTest.cpp +114 -0
- package/external/folly/folly/system/test/ThreadNameTest.cpp +85 -0
- package/external/folly/folly.vcxitems +164 -0
- package/external/folly/static/logo.svg +1 -0
- package/external/folly/sync-config.json +8 -0
- package/package.json +3 -3
- package/templates/cpp-lib/example/metro.config.js +18 -2
|
@@ -0,0 +1,1118 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
#include <folly/json/json.h>
|
|
18
|
+
|
|
19
|
+
#include <algorithm>
|
|
20
|
+
#include <functional>
|
|
21
|
+
#include <iterator>
|
|
22
|
+
#include <sstream>
|
|
23
|
+
#include <type_traits>
|
|
24
|
+
|
|
25
|
+
#include <boost/algorithm/string.hpp>
|
|
26
|
+
#include <glog/logging.h>
|
|
27
|
+
|
|
28
|
+
#include <folly/Conv.h>
|
|
29
|
+
#include <folly/Portability.h>
|
|
30
|
+
#include <folly/Range.h>
|
|
31
|
+
#include <folly/Unicode.h>
|
|
32
|
+
#include <folly/Utility.h>
|
|
33
|
+
#include <folly/lang/Bits.h>
|
|
34
|
+
#include <folly/portability/Constexpr.h>
|
|
35
|
+
|
|
36
|
+
namespace folly {
|
|
37
|
+
|
|
38
|
+
//////////////////////////////////////////////////////////////////////
|
|
39
|
+
|
|
40
|
+
namespace json {
|
|
41
|
+
|
|
42
|
+
namespace {
|
|
43
|
+
|
|
44
|
+
parse_error make_parse_error(
|
|
45
|
+
unsigned int line,
|
|
46
|
+
std::string const& context,
|
|
47
|
+
std::string const& expected) {
|
|
48
|
+
return parse_error(to<std::string>(
|
|
49
|
+
"json parse error on line ",
|
|
50
|
+
line,
|
|
51
|
+
!context.empty() ? to<std::string>(" near `", context, '\'') : "",
|
|
52
|
+
": ",
|
|
53
|
+
expected));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
struct Printer {
|
|
57
|
+
// Context class is allows to restore the path to element that we are about to
|
|
58
|
+
// print so that if error happens we can throw meaningful exception.
|
|
59
|
+
class Context {
|
|
60
|
+
public:
|
|
61
|
+
Context(const Context* parent_context, const dynamic& key)
|
|
62
|
+
: parent_context_(parent_context), key_(key), is_key_(false) {}
|
|
63
|
+
Context(const Context* parent_context, const dynamic& key, bool is_key)
|
|
64
|
+
: parent_context_(parent_context), key_(key), is_key_(is_key) {}
|
|
65
|
+
|
|
66
|
+
// Return location description of a context as a chain of keys
|
|
67
|
+
// ex., '"outherKey"->"innerKey"'.
|
|
68
|
+
std::string locationDescription() const {
|
|
69
|
+
std::vector<std::string> keys;
|
|
70
|
+
const Context* ptr = parent_context_;
|
|
71
|
+
while (ptr) {
|
|
72
|
+
keys.push_back(ptr->getName());
|
|
73
|
+
ptr = ptr->parent_context_;
|
|
74
|
+
}
|
|
75
|
+
keys.push_back(getName());
|
|
76
|
+
std::ostringstream stream;
|
|
77
|
+
std::reverse_copy(
|
|
78
|
+
keys.begin(),
|
|
79
|
+
keys.end() - 1,
|
|
80
|
+
std::ostream_iterator<std::string>(stream, "->"));
|
|
81
|
+
|
|
82
|
+
// Add current key.
|
|
83
|
+
stream << keys.back();
|
|
84
|
+
return stream.str();
|
|
85
|
+
}
|
|
86
|
+
std::string getName() const {
|
|
87
|
+
return Printer::toStringOr(key_, "<unprintable>");
|
|
88
|
+
}
|
|
89
|
+
std::string typeDescription() const { return is_key_ ? "key" : "value"; }
|
|
90
|
+
|
|
91
|
+
private:
|
|
92
|
+
const Context* const parent_context_;
|
|
93
|
+
const dynamic& key_;
|
|
94
|
+
bool is_key_;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
explicit Printer(
|
|
98
|
+
std::string& out, unsigned* indentLevel, serialization_opts const* opts)
|
|
99
|
+
: out_(out), indentLevel_(indentLevel), opts_(*opts) {}
|
|
100
|
+
|
|
101
|
+
void operator()(dynamic const& v, const Context& context) const {
|
|
102
|
+
(*this)(v, &context);
|
|
103
|
+
}
|
|
104
|
+
void operator()(dynamic const& v, const Context* context) const {
|
|
105
|
+
switch (v.type()) {
|
|
106
|
+
case dynamic::DOUBLE: {
|
|
107
|
+
if (!opts_.allow_nan_inf) {
|
|
108
|
+
if (std::isnan(v.asDouble())) {
|
|
109
|
+
throw json::print_error(
|
|
110
|
+
"folly::toJson: JSON object value was a NaN when serializing " +
|
|
111
|
+
contextDescription(context));
|
|
112
|
+
}
|
|
113
|
+
if (std::isinf(v.asDouble())) {
|
|
114
|
+
throw json::print_error(
|
|
115
|
+
"folly::toJson: JSON object value was an INF when serializing " +
|
|
116
|
+
contextDescription(context));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
toAppend(
|
|
120
|
+
v.asDouble(),
|
|
121
|
+
&out_,
|
|
122
|
+
opts_.dtoa_mode,
|
|
123
|
+
opts_.double_num_digits,
|
|
124
|
+
opts_.dtoa_flags);
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
case dynamic::INT64: {
|
|
128
|
+
auto intval = v.asInt();
|
|
129
|
+
if (opts_.javascript_safe) {
|
|
130
|
+
// Use folly::to to check that this integer can be represented
|
|
131
|
+
// as a double without loss of precision.
|
|
132
|
+
intval = int64_t(to<double>(intval));
|
|
133
|
+
}
|
|
134
|
+
toAppend(intval, &out_);
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
case dynamic::BOOL:
|
|
138
|
+
out_ += v.asBool() ? "true" : "false";
|
|
139
|
+
break;
|
|
140
|
+
case dynamic::NULLT:
|
|
141
|
+
out_ += "null";
|
|
142
|
+
break;
|
|
143
|
+
case dynamic::STRING:
|
|
144
|
+
escapeString(v.stringPiece(), out_, opts_);
|
|
145
|
+
break;
|
|
146
|
+
case dynamic::OBJECT:
|
|
147
|
+
printObject(v, context);
|
|
148
|
+
break;
|
|
149
|
+
case dynamic::ARRAY:
|
|
150
|
+
printArray(v, context);
|
|
151
|
+
break;
|
|
152
|
+
default:
|
|
153
|
+
CHECK(0) << "Bad type " << v.type();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
private:
|
|
158
|
+
void printKV(
|
|
159
|
+
dynamic const& o,
|
|
160
|
+
const std::pair<const dynamic, dynamic>& p,
|
|
161
|
+
const Context* context) const {
|
|
162
|
+
if (opts_.convert_int_keys && p.first.isInt()) {
|
|
163
|
+
auto strKey = p.first.asString();
|
|
164
|
+
if (o.count(strKey)) {
|
|
165
|
+
throw json::print_error(folly::to<std::string>(
|
|
166
|
+
"folly::toJson: Source object has integer and string keys "
|
|
167
|
+
"representing the same value: ",
|
|
168
|
+
p.first.asInt()));
|
|
169
|
+
}
|
|
170
|
+
(*this)(p.first.asString(), Context(context, p.first, true));
|
|
171
|
+
} else if (!opts_.allow_non_string_keys && !p.first.isString()) {
|
|
172
|
+
throw json::print_error(
|
|
173
|
+
"folly::toJson: JSON object key " +
|
|
174
|
+
toStringOr(p.first, "<unprintable key>") + " was not a string " +
|
|
175
|
+
(opts_.convert_int_keys ? "or integer " : "") +
|
|
176
|
+
"when serializing key at " +
|
|
177
|
+
Context(context, p.first, true).locationDescription());
|
|
178
|
+
} else {
|
|
179
|
+
(*this)(p.first, Context(context, p.first, true)); // Key
|
|
180
|
+
}
|
|
181
|
+
mapColon();
|
|
182
|
+
(*this)(p.second, Context(context, p.first, false)); // Value
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
template <typename Iterator>
|
|
186
|
+
void printKVPairs(
|
|
187
|
+
dynamic const& o,
|
|
188
|
+
Iterator begin,
|
|
189
|
+
Iterator end,
|
|
190
|
+
const Context* context) const {
|
|
191
|
+
printKV(o, *begin, context);
|
|
192
|
+
for (++begin; begin != end; ++begin) {
|
|
193
|
+
out_ += ',';
|
|
194
|
+
newline();
|
|
195
|
+
printKV(o, *begin, context);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
void printObject(dynamic const& o, const Context* context) const {
|
|
200
|
+
if (o.empty()) {
|
|
201
|
+
out_ += "{}";
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
out_ += '{';
|
|
206
|
+
indent();
|
|
207
|
+
newline();
|
|
208
|
+
if (opts_.sort_keys || opts_.sort_keys_by) {
|
|
209
|
+
using ref = std::reference_wrapper<decltype(o.items())::value_type const>;
|
|
210
|
+
auto sort_keys_by = [&](auto begin, auto end, const auto& comp) {
|
|
211
|
+
std::sort(begin, end, [&](ref a, ref b) {
|
|
212
|
+
// Only compare keys. No ordering among identical keys.
|
|
213
|
+
return comp(a.get().first, b.get().first);
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
std::vector<ref> refs(o.items().begin(), o.items().end());
|
|
217
|
+
if (opts_.sort_keys_by) {
|
|
218
|
+
sort_keys_by(refs.begin(), refs.end(), opts_.sort_keys_by);
|
|
219
|
+
} else {
|
|
220
|
+
sort_keys_by(refs.begin(), refs.end(), std::less<>());
|
|
221
|
+
}
|
|
222
|
+
printKVPairs(o, refs.cbegin(), refs.cend(), context);
|
|
223
|
+
} else {
|
|
224
|
+
printKVPairs(o, o.items().begin(), o.items().end(), context);
|
|
225
|
+
}
|
|
226
|
+
outdent();
|
|
227
|
+
newline();
|
|
228
|
+
out_ += '}';
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
static std::string toStringOr(dynamic const& v, const char* placeholder) {
|
|
232
|
+
try {
|
|
233
|
+
std::string result;
|
|
234
|
+
unsigned indentLevel = 0;
|
|
235
|
+
serialization_opts opts;
|
|
236
|
+
opts.allow_nan_inf = true;
|
|
237
|
+
opts.allow_non_string_keys = true;
|
|
238
|
+
Printer printer(result, &indentLevel, &opts);
|
|
239
|
+
printer(v, nullptr);
|
|
240
|
+
return result;
|
|
241
|
+
} catch (...) {
|
|
242
|
+
return placeholder;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
static std::string contextDescription(const Context* context) {
|
|
247
|
+
if (!context) {
|
|
248
|
+
return "<undefined location>";
|
|
249
|
+
}
|
|
250
|
+
return context->typeDescription() + " at " + context->locationDescription();
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
void printArray(dynamic const& a, const Context* context) const {
|
|
254
|
+
if (a.empty()) {
|
|
255
|
+
out_ += "[]";
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
out_ += '[';
|
|
260
|
+
indent();
|
|
261
|
+
newline();
|
|
262
|
+
(*this)(a[0], Context(context, dynamic(0)));
|
|
263
|
+
for (auto it = std::next(a.begin()); it != a.end(); ++it) {
|
|
264
|
+
out_ += ',';
|
|
265
|
+
newline();
|
|
266
|
+
(*this)(*it, Context(context, dynamic(std::distance(a.begin(), it))));
|
|
267
|
+
}
|
|
268
|
+
outdent();
|
|
269
|
+
newline();
|
|
270
|
+
out_ += ']';
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
private:
|
|
274
|
+
void outdent() const {
|
|
275
|
+
if (indentLevel_) {
|
|
276
|
+
--*indentLevel_;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
void indent() const {
|
|
281
|
+
if (indentLevel_) {
|
|
282
|
+
++*indentLevel_;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
void newline() const {
|
|
287
|
+
if (indentLevel_) {
|
|
288
|
+
auto indent = *indentLevel_ * opts_.pretty_formatting_indent_width;
|
|
289
|
+
out_ += to<std::string>('\n', std::string(indent, ' '));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
void mapColon() const { out_ += indentLevel_ ? ": " : ":"; }
|
|
294
|
+
|
|
295
|
+
private:
|
|
296
|
+
std::string& out_;
|
|
297
|
+
unsigned* const indentLevel_;
|
|
298
|
+
serialization_opts const& opts_;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
//////////////////////////////////////////////////////////////////////
|
|
302
|
+
|
|
303
|
+
// Wraps our input buffer with some helper functions.
|
|
304
|
+
struct Input {
|
|
305
|
+
explicit Input(StringPiece range, json::serialization_opts const* opts)
|
|
306
|
+
: range_(range), opts_(*opts), lineNum_(0) {
|
|
307
|
+
storeCurrent();
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
Input(Input const&) = delete;
|
|
311
|
+
Input& operator=(Input const&) = delete;
|
|
312
|
+
|
|
313
|
+
char const* begin() const { return range_.begin(); }
|
|
314
|
+
|
|
315
|
+
unsigned getLineNum() const { return lineNum_; }
|
|
316
|
+
|
|
317
|
+
// Parse ahead for as long as the supplied predicate is satisfied,
|
|
318
|
+
// returning a range of what was skipped.
|
|
319
|
+
template <class Predicate>
|
|
320
|
+
StringPiece skipWhile(const Predicate& p) {
|
|
321
|
+
std::size_t skipped = 0;
|
|
322
|
+
for (; skipped < range_.size(); ++skipped) {
|
|
323
|
+
if (!p(range_[skipped])) {
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
if (range_[skipped] == '\n') {
|
|
327
|
+
++lineNum_;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
auto ret = range_.subpiece(0, skipped);
|
|
331
|
+
range_.advance(skipped);
|
|
332
|
+
storeCurrent();
|
|
333
|
+
return ret;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
StringPiece skipDigits() {
|
|
337
|
+
return skipWhile([](char c) { return c >= '0' && c <= '9'; });
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
StringPiece skipMinusAndDigits() {
|
|
341
|
+
bool firstChar = true;
|
|
342
|
+
return skipWhile([&firstChar](char c) {
|
|
343
|
+
bool result = (c >= '0' && c <= '9') || (firstChar && c == '-');
|
|
344
|
+
firstChar = false;
|
|
345
|
+
return result;
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
void skipWhitespace() {
|
|
350
|
+
// [Windows #12703 - CodeQL patch]
|
|
351
|
+
std::size_t index = 0;
|
|
352
|
+
while (true) {
|
|
353
|
+
while (index < range_.size() && range_[index] == ' ') {
|
|
354
|
+
index++;
|
|
355
|
+
}
|
|
356
|
+
if (index < range_.size()) {
|
|
357
|
+
if (range_[index] == '\n') {
|
|
358
|
+
index++;
|
|
359
|
+
++lineNum_;
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
if (range_[index] == '\t' || range_[index] == '\r') {
|
|
363
|
+
index++;
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
range_.advance(index);
|
|
370
|
+
storeCurrent();
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
void expect(char c) {
|
|
374
|
+
if (**this != c) {
|
|
375
|
+
throw json::make_parse_error(
|
|
376
|
+
lineNum_, context(), to<std::string>("expected '", c, '\''));
|
|
377
|
+
}
|
|
378
|
+
++*this;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
std::size_t size() const { return range_.size(); }
|
|
382
|
+
|
|
383
|
+
int operator*() const { return current_; }
|
|
384
|
+
|
|
385
|
+
void operator++() {
|
|
386
|
+
range_.pop_front();
|
|
387
|
+
storeCurrent();
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
template <class T>
|
|
391
|
+
T extract() {
|
|
392
|
+
try {
|
|
393
|
+
return to<T>(&range_);
|
|
394
|
+
} catch (std::exception const& e) {
|
|
395
|
+
error(e.what());
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
bool consume(StringPiece str) {
|
|
400
|
+
if (boost::starts_with(range_, str)) {
|
|
401
|
+
range_.advance(str.size());
|
|
402
|
+
storeCurrent();
|
|
403
|
+
return true;
|
|
404
|
+
}
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
std::string context() const {
|
|
409
|
+
return range_.subpiece(0, 16 /* arbitrary */).toString();
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
[[noreturn]] void error(char const* what) const {
|
|
413
|
+
throw json::make_parse_error(lineNum_, context(), what);
|
|
414
|
+
}
|
|
415
|
+
template <typename R>
|
|
416
|
+
R error(char const* what) const {
|
|
417
|
+
error(what);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
json::serialization_opts const& getOpts() { return opts_; }
|
|
421
|
+
|
|
422
|
+
void incrementRecursionLevel() {
|
|
423
|
+
if (currentRecursionLevel_ > opts_.recursion_limit) {
|
|
424
|
+
error("recursion limit exceeded");
|
|
425
|
+
}
|
|
426
|
+
currentRecursionLevel_++;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
void decrementRecursionLevel() { currentRecursionLevel_--; }
|
|
430
|
+
|
|
431
|
+
private:
|
|
432
|
+
void storeCurrent() { current_ = range_.empty() ? EOF : range_.front(); }
|
|
433
|
+
|
|
434
|
+
private:
|
|
435
|
+
StringPiece range_;
|
|
436
|
+
json::serialization_opts const& opts_;
|
|
437
|
+
unsigned lineNum_;
|
|
438
|
+
int current_;
|
|
439
|
+
unsigned int currentRecursionLevel_{0};
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
class RecursionGuard {
|
|
443
|
+
public:
|
|
444
|
+
explicit RecursionGuard(Input& in) : in_(in) {
|
|
445
|
+
in_.incrementRecursionLevel();
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
~RecursionGuard() { in_.decrementRecursionLevel(); }
|
|
449
|
+
|
|
450
|
+
private:
|
|
451
|
+
Input& in_;
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
dynamic parseValue(Input& in, json::metadata_map* map);
|
|
455
|
+
std::string parseString(Input& in);
|
|
456
|
+
dynamic parseNumber(Input& in);
|
|
457
|
+
|
|
458
|
+
void parseObjectKeyValue(
|
|
459
|
+
Input& in,
|
|
460
|
+
dynamic& ret,
|
|
461
|
+
dynamic&& key,
|
|
462
|
+
json::metadata_map* map,
|
|
463
|
+
bool distinct) {
|
|
464
|
+
auto keyLineNumber = in.getLineNum();
|
|
465
|
+
in.skipWhitespace();
|
|
466
|
+
in.expect(':');
|
|
467
|
+
in.skipWhitespace();
|
|
468
|
+
auto valueLineNumber = in.getLineNum();
|
|
469
|
+
auto value = parseValue(in, map);
|
|
470
|
+
auto [it, inserted] = ret.try_emplace(std::move(key), std::move(value));
|
|
471
|
+
if (!inserted) {
|
|
472
|
+
if (distinct) {
|
|
473
|
+
in.error("duplicate key inserted");
|
|
474
|
+
}
|
|
475
|
+
it->second = std::move(value);
|
|
476
|
+
}
|
|
477
|
+
if (map) {
|
|
478
|
+
map->emplace(
|
|
479
|
+
&it->second,
|
|
480
|
+
json::parse_metadata{{{keyLineNumber}}, {{valueLineNumber}}});
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
dynamic parseObject(Input& in, json::metadata_map* map) {
|
|
485
|
+
DCHECK_EQ(*in, '{');
|
|
486
|
+
++in;
|
|
487
|
+
|
|
488
|
+
dynamic ret = dynamic::object;
|
|
489
|
+
|
|
490
|
+
in.skipWhitespace();
|
|
491
|
+
if (*in == '}') {
|
|
492
|
+
++in;
|
|
493
|
+
return ret;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
const auto& opts = in.getOpts();
|
|
497
|
+
const bool distinct = opts.validate_keys || opts.convert_int_keys;
|
|
498
|
+
for (;;) {
|
|
499
|
+
if (opts.allow_trailing_comma && *in == '}') {
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
dynamic key = parseValue(in, map);
|
|
503
|
+
if (opts.convert_int_keys && key.isInt()) {
|
|
504
|
+
key = key.asString();
|
|
505
|
+
} else if (!opts.allow_non_string_keys && !key.isString()) {
|
|
506
|
+
in.error(
|
|
507
|
+
opts.convert_int_keys ? "expected string or integer for object key"
|
|
508
|
+
: "expected string for object key");
|
|
509
|
+
}
|
|
510
|
+
parseObjectKeyValue(in, ret, std::move(key), map, distinct);
|
|
511
|
+
|
|
512
|
+
in.skipWhitespace();
|
|
513
|
+
if (*in != ',') {
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
++in;
|
|
517
|
+
in.skipWhitespace();
|
|
518
|
+
}
|
|
519
|
+
in.expect('}');
|
|
520
|
+
|
|
521
|
+
return ret;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
dynamic parseArray(Input& in, json::metadata_map* map) {
|
|
525
|
+
DCHECK_EQ(*in, '[');
|
|
526
|
+
++in;
|
|
527
|
+
|
|
528
|
+
dynamic ret = dynamic::array;
|
|
529
|
+
|
|
530
|
+
in.skipWhitespace();
|
|
531
|
+
if (*in == ']') {
|
|
532
|
+
++in;
|
|
533
|
+
return ret;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
std::vector<uint32_t> lineNumbers;
|
|
537
|
+
for (;;) {
|
|
538
|
+
if (in.getOpts().allow_trailing_comma && *in == ']') {
|
|
539
|
+
break;
|
|
540
|
+
}
|
|
541
|
+
ret.push_back(parseValue(in, map));
|
|
542
|
+
if (map) {
|
|
543
|
+
lineNumbers.push_back(in.getLineNum());
|
|
544
|
+
}
|
|
545
|
+
in.skipWhitespace();
|
|
546
|
+
if (*in != ',') {
|
|
547
|
+
break;
|
|
548
|
+
}
|
|
549
|
+
++in;
|
|
550
|
+
in.skipWhitespace();
|
|
551
|
+
}
|
|
552
|
+
if (map) {
|
|
553
|
+
for (size_t i = 0, e = ret.size(); i < e; i++) {
|
|
554
|
+
map->emplace(&ret[i], json::parse_metadata{{{0}}, {{lineNumbers[i]}}});
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
in.expect(']');
|
|
558
|
+
|
|
559
|
+
return ret;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
dynamic parseNumber(Input& in) {
|
|
563
|
+
bool const negative = (*in == '-');
|
|
564
|
+
if (negative && in.consume("-Infinity")) {
|
|
565
|
+
if (in.getOpts().parse_numbers_as_strings) {
|
|
566
|
+
return "-Infinity";
|
|
567
|
+
} else {
|
|
568
|
+
return -std::numeric_limits<double>::infinity();
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
auto integral = in.skipMinusAndDigits();
|
|
573
|
+
if (negative && integral.size() < 2) {
|
|
574
|
+
in.error("expected digits after `-'");
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
auto const wasE = *in == 'e' || *in == 'E';
|
|
578
|
+
|
|
579
|
+
if (*in != '.' && !wasE && in.getOpts().parse_numbers_as_strings) {
|
|
580
|
+
return integral;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
constexpr const char* maxIntStr = "9223372036854775807";
|
|
584
|
+
constexpr const char* minIntStr = "-9223372036854775808";
|
|
585
|
+
constexpr auto maxIntLen = constexpr_strlen(maxIntStr);
|
|
586
|
+
constexpr auto minIntLen = constexpr_strlen(minIntStr);
|
|
587
|
+
auto extremaLen = negative ? minIntLen : maxIntLen;
|
|
588
|
+
auto extremaStr = negative ? minIntStr : maxIntStr;
|
|
589
|
+
if (*in != '.' && !wasE) {
|
|
590
|
+
if (FOLLY_LIKELY(
|
|
591
|
+
!in.getOpts().double_fallback || integral.size() < extremaLen) ||
|
|
592
|
+
(integral.size() == extremaLen && integral <= extremaStr)) {
|
|
593
|
+
auto val = to<int64_t>(integral);
|
|
594
|
+
in.skipWhitespace();
|
|
595
|
+
return val;
|
|
596
|
+
} else {
|
|
597
|
+
auto val = to<double>(integral);
|
|
598
|
+
in.skipWhitespace();
|
|
599
|
+
return val;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
auto end = !wasE ? (++in, in.skipDigits().end()) : in.begin();
|
|
604
|
+
if (*in == 'e' || *in == 'E') {
|
|
605
|
+
++in;
|
|
606
|
+
if (*in == '+' || *in == '-') {
|
|
607
|
+
++in;
|
|
608
|
+
}
|
|
609
|
+
auto expPart = in.skipDigits();
|
|
610
|
+
end = expPart.end();
|
|
611
|
+
}
|
|
612
|
+
auto fullNum = range(integral.begin(), end);
|
|
613
|
+
if (in.getOpts().parse_numbers_as_strings) {
|
|
614
|
+
return fullNum;
|
|
615
|
+
}
|
|
616
|
+
auto val = to<double>(fullNum);
|
|
617
|
+
return val;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
void decodeUnicodeEscape(Input& in, std::string& out) {
|
|
621
|
+
auto hexVal = [&](int c) -> uint16_t {
|
|
622
|
+
// clang-format off
|
|
623
|
+
return uint16_t(
|
|
624
|
+
c >= '0' && c <= '9' ? c - '0' :
|
|
625
|
+
c >= 'a' && c <= 'f' ? c - 'a' + 10 :
|
|
626
|
+
c >= 'A' && c <= 'F' ? c - 'A' + 10 :
|
|
627
|
+
in.error<uint16_t>("invalid hex digit"));
|
|
628
|
+
// clang-format on
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
auto readHex = [&]() -> uint16_t {
|
|
632
|
+
if (in.size() < 4) {
|
|
633
|
+
in.error("expected 4 hex digits");
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
auto ret = uint16_t(hexVal(*in) * 4096);
|
|
637
|
+
++in;
|
|
638
|
+
ret += hexVal(*in) * 256;
|
|
639
|
+
++in;
|
|
640
|
+
ret += hexVal(*in) * 16;
|
|
641
|
+
++in;
|
|
642
|
+
ret += hexVal(*in);
|
|
643
|
+
++in;
|
|
644
|
+
return ret;
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
// If the value encoded is in the surrogate pair range, we need to make
|
|
648
|
+
// sure there is another escape that we can use also.
|
|
649
|
+
//
|
|
650
|
+
// See the explanation in folly/Unicode.h.
|
|
651
|
+
uint16_t prefix = readHex();
|
|
652
|
+
char32_t codePoint = prefix;
|
|
653
|
+
if (utf16_code_unit_is_high_surrogate(prefix)) {
|
|
654
|
+
if (!in.consume("\\u")) {
|
|
655
|
+
in.error(
|
|
656
|
+
"expected another unicode escape for second half of "
|
|
657
|
+
"surrogate pair");
|
|
658
|
+
}
|
|
659
|
+
uint16_t suffix = readHex();
|
|
660
|
+
if (!utf16_code_unit_is_low_surrogate(suffix)) {
|
|
661
|
+
in.error("second character in surrogate pair is invalid");
|
|
662
|
+
}
|
|
663
|
+
codePoint = unicode_code_point_from_utf16_surrogate_pair(prefix, suffix);
|
|
664
|
+
} else if (!utf16_code_unit_is_bmp(prefix)) {
|
|
665
|
+
in.error("invalid unicode code point (in range [0xdc00,0xdfff])");
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
appendCodePointToUtf8(codePoint, out);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
std::string parseString(Input& in) {
|
|
672
|
+
DCHECK_EQ(*in, '\"');
|
|
673
|
+
++in;
|
|
674
|
+
|
|
675
|
+
std::string ret;
|
|
676
|
+
for (;;) {
|
|
677
|
+
auto range = in.skipWhile([](char c) { return c != '\"' && c != '\\'; });
|
|
678
|
+
ret.append(range.begin(), range.end());
|
|
679
|
+
|
|
680
|
+
if (*in == '\"') {
|
|
681
|
+
++in;
|
|
682
|
+
break;
|
|
683
|
+
}
|
|
684
|
+
if (*in == '\\') {
|
|
685
|
+
++in;
|
|
686
|
+
switch (*in) {
|
|
687
|
+
// clang-format off
|
|
688
|
+
case '\"': ret.push_back('\"'); ++in; break;
|
|
689
|
+
case '\\': ret.push_back('\\'); ++in; break;
|
|
690
|
+
case '/': ret.push_back('/'); ++in; break;
|
|
691
|
+
case 'b': ret.push_back('\b'); ++in; break;
|
|
692
|
+
case 'f': ret.push_back('\f'); ++in; break;
|
|
693
|
+
case 'n': ret.push_back('\n'); ++in; break;
|
|
694
|
+
case 'r': ret.push_back('\r'); ++in; break;
|
|
695
|
+
case 't': ret.push_back('\t'); ++in; break;
|
|
696
|
+
case 'u': ++in; decodeUnicodeEscape(in, ret); break;
|
|
697
|
+
// clang-format on
|
|
698
|
+
default:
|
|
699
|
+
in.error(
|
|
700
|
+
to<std::string>("unknown escape ", *in, " in string").c_str());
|
|
701
|
+
}
|
|
702
|
+
continue;
|
|
703
|
+
}
|
|
704
|
+
if (*in == EOF) {
|
|
705
|
+
in.error("unterminated string");
|
|
706
|
+
}
|
|
707
|
+
if (!*in) {
|
|
708
|
+
/*
|
|
709
|
+
* Apparently we're actually supposed to ban all control
|
|
710
|
+
* characters from strings. This seems unnecessarily
|
|
711
|
+
* restrictive, so we're only banning zero bytes. (Since the
|
|
712
|
+
* string is presumed to be UTF-8 encoded it's fine to just
|
|
713
|
+
* check this way.)
|
|
714
|
+
*/
|
|
715
|
+
in.error("null byte in string");
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
ret.push_back(char(*in));
|
|
719
|
+
++in;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
return ret;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
dynamic parseValue(Input& in, json::metadata_map* map) {
|
|
726
|
+
RecursionGuard guard(in);
|
|
727
|
+
|
|
728
|
+
in.skipWhitespace();
|
|
729
|
+
// clang-format off
|
|
730
|
+
return
|
|
731
|
+
*in == '[' ? parseArray(in, map) :
|
|
732
|
+
*in == '{' ? parseObject(in, map) :
|
|
733
|
+
*in == '\"' ? parseString(in) :
|
|
734
|
+
(*in == '-' || (*in >= '0' && *in <= '9')) ? parseNumber(in) :
|
|
735
|
+
in.consume("true") ? true :
|
|
736
|
+
in.consume("false") ? false :
|
|
737
|
+
in.consume("null") ? nullptr :
|
|
738
|
+
in.consume("Infinity") ?
|
|
739
|
+
(in.getOpts().parse_numbers_as_strings ? (dynamic)"Infinity" :
|
|
740
|
+
(dynamic)std::numeric_limits<double>::infinity()) :
|
|
741
|
+
in.consume("NaN") ?
|
|
742
|
+
(in.getOpts().parse_numbers_as_strings ? (dynamic)"NaN" :
|
|
743
|
+
(dynamic)std::numeric_limits<double>::quiet_NaN()) :
|
|
744
|
+
in.error<dynamic>("expected json value");
|
|
745
|
+
// clang-format on
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
} // namespace
|
|
749
|
+
|
|
750
|
+
//////////////////////////////////////////////////////////////////////
|
|
751
|
+
|
|
752
|
+
std::array<uint64_t, 2> buildExtraAsciiToEscapeBitmap(StringPiece chars) {
|
|
753
|
+
std::array<uint64_t, 2> escapes{{0, 0}};
|
|
754
|
+
for (auto b : ByteRange(chars)) {
|
|
755
|
+
if (b >= 0x20 && b < 0x80) {
|
|
756
|
+
escapes[b / 64] |= uint64_t(1) << (b % 64);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
return escapes;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
std::string serialize(dynamic const& dyn, serialization_opts const& opts) {
|
|
763
|
+
std::string ret;
|
|
764
|
+
unsigned indentLevel = 0;
|
|
765
|
+
Printer p(ret, opts.pretty_formatting ? &indentLevel : nullptr, &opts);
|
|
766
|
+
p(dyn, nullptr);
|
|
767
|
+
return ret;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
// Fast path to determine the longest prefix that can be left
|
|
771
|
+
// unescaped in a string of sizeof(T) bytes packed in an integer of
|
|
772
|
+
// type T.
|
|
773
|
+
template <bool EnableExtraAsciiEscapes, class T>
|
|
774
|
+
size_t firstEscapableInWord(T s, const serialization_opts& opts) {
|
|
775
|
+
static_assert(std::is_unsigned<T>::value, "Unsigned integer required");
|
|
776
|
+
static constexpr T kOnes = ~T() / 255; // 0x...0101
|
|
777
|
+
static constexpr T kMsbs = kOnes * 0x80; // 0x...8080
|
|
778
|
+
|
|
779
|
+
// Sets the MSB of bytes < b. Precondition: b < 128.
|
|
780
|
+
auto isLess = [](T w, uint8_t b) {
|
|
781
|
+
// A byte is < b iff subtracting b underflows, so we check that
|
|
782
|
+
// the MSB wasn't set before and it's set after the subtraction.
|
|
783
|
+
return (w - kOnes * b) & ~w & kMsbs;
|
|
784
|
+
};
|
|
785
|
+
|
|
786
|
+
auto isChar = [&](uint8_t c) {
|
|
787
|
+
// A byte is == c iff it is 0 if xor'd with c.
|
|
788
|
+
return isLess(s ^ (kOnes * c), 1);
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
// The following masks have the MSB set for each byte of the word
|
|
792
|
+
// that satisfies the corresponding condition.
|
|
793
|
+
auto isHigh = s & kMsbs; // >= 128
|
|
794
|
+
auto isLow = isLess(s, 0x20); // <= 0x1f
|
|
795
|
+
auto needsEscape = isHigh | isLow | isChar('\\') | isChar('"');
|
|
796
|
+
|
|
797
|
+
if /* constexpr */ (EnableExtraAsciiEscapes) {
|
|
798
|
+
// Deal with optional bitmap for unicode escapes. Escapes can optionally be
|
|
799
|
+
// set for ascii characters 32 - 127, so the inner loop may run up to 96
|
|
800
|
+
// times. However, for the case where 0 or a handful of bits are set,
|
|
801
|
+
// looping will be minimal through use of findFirstSet.
|
|
802
|
+
for (size_t i = 0, e = opts.extra_ascii_to_escape_bitmap.size(); i < e;
|
|
803
|
+
++i) {
|
|
804
|
+
const auto offset = i * 64;
|
|
805
|
+
// Clear first 32 characters if this is the first index, since those are
|
|
806
|
+
// always escaped.
|
|
807
|
+
auto bitmap = opts.extra_ascii_to_escape_bitmap[i] &
|
|
808
|
+
(i == 0 ? uint64_t(-1) << 32 : ~0ULL);
|
|
809
|
+
while (bitmap) {
|
|
810
|
+
auto bit = folly::findFirstSet(bitmap);
|
|
811
|
+
needsEscape |= isChar(static_cast<uint8_t>(offset + bit - 1));
|
|
812
|
+
bitmap &= bitmap - 1;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
if (!needsEscape) {
|
|
818
|
+
return sizeof(T);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
if (folly::kIsLittleEndian) {
|
|
822
|
+
return folly::findFirstSet(needsEscape) / 8 - 1;
|
|
823
|
+
} else {
|
|
824
|
+
return sizeof(T) - folly::findLastSet(needsEscape) / 8;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
// Escape a string so that it is legal to print it in JSON text.
|
|
829
|
+
template <bool EnableExtraAsciiEscapes>
|
|
830
|
+
void escapeStringImpl(
|
|
831
|
+
StringPiece input, std::string& out, const serialization_opts& opts) {
|
|
832
|
+
auto hexDigit = [](uint8_t c) -> char {
|
|
833
|
+
return c < 10 ? c + '0' : c - 10 + 'a';
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
out.push_back('\"');
|
|
837
|
+
|
|
838
|
+
auto* p = reinterpret_cast<const unsigned char*>(input.begin());
|
|
839
|
+
auto* q = reinterpret_cast<const unsigned char*>(input.begin());
|
|
840
|
+
auto* e = reinterpret_cast<const unsigned char*>(input.end());
|
|
841
|
+
|
|
842
|
+
while (p < e) {
|
|
843
|
+
// Find the longest prefix that does not need escaping, and copy
|
|
844
|
+
// it literally into the output string.
|
|
845
|
+
auto firstEsc = p;
|
|
846
|
+
while (firstEsc < e) {
|
|
847
|
+
auto avail = to_unsigned(e - firstEsc);
|
|
848
|
+
uint64_t word = 0;
|
|
849
|
+
if (avail >= 8) {
|
|
850
|
+
word = folly::loadUnaligned<uint64_t>(firstEsc);
|
|
851
|
+
} else {
|
|
852
|
+
word = folly::partialLoadUnaligned<uint64_t>(firstEsc, avail);
|
|
853
|
+
}
|
|
854
|
+
auto prefix = firstEscapableInWord<EnableExtraAsciiEscapes>(word, opts);
|
|
855
|
+
DCHECK_LE(prefix, avail);
|
|
856
|
+
// [Windows Sometimes prefix is completely wrong (corrupt?), only in Release, causing a later AV (see issue #14394).
|
|
857
|
+
// Prefix should always be <= avail, capping it here as a workaround, hoping the assert above eventually catches this in Debug.
|
|
858
|
+
prefix = std::min(prefix, (size_t)avail);
|
|
859
|
+
// Windows]
|
|
860
|
+
firstEsc += prefix;
|
|
861
|
+
if (prefix < 8) {
|
|
862
|
+
break;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
if (firstEsc > p) {
|
|
866
|
+
out.append(reinterpret_cast<const char*>(p), firstEsc - p);
|
|
867
|
+
p = firstEsc;
|
|
868
|
+
// We can't be in the middle of a multibyte sequence, so we can reset q.
|
|
869
|
+
q = p;
|
|
870
|
+
if (p == e) {
|
|
871
|
+
break;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
// Handle the next byte that may need escaping.
|
|
876
|
+
|
|
877
|
+
// Since non-ascii encoding inherently does utf8 validation
|
|
878
|
+
// we explicitly validate utf8 only if non-ascii encoding is disabled.
|
|
879
|
+
if ((opts.validate_utf8 || opts.skip_invalid_utf8) &&
|
|
880
|
+
!opts.encode_non_ascii) {
|
|
881
|
+
// To achieve better spatial and temporal coherence
|
|
882
|
+
// we do utf8 validation progressively along with the
|
|
883
|
+
// string-escaping instead of two separate passes.
|
|
884
|
+
|
|
885
|
+
// As the encoding progresses, q will stay at or ahead of p.
|
|
886
|
+
CHECK_GE(q, p);
|
|
887
|
+
|
|
888
|
+
// As p catches up with q, move q forward.
|
|
889
|
+
if (q == p) {
|
|
890
|
+
// calling utf8_decode has the side effect of
|
|
891
|
+
// checking that utf8 encodings are valid
|
|
892
|
+
char32_t v = utf8ToCodePoint(q, e, opts.skip_invalid_utf8);
|
|
893
|
+
if (opts.skip_invalid_utf8 && v == U'\ufffd') {
|
|
894
|
+
out.append(reinterpret_cast<const char*>(u8"\ufffd"));
|
|
895
|
+
p = q;
|
|
896
|
+
continue;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
auto encodeUnicode = opts.encode_non_ascii && (*p & 0x80);
|
|
902
|
+
if /* constexpr */ (EnableExtraAsciiEscapes) {
|
|
903
|
+
encodeUnicode = encodeUnicode ||
|
|
904
|
+
(*p >= 0x20 && *p < 0x80 &&
|
|
905
|
+
(opts.extra_ascii_to_escape_bitmap[*p / 64] &
|
|
906
|
+
(uint64_t(1) << (*p % 64))));
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
if (encodeUnicode) {
|
|
910
|
+
// note that this if condition captures utf8 chars
|
|
911
|
+
// with value > 127, so size > 1 byte (or they are allowlisted for
|
|
912
|
+
// Unicode encoding).
|
|
913
|
+
// NOTE: char32_t / char16_t are both unsigned.
|
|
914
|
+
char32_t cp = utf8ToCodePoint(p, e, opts.skip_invalid_utf8);
|
|
915
|
+
auto writeHex = [&](char16_t v) {
|
|
916
|
+
char buf[] = "\\u\0\0\0\0";
|
|
917
|
+
buf[2] = hexDigit((v >> 12) & 0x0f);
|
|
918
|
+
buf[3] = hexDigit((v >> 8) & 0x0f);
|
|
919
|
+
buf[4] = hexDigit((v >> 4) & 0x0f);
|
|
920
|
+
buf[5] = hexDigit(v & 0x0f);
|
|
921
|
+
out.append(buf, 6);
|
|
922
|
+
};
|
|
923
|
+
// From the ECMA-404 The JSON Data Interchange Syntax 2nd Edition Dec 2017
|
|
924
|
+
if (cp < 0x10000u) {
|
|
925
|
+
// If the code point is in the Basic Multilingual Plane (U+0000 through
|
|
926
|
+
// U+FFFF), then it may be represented as a six-character sequence:
|
|
927
|
+
// a reverse solidus, followed by the lowercase letter u, followed by
|
|
928
|
+
// four hexadecimal digits that encode the code point.
|
|
929
|
+
writeHex(static_cast<char16_t>(cp));
|
|
930
|
+
} else {
|
|
931
|
+
// To escape a code point that is not in the Basic Multilingual Plane,
|
|
932
|
+
// the character may be represented as a twelve-character sequence,
|
|
933
|
+
// encoding the UTF-16 surrogate pair corresponding to the code point.
|
|
934
|
+
writeHex(static_cast<char16_t>(
|
|
935
|
+
0xd800u + (((cp - 0x10000u) >> 10) & 0x3ffu)));
|
|
936
|
+
writeHex(static_cast<char16_t>(0xdc00u + ((cp - 0x10000u) & 0x3ffu)));
|
|
937
|
+
}
|
|
938
|
+
} else if (*p == '\\' || *p == '\"') {
|
|
939
|
+
char buf[] = "\\\0";
|
|
940
|
+
buf[1] = char(*p++);
|
|
941
|
+
out.append(buf, 2);
|
|
942
|
+
} else if (*p <= 0x1f) {
|
|
943
|
+
switch (*p) {
|
|
944
|
+
// clang-format off
|
|
945
|
+
case '\b': out.append("\\b"); p++; break;
|
|
946
|
+
case '\f': out.append("\\f"); p++; break;
|
|
947
|
+
case '\n': out.append("\\n"); p++; break;
|
|
948
|
+
case '\r': out.append("\\r"); p++; break;
|
|
949
|
+
case '\t': out.append("\\t"); p++; break;
|
|
950
|
+
// clang-format on
|
|
951
|
+
default:
|
|
952
|
+
// Note that this if condition captures non readable chars
|
|
953
|
+
// with value < 32, so size = 1 byte (e.g control chars).
|
|
954
|
+
char buf[] = "\\u00\0\0";
|
|
955
|
+
buf[4] = hexDigit(uint8_t((*p & 0xf0) >> 4));
|
|
956
|
+
buf[5] = hexDigit(uint8_t(*p & 0xf));
|
|
957
|
+
out.append(buf, 6);
|
|
958
|
+
p++;
|
|
959
|
+
}
|
|
960
|
+
} else {
|
|
961
|
+
out.push_back(char(*p++));
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
out.push_back('\"');
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
void escapeString(
|
|
969
|
+
StringPiece input, std::string& out, const serialization_opts& opts) {
|
|
970
|
+
if (FOLLY_UNLIKELY(
|
|
971
|
+
opts.extra_ascii_to_escape_bitmap[0] ||
|
|
972
|
+
opts.extra_ascii_to_escape_bitmap[1])) {
|
|
973
|
+
escapeStringImpl<true>(input, out, opts);
|
|
974
|
+
} else {
|
|
975
|
+
escapeStringImpl<false>(input, out, opts);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
std::string stripComments(StringPiece jsonC) {
|
|
980
|
+
std::string result;
|
|
981
|
+
enum class State {
|
|
982
|
+
None,
|
|
983
|
+
InString,
|
|
984
|
+
InlineComment,
|
|
985
|
+
LineComment
|
|
986
|
+
} state = State::None;
|
|
987
|
+
|
|
988
|
+
for (size_t i = 0; i < jsonC.size(); ++i) {
|
|
989
|
+
auto s = jsonC.subpiece(i);
|
|
990
|
+
switch (state) {
|
|
991
|
+
case State::None:
|
|
992
|
+
if (s.startsWith("/*")) {
|
|
993
|
+
state = State::InlineComment;
|
|
994
|
+
++i;
|
|
995
|
+
continue;
|
|
996
|
+
} else if (s.startsWith("//")) {
|
|
997
|
+
state = State::LineComment;
|
|
998
|
+
++i;
|
|
999
|
+
continue;
|
|
1000
|
+
} else if (s[0] == '\"') {
|
|
1001
|
+
state = State::InString;
|
|
1002
|
+
}
|
|
1003
|
+
result.push_back(s[0]);
|
|
1004
|
+
break;
|
|
1005
|
+
case State::InString:
|
|
1006
|
+
if (s[0] == '\\') {
|
|
1007
|
+
if (FOLLY_UNLIKELY(s.size() == 1)) {
|
|
1008
|
+
throw std::logic_error("Invalid JSONC: string is not terminated");
|
|
1009
|
+
}
|
|
1010
|
+
result.push_back(s[0]);
|
|
1011
|
+
result.push_back(s[1]);
|
|
1012
|
+
++i;
|
|
1013
|
+
continue;
|
|
1014
|
+
} else if (s[0] == '\"') {
|
|
1015
|
+
state = State::None;
|
|
1016
|
+
}
|
|
1017
|
+
result.push_back(s[0]);
|
|
1018
|
+
break;
|
|
1019
|
+
case State::InlineComment:
|
|
1020
|
+
if (s.startsWith('\n')) {
|
|
1021
|
+
// preserve the line break to preserve the line count
|
|
1022
|
+
result.push_back(s[0]);
|
|
1023
|
+
} else if (s.startsWith("*/")) {
|
|
1024
|
+
state = State::None;
|
|
1025
|
+
++i;
|
|
1026
|
+
}
|
|
1027
|
+
break;
|
|
1028
|
+
case State::LineComment:
|
|
1029
|
+
if (s[0] == '\n') {
|
|
1030
|
+
// preserve the line break to preserve the line count
|
|
1031
|
+
result.push_back(s[0]);
|
|
1032
|
+
state = State::None;
|
|
1033
|
+
}
|
|
1034
|
+
break;
|
|
1035
|
+
default:
|
|
1036
|
+
throw std::logic_error("Unknown comment state");
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return result;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
} // namespace json
|
|
1043
|
+
|
|
1044
|
+
//////////////////////////////////////////////////////////////////////
|
|
1045
|
+
|
|
1046
|
+
dynamic parseJsonWithMetadata(StringPiece range, json::metadata_map* map) {
|
|
1047
|
+
return parseJsonWithMetadata(range, json::serialization_opts(), map);
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
dynamic parseJsonWithMetadata(
|
|
1051
|
+
StringPiece range,
|
|
1052
|
+
json::serialization_opts const& opts,
|
|
1053
|
+
json::metadata_map* map) {
|
|
1054
|
+
json::Input in(range, &opts);
|
|
1055
|
+
|
|
1056
|
+
uint32_t n = in.getLineNum();
|
|
1057
|
+
auto ret = parseValue(in, map);
|
|
1058
|
+
if (map) {
|
|
1059
|
+
map->emplace(&ret, json::parse_metadata{{{0}}, {{n}}});
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
in.skipWhitespace();
|
|
1063
|
+
if (in.size() && *in != '\0') {
|
|
1064
|
+
in.error("parsing didn't consume all input");
|
|
1065
|
+
}
|
|
1066
|
+
return ret;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
dynamic parseJson(StringPiece range) {
|
|
1070
|
+
return parseJson(range, json::serialization_opts());
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
dynamic parseJson(StringPiece range, json::serialization_opts const& opts) {
|
|
1074
|
+
json::Input in(range, &opts);
|
|
1075
|
+
|
|
1076
|
+
auto ret = parseValue(in, nullptr);
|
|
1077
|
+
in.skipWhitespace();
|
|
1078
|
+
if (in.size() && *in != '\0') {
|
|
1079
|
+
in.error("parsing didn't consume all input");
|
|
1080
|
+
}
|
|
1081
|
+
return ret;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
std::string toJson(dynamic const& dyn) {
|
|
1085
|
+
return json::serialize(dyn, json::serialization_opts());
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
std::string toPrettyJson(dynamic const& dyn) {
|
|
1089
|
+
json::serialization_opts opts;
|
|
1090
|
+
opts.pretty_formatting = true;
|
|
1091
|
+
opts.sort_keys = true;
|
|
1092
|
+
return json::serialize(dyn, opts);
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
//////////////////////////////////////////////////////////////////////
|
|
1096
|
+
// dynamic::print_as_pseudo_json() is implemented here for header
|
|
1097
|
+
// ordering reasons (most of the dynamic implementation is in
|
|
1098
|
+
// dynamic-inl.h, which we don't want to include json.h).
|
|
1099
|
+
|
|
1100
|
+
void dynamic::print_as_pseudo_json(std::ostream& out) const {
|
|
1101
|
+
json::serialization_opts opts;
|
|
1102
|
+
opts.allow_non_string_keys = true;
|
|
1103
|
+
opts.allow_nan_inf = true;
|
|
1104
|
+
out << json::serialize(*this, opts);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
void PrintTo(const dynamic& dyn, std::ostream* os) {
|
|
1108
|
+
json::serialization_opts opts;
|
|
1109
|
+
opts.allow_nan_inf = true;
|
|
1110
|
+
opts.allow_non_string_keys = true;
|
|
1111
|
+
opts.pretty_formatting = true;
|
|
1112
|
+
opts.sort_keys = true;
|
|
1113
|
+
*os << json::serialize(dyn, opts);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
//////////////////////////////////////////////////////////////////////
|
|
1117
|
+
|
|
1118
|
+
} // namespace folly
|