passenger 6.1.0 → 6.1.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG +32 -2
- data/Rakefile +6 -13
- data/bin/passenger-install-apache2-module +15 -19
- data/bin/passenger-install-nginx-module +42 -44
- data/bin/passenger-status +9 -10
- data/build/common_library.rb +4 -4
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/builder.rb +1 -1
- data/build/test_basics.rb +4 -3
- data/dev/copy_boost_headers +54 -40
- data/dev/ruby_server.rb +1 -1
- data/src/agent/Core/Config.h +1 -1
- data/src/agent/Core/Controller/Config.h +1 -1
- data/src/agent/Watchdog/Config.h +1 -1
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/assert/source_location.hpp +8 -1
- data/src/cxx_supportlib/vendor-modified/boost/assert.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/atomic.hpp +94 -110
- data/src/cxx_supportlib/vendor-modified/boost/atomic/atomic_flag.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/atomic/atomic_ref.hpp +14 -14
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/addressof.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/atomic_flag_impl.hpp +52 -24
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/atomic_impl.hpp +641 -285
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/atomic_ref_impl.hpp +593 -260
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/bitwise_cast.hpp +37 -24
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/bitwise_fp_cast.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/cas_based_exchange.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/chrono.hpp +93 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/classify.hpp +16 -17
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/config.hpp +25 -34
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_gcc_aarch32.hpp +204 -97
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_gcc_aarch64.hpp +251 -122
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_gcc_alpha.hpp +56 -56
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_gcc_arm.hpp +129 -129
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_gcc_ppc.hpp +253 -125
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_gcc_sparc.hpp +25 -25
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_gcc_x86.hpp +193 -126
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_msvc_arm.hpp +57 -57
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_msvc_x86.hpp +96 -97
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_operations_emulated.hpp +24 -24
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_ops_cas_based.hpp +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_ops_gcc_atomic.hpp +27 -24
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_ops_gcc_sync.hpp +39 -37
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_ops_linux_arm.hpp +17 -17
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extending_cas_based_arithmetic.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_fp_ops_emulated.hpp +12 -12
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_fp_ops_generic.hpp +21 -21
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_emulated.hpp +30 -30
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_gcc_aarch32.hpp +170 -98
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_gcc_aarch64.hpp +209 -119
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_gcc_arm.hpp +95 -95
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_gcc_ppc.hpp +148 -76
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_gcc_x86.hpp +293 -123
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_generic.hpp +87 -71
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_msvc_arm.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/extra_ops_msvc_x86.hpp +88 -88
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_arch_operations.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_arch_ops_gcc_aarch32.hpp +4 -5
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_arch_ops_gcc_aarch64.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_arch_ops_gcc_alpha.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_arch_ops_gcc_arm.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_arch_ops_gcc_ppc.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_arch_ops_gcc_sparc.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_arch_ops_gcc_x86.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_arch_ops_msvc_arm.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_arch_ops_msvc_x86.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_operations.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_operations_emulated.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_ops_gcc_atomic.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_ops_gcc_sync.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fence_ops_linux_arm.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fp_ops_emulated.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/fp_ops_generic.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/futex.hpp +110 -49
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/gcc_atomic_memory_order_utils.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/has_posix_clock_traits.hpp +51 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/int_sizes.hpp +26 -32
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/integral_conversions.hpp +15 -15
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/interlocked.hpp +69 -30
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/intptr.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/lock_pool.hpp +51 -31
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/memory_order_utils.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/once_flag.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_arm_common.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/ops_gcc_ppc_common.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/platform.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/storage_traits.hpp +31 -31
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/alignment_of.hpp +2 -3
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/has_unique_object_representations.hpp +2 -5
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_floating_point.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_iec559.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_integral.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_signed.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_trivially_copyable.hpp +20 -13
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_trivially_default_constructible.hpp +13 -13
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/make_signed.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/make_unsigned.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/wait_ops_darwin_ulock.hpp +90 -16
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/wait_ops_dragonfly_umtx.hpp +80 -11
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/wait_ops_emulated.hpp +160 -15
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/wait_ops_freebsd_umtx.hpp +327 -38
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/wait_ops_futex.hpp +276 -33
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/wait_ops_generic.hpp +260 -20
- data/src/cxx_supportlib/vendor-modified/boost/atomic/fences.hpp +4 -3
- data/src/cxx_supportlib/vendor-modified/boost/atomic/ipc_atomic.hpp +14 -18
- data/src/cxx_supportlib/vendor-modified/boost/atomic/ipc_atomic_flag.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/atomic/ipc_atomic_ref.hpp +13 -13
- data/src/cxx_supportlib/vendor-modified/boost/atomic/posix_clock_traits_fwd.hpp +59 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/thread_pause.hpp +102 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic/wait_result.hpp +56 -0
- data/src/cxx_supportlib/vendor-modified/boost/atomic.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcpp.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator_traits.hpp +108 -41
- data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +1235 -1009
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/algorithm.hpp +56 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/alloc_helpers.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/alloc_lib.h +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/compare_functors.hpp +23 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_begin.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +88 -23
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool_impl.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/operator_new_helpers.hpp +68 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair.hpp +72 -13
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/std_fwd.hpp +13 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/tree.hpp +8 -5
- data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +31 -10
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_map.hpp +37 -10
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_set.hpp +19 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/list.hpp +23 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/map.hpp +72 -5
- data/src/cxx_supportlib/vendor-modified/boost/container/new_allocator.hpp +3 -10
- data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +54 -23
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/devector.hpp +6 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/set.hpp +19 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/slist.hpp +32 -5
- data/src/cxx_supportlib/vendor-modified/boost/container/small_vector.hpp +27 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +22 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/static_vector.hpp +37 -17
- data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +23 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +41 -20
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash.hpp +5 -8
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash_fwd.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash_is_avalanching.hpp +57 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/bit.hpp +29 -29
- data/src/cxx_supportlib/vendor-modified/boost/core/cmath.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/core/data.hpp +15 -1
- data/src/cxx_supportlib/vendor-modified/boost/core/default_allocator.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/demangle.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/core/detail/assert.hpp +18 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/detail/sp_thread_sleep.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/core/detail/static_assert.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/detail/string_view.hpp +16 -10
- data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test.hpp +35 -27
- data/src/cxx_supportlib/vendor-modified/boost/core/scoped_enum.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/core/size.hpp +14 -0
- data/src/cxx_supportlib/vendor-modified/boost/core/span.hpp +20 -9
- data/src/cxx_supportlib/vendor-modified/boost/cregex.hpp +0 -5
- data/src/cxx_supportlib/vendor-modified/boost/describe/detail/config.hpp +8 -0
- data/src/cxx_supportlib/vendor-modified/boost/describe/modifiers.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/foreach.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/ebo_functor_holder.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/list.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/pointer_rebind.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/rbtree_algorithms.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/slist.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/iterator/advance.hpp +43 -64
- data/src/cxx_supportlib/vendor-modified/boost/iterator/detail/config_def.hpp +0 -83
- data/src/cxx_supportlib/vendor-modified/boost/iterator/detail/config_undef.hpp +1 -5
- data/src/cxx_supportlib/vendor-modified/boost/iterator/detail/eval_if_default.hpp +44 -0
- data/src/cxx_supportlib/vendor-modified/boost/iterator/detail/facade_iterator_category.hpp +103 -117
- data/src/cxx_supportlib/vendor-modified/boost/iterator/detail/type_traits/conjunction.hpp +53 -0
- data/src/cxx_supportlib/vendor-modified/boost/iterator/detail/type_traits/disjunction.hpp +53 -0
- data/src/cxx_supportlib/vendor-modified/boost/iterator/detail/type_traits/negation.hpp +53 -0
- data/src/cxx_supportlib/vendor-modified/boost/iterator/detail/type_traits/type_identity.hpp +54 -0
- data/src/cxx_supportlib/vendor-modified/boost/iterator/distance.hpp +32 -38
- data/src/cxx_supportlib/vendor-modified/boost/iterator/enable_if_convertible.hpp +84 -0
- data/src/cxx_supportlib/vendor-modified/boost/iterator/interoperable.hpp +22 -34
- data/src/cxx_supportlib/vendor-modified/boost/iterator/is_iterator.hpp +16 -16
- data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_adaptor.hpp +162 -309
- data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_categories.hpp +52 -161
- data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_concepts.hpp +3 -11
- data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_facade.hpp +804 -977
- data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_traits.hpp +24 -17
- data/src/cxx_supportlib/vendor-modified/boost/iterator/min_category.hpp +83 -0
- data/src/cxx_supportlib/vendor-modified/boost/iterator/minimum_category.hpp +11 -73
- data/src/cxx_supportlib/vendor-modified/boost/iterator/reverse_iterator.hpp +56 -57
- data/src/cxx_supportlib/vendor-modified/boost/iterator/transform_iterator.hpp +123 -156
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/bad_lexical_cast.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/buffer_view.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical.hpp +36 -33
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +43 -50
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +23 -27
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/inf_nan.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/is_character.hpp +10 -11
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_basic_unlockedbuf.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_char_constants.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_unsigned_converters.hpp +6 -7
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/type_traits.hpp +81 -0
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/widest_char.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/try_lexical_convert.hpp +8 -9
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/libs/regex/src/wide_posix_api.cpp +1 -12
- data/src/cxx_supportlib/vendor-modified/boost/memory_order.hpp +8 -26
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/iterator_to_raw_pointer.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/launder.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/std_ns_begin.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/unique_ptr_meta_utils.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/mp11/algorithm.hpp +11 -44
- data/src/cxx_supportlib/vendor-modified/boost/mp11/detail/mp_map_find.hpp +34 -0
- data/src/cxx_supportlib/vendor-modified/boost/mp11/set.hpp +33 -1
- data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/mpl/and.hpp +4 -8
- data/src/cxx_supportlib/vendor-modified/boost/mpl/aux_/na_assert.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/mpl/aux_/ptr_to_ref.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/mpl/bitand.hpp +2 -6
- data/src/cxx_supportlib/vendor-modified/boost/mpl/bitor.hpp +2 -6
- data/src/cxx_supportlib/vendor-modified/boost/mpl/or.hpp +2 -6
- data/src/cxx_supportlib/vendor-modified/boost/pool/pool.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/pool/simple_segregated_storage.hpp +0 -13
- data/src/cxx_supportlib/vendor-modified/boost/preprocessor/tuple/limits/to_seq_256.hpp +190 -190
- data/src/cxx_supportlib/vendor-modified/boost/random/beta_distribution.hpp +12 -2
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/config.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/size.hpp +41 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/xoshiro_base.hpp +472 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/discrete_distribution.hpp +7 -10
- data/src/cxx_supportlib/vendor-modified/boost/random/gamma_distribution.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/random/generalized_inverse_gaussian_distribution.hpp +339 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/hyperexponential_distribution.hpp +12 -14
- data/src/cxx_supportlib/vendor-modified/boost/random/inverse_gaussian_distribution.hpp +226 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/mersenne_twister.hpp +1 -4
- data/src/cxx_supportlib/vendor-modified/boost/random/mixmax.hpp +63 -63
- data/src/cxx_supportlib/vendor-modified/boost/random/piecewise_constant_distribution.hpp +7 -10
- data/src/cxx_supportlib/vendor-modified/boost/random/piecewise_linear_distribution.hpp +8 -11
- data/src/cxx_supportlib/vendor-modified/boost/random/seed_seq.hpp +1 -3
- data/src/cxx_supportlib/vendor-modified/boost/random/splitmix64.hpp +1 -4
- data/src/cxx_supportlib/vendor-modified/boost/random/xoshiro.hpp +488 -0
- data/src/cxx_supportlib/vendor-modified/boost/random.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/range/concepts.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/range/detail/has_member_size.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/range/detail/msvc_has_iterator_workaround.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/range/has_range_iterator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/range/iterator.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/range/iterator_range_core.hpp +4 -1
- data/src/cxx_supportlib/vendor-modified/boost/range/size_type.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/concepts.hpp +35 -18
- data/src/cxx_supportlib/vendor-modified/boost/regex/config.hpp +18 -101
- data/src/cxx_supportlib/vendor-modified/boost/regex/pattern_except.hpp +0 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/pending/object_cache.hpp +0 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/pending/unicode_iterator.hpp +0 -6
- data/src/cxx_supportlib/vendor-modified/boost/regex/regex_traits.hpp +0 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/user.hpp +4 -10
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/basic_regex.hpp +63 -17
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/basic_regex_creator.hpp +71 -16
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/basic_regex_parser.hpp +22 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/c_regex_traits.hpp +11 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/char_regex_traits.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/cpp_regex_traits.hpp +11 -8
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/cregex.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/error_type.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/icu.hpp +40 -38
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/iterator_category.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/iterator_traits.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/match_flags.hpp +39 -37
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/match_results.hpp +46 -9
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/mem_block_cache.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/object_cache.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/pattern_except.hpp +6 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/perl_matcher.hpp +57 -8
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/perl_matcher_common.hpp +21 -6
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/perl_matcher_non_recursive.hpp +18 -3
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regbase.hpp +4 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex.hpp +6 -6
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_format.hpp +23 -18
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_fwd.hpp +9 -9
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_grep.hpp +9 -5
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_iterator.hpp +11 -7
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_match.hpp +10 -7
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_merge.hpp +4 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_raw_buffer.hpp +3 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_replace.hpp +6 -2
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_search.hpp +12 -9
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_split.hpp +6 -3
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_token_iterator.hpp +16 -11
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_traits.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_traits_defaults.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/regex_workaround.hpp +2 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/states.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/sub_match.hpp +54 -49
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/syntax_type.hpp +64 -62
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/u32regex_iterator.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/u32regex_token_iterator.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/unicode_iterator.hpp +6 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex/v5/w32_regex_traits.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/regex.hpp +0 -4
- data/src/cxx_supportlib/vendor-modified/boost/regex_fwd.hpp +0 -4
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/atomic_count.hpp +1 -43
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/deprecated_macros.hpp +7 -7
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/shared_count.hpp +2 -77
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base.hpp +1 -64
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_nt.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_impl.hpp +0 -77
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_cxx20_constexpr.hpp +37 -0
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock.hpp +5 -28
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ptr.hpp +41 -40
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/scoped_array.hpp +0 -15
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/scoped_ptr.hpp +0 -18
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/shared_ptr.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/future.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/tuple/detail/tuple_basic.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/integral_constant.hpp +8 -6
- data/src/cxx_supportlib/vendor-modified/boost/type_traits/is_complete.hpp +31 -10
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fca.hpp +34 -8
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/core.hpp +6 -4
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/table.hpp +9 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/unordered/{unordered_printers.hpp → detail/unordered_printers.hpp} +34 -36
- data/src/cxx_supportlib/vendor-modified/boost/unordered/hash_traits.hpp +6 -49
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_map.hpp +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_set.hpp +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
- data/src/nginx_module/ContentHandler.c +2 -0
- data/src/ruby_supportlib/phusion_passenger/config/download_agent_command.rb +3 -5
- data/src/ruby_supportlib/phusion_passenger/config/download_nginx_engine_command.rb +3 -5
- data/src/ruby_supportlib/phusion_passenger/config/install_agent_command.rb +3 -5
- data/src/ruby_supportlib/phusion_passenger/config/install_standalone_runtime_command.rb +3 -5
- data/src/ruby_supportlib/phusion_passenger/config/installation_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +5 -3
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +6 -13
- data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +29 -30
- data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +2 -3
- data/src/ruby_supportlib/phusion_passenger/standalone/config_utils.rb +2 -0
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/json.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/terminal_choice_menu.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/gdb_controller.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger.rb +8 -8
- metadata +26 -99
- data/src/cxx_supportlib/vendor-modified/boost/align/aligned_alloc.hpp +0 -47
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/aligned_alloc_posix.hpp +0 -41
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/aligned_alloc_sunos.hpp +0 -34
- data/src/cxx_supportlib/vendor-modified/boost/align/detail/is_alignment.hpp +0 -28
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/pause.hpp +0 -68
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/conditional.hpp +0 -42
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/integral_constant.hpp +0 -46
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_enum.hpp +0 -42
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_function.hpp +0 -42
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/is_nothrow_default_constructible.hpp +0 -46
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/type_traits/remove_cv.hpp +0 -42
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/wait_on_address.hpp +0 -64
- data/src/cxx_supportlib/vendor-modified/boost/cerrno.hpp +0 -15
- data/src/cxx_supportlib/vendor-modified/boost/detail/indirect_traits.hpp +0 -195
- data/src/cxx_supportlib/vendor-modified/boost/detail/select_type.hpp +0 -36
- data/src/cxx_supportlib/vendor-modified/boost/iterator/detail/enable_if.hpp +0 -83
- data/src/cxx_supportlib/vendor-modified/boost/libs/regex/src/internals.hpp +0 -35
- data/src/cxx_supportlib/vendor-modified/boost/libs/regex/src/regex.cpp +0 -120
- data/src/cxx_supportlib/vendor-modified/boost/libs/regex/src/regex_debug.cpp +0 -59
- data/src/cxx_supportlib/vendor-modified/boost/libs/regex/src/static_mutex.cpp +0 -189
- data/src/cxx_supportlib/vendor-modified/boost/libs/system/src/error_code.cpp +0 -31
- data/src/cxx_supportlib/vendor-modified/boost/regex/config/borland.hpp +0 -72
- data/src/cxx_supportlib/vendor-modified/boost/regex/config/cwchar.hpp +0 -207
- data/src/cxx_supportlib/vendor-modified/boost/regex/pending/static_mutex.hpp +0 -182
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex.hpp +0 -797
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex_creator.hpp +0 -1598
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/basic_regex_parser.hpp +0 -3174
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/c_regex_traits.hpp +0 -511
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/char_regex_traits.hpp +0 -81
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/cpp_regex_traits.hpp +0 -1237
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/cregex.hpp +0 -213
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/error_type.hpp +0 -59
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/icu.hpp +0 -1516
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/indexed_bit_flag.hpp +0 -54
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/iterator_category.hpp +0 -91
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/iterator_traits.hpp +0 -135
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/match_flags.hpp +0 -161
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/match_results.hpp +0 -716
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/mem_block_cache.hpp +0 -183
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/object_cache.hpp +0 -171
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/pattern_except.hpp +0 -128
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher.hpp +0 -645
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_common.hpp +0 -1030
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_non_recursive.hpp +0 -1947
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/perl_matcher_recursive.hpp +0 -1131
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/primary_transform.hpp +0 -146
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/protected_call.hpp +0 -83
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regbase.hpp +0 -180
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex.hpp +0 -166
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_format.hpp +0 -1158
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_fwd.hpp +0 -73
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_grep.hpp +0 -155
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_iterator.hpp +0 -195
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_match.hpp +0 -382
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_merge.hpp +0 -93
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_raw_buffer.hpp +0 -241
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_replace.hpp +0 -99
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_search.hpp +0 -217
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_split.hpp +0 -174
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_token_iterator.hpp +0 -327
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_traits.hpp +0 -189
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_traits_defaults.hpp +0 -997
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/regex_workaround.hpp +0 -237
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/states.hpp +0 -321
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/sub_match.hpp +0 -516
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/syntax_type.hpp +0 -105
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/u32regex_iterator.hpp +0 -185
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/u32regex_token_iterator.hpp +0 -360
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/unicode_iterator.hpp +0 -871
- data/src/cxx_supportlib/vendor-modified/boost/regex/v4/w32_regex_traits.hpp +0 -1229
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/atomic_count_gcc.hpp +0 -79
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp +0 -63
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp +0 -88
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/atomic_count_pt.hpp +0 -104
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/atomic_count_spin.hpp +0 -69
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/atomic_count_sync.hpp +0 -72
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +0 -163
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_aix.hpp +0 -152
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +0 -185
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp +0 -148
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +0 -170
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +0 -200
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +0 -194
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +0 -179
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +0 -186
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_pt.hpp +0 -147
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +0 -174
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_spin.hpp +0 -141
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_sync.hpp +0 -165
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +0 -163
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp +0 -30
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp +0 -69
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock_gcc_arm.hpp +0 -128
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock_nt.hpp +0 -96
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock_pt.hpp +0 -86
- data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock_sync.hpp +0 -94
|
@@ -1,1229 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* Copyright (c) 2004
|
|
4
|
-
* John Maddock
|
|
5
|
-
*
|
|
6
|
-
* Use, modification and distribution are subject to the
|
|
7
|
-
* Boost Software License, Version 1.0. (See accompanying file
|
|
8
|
-
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
* LOCATION: see http://www.boost.org for most recent version.
|
|
14
|
-
* FILE w32_regex_traits.hpp
|
|
15
|
-
* VERSION see <boost/version.hpp>
|
|
16
|
-
* DESCRIPTION: Declares regular expression traits class w32_regex_traits.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
#ifndef BOOST_W32_REGEX_TRAITS_HPP_INCLUDED
|
|
20
|
-
#define BOOST_W32_REGEX_TRAITS_HPP_INCLUDED
|
|
21
|
-
|
|
22
|
-
#ifndef BOOST_REGEX_NO_WIN32_LOCALE
|
|
23
|
-
|
|
24
|
-
#ifndef BOOST_RE_PAT_EXCEPT_HPP
|
|
25
|
-
#include <boost/regex/pattern_except.hpp>
|
|
26
|
-
#endif
|
|
27
|
-
#ifndef BOOST_REGEX_TRAITS_DEFAULTS_HPP_INCLUDED
|
|
28
|
-
#include <boost/regex/v4/regex_traits_defaults.hpp>
|
|
29
|
-
#endif
|
|
30
|
-
#ifdef BOOST_HAS_THREADS
|
|
31
|
-
#include <boost/regex/pending/static_mutex.hpp>
|
|
32
|
-
#endif
|
|
33
|
-
#ifndef BOOST_REGEX_PRIMARY_TRANSFORM
|
|
34
|
-
#include <boost/regex/v4/primary_transform.hpp>
|
|
35
|
-
#endif
|
|
36
|
-
#ifndef BOOST_REGEX_OBJECT_CACHE_HPP
|
|
37
|
-
#include <boost/regex/v4/object_cache.hpp>
|
|
38
|
-
#endif
|
|
39
|
-
|
|
40
|
-
#define VC_EXTRALEAN
|
|
41
|
-
#define WIN32_LEAN_AND_MEAN
|
|
42
|
-
#include <windows.h>
|
|
43
|
-
|
|
44
|
-
#if defined(_MSC_VER) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
|
|
45
|
-
#pragma comment(lib, "user32.lib")
|
|
46
|
-
#endif
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
#ifdef BOOST_MSVC
|
|
50
|
-
#pragma warning(push)
|
|
51
|
-
#pragma warning(disable: 4103)
|
|
52
|
-
#endif
|
|
53
|
-
#ifdef BOOST_HAS_ABI_HEADERS
|
|
54
|
-
# include BOOST_ABI_PREFIX
|
|
55
|
-
#endif
|
|
56
|
-
#ifdef BOOST_MSVC
|
|
57
|
-
#pragma warning(pop)
|
|
58
|
-
#endif
|
|
59
|
-
|
|
60
|
-
#ifdef BOOST_MSVC
|
|
61
|
-
#pragma warning(push)
|
|
62
|
-
#pragma warning(disable:4786)
|
|
63
|
-
#if BOOST_MSVC < 1910
|
|
64
|
-
#pragma warning(disable:4800)
|
|
65
|
-
#endif
|
|
66
|
-
#endif
|
|
67
|
-
|
|
68
|
-
namespace boost{
|
|
69
|
-
|
|
70
|
-
//
|
|
71
|
-
// forward declaration is needed by some compilers:
|
|
72
|
-
//
|
|
73
|
-
template <class charT>
|
|
74
|
-
class w32_regex_traits;
|
|
75
|
-
|
|
76
|
-
namespace BOOST_REGEX_DETAIL_NS{
|
|
77
|
-
|
|
78
|
-
//
|
|
79
|
-
// start by typedeffing the types we'll need:
|
|
80
|
-
//
|
|
81
|
-
typedef ::boost::uint32_t lcid_type; // placeholder for LCID.
|
|
82
|
-
typedef ::boost::shared_ptr<void> cat_type; // placeholder for dll HANDLE.
|
|
83
|
-
|
|
84
|
-
//
|
|
85
|
-
// then add wrappers around the actual Win32 API's (ie implementation hiding):
|
|
86
|
-
//
|
|
87
|
-
lcid_type BOOST_REGEX_CALL w32_get_default_locale();
|
|
88
|
-
bool BOOST_REGEX_CALL w32_is_lower(char, lcid_type);
|
|
89
|
-
#ifndef BOOST_NO_WREGEX
|
|
90
|
-
bool BOOST_REGEX_CALL w32_is_lower(wchar_t, lcid_type);
|
|
91
|
-
#endif
|
|
92
|
-
bool BOOST_REGEX_CALL w32_is_upper(char, lcid_type);
|
|
93
|
-
#ifndef BOOST_NO_WREGEX
|
|
94
|
-
bool BOOST_REGEX_CALL w32_is_upper(wchar_t, lcid_type);
|
|
95
|
-
#endif
|
|
96
|
-
cat_type BOOST_REGEX_CALL w32_cat_open(const std::string& name);
|
|
97
|
-
std::string BOOST_REGEX_CALL w32_cat_get(const cat_type& cat, lcid_type state_id, int i, const std::string& def);
|
|
98
|
-
#ifndef BOOST_NO_WREGEX
|
|
99
|
-
std::wstring BOOST_REGEX_CALL w32_cat_get(const cat_type& cat, lcid_type state_id, int i, const std::wstring& def);
|
|
100
|
-
#endif
|
|
101
|
-
std::string BOOST_REGEX_CALL w32_transform(lcid_type state_id, const char* p1, const char* p2);
|
|
102
|
-
#ifndef BOOST_NO_WREGEX
|
|
103
|
-
std::wstring BOOST_REGEX_CALL w32_transform(lcid_type state_id, const wchar_t* p1, const wchar_t* p2);
|
|
104
|
-
#endif
|
|
105
|
-
char BOOST_REGEX_CALL w32_tolower(char c, lcid_type);
|
|
106
|
-
#ifndef BOOST_NO_WREGEX
|
|
107
|
-
wchar_t BOOST_REGEX_CALL w32_tolower(wchar_t c, lcid_type);
|
|
108
|
-
#endif
|
|
109
|
-
char BOOST_REGEX_CALL w32_toupper(char c, lcid_type);
|
|
110
|
-
#ifndef BOOST_NO_WREGEX
|
|
111
|
-
wchar_t BOOST_REGEX_CALL w32_toupper(wchar_t c, lcid_type);
|
|
112
|
-
#endif
|
|
113
|
-
bool BOOST_REGEX_CALL w32_is(lcid_type, boost::uint32_t mask, char c);
|
|
114
|
-
#ifndef BOOST_NO_WREGEX
|
|
115
|
-
bool BOOST_REGEX_CALL w32_is(lcid_type, boost::uint32_t mask, wchar_t c);
|
|
116
|
-
#endif
|
|
117
|
-
//
|
|
118
|
-
// class w32_regex_traits_base:
|
|
119
|
-
// acts as a container for locale and the facets we are using.
|
|
120
|
-
//
|
|
121
|
-
template <class charT>
|
|
122
|
-
struct w32_regex_traits_base
|
|
123
|
-
{
|
|
124
|
-
w32_regex_traits_base(lcid_type l)
|
|
125
|
-
{ imbue(l); }
|
|
126
|
-
lcid_type imbue(lcid_type l);
|
|
127
|
-
|
|
128
|
-
lcid_type m_locale;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
template <class charT>
|
|
132
|
-
inline lcid_type w32_regex_traits_base<charT>::imbue(lcid_type l)
|
|
133
|
-
{
|
|
134
|
-
lcid_type result(m_locale);
|
|
135
|
-
m_locale = l;
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
//
|
|
140
|
-
// class w32_regex_traits_char_layer:
|
|
141
|
-
// implements methods that require specialisation for narrow characters:
|
|
142
|
-
//
|
|
143
|
-
template <class charT>
|
|
144
|
-
class w32_regex_traits_char_layer : public w32_regex_traits_base<charT>
|
|
145
|
-
{
|
|
146
|
-
typedef std::basic_string<charT> string_type;
|
|
147
|
-
typedef std::map<charT, regex_constants::syntax_type> map_type;
|
|
148
|
-
typedef typename map_type::const_iterator map_iterator_type;
|
|
149
|
-
public:
|
|
150
|
-
w32_regex_traits_char_layer(const lcid_type l);
|
|
151
|
-
|
|
152
|
-
regex_constants::syntax_type syntax_type(charT c)const
|
|
153
|
-
{
|
|
154
|
-
map_iterator_type i = m_char_map.find(c);
|
|
155
|
-
return ((i == m_char_map.end()) ? 0 : i->second);
|
|
156
|
-
}
|
|
157
|
-
regex_constants::escape_syntax_type escape_syntax_type(charT c) const
|
|
158
|
-
{
|
|
159
|
-
map_iterator_type i = m_char_map.find(c);
|
|
160
|
-
if(i == m_char_map.end())
|
|
161
|
-
{
|
|
162
|
-
if(::boost::BOOST_REGEX_DETAIL_NS::w32_is_lower(c, this->m_locale)) return regex_constants::escape_type_class;
|
|
163
|
-
if(::boost::BOOST_REGEX_DETAIL_NS::w32_is_upper(c, this->m_locale)) return regex_constants::escape_type_not_class;
|
|
164
|
-
return 0;
|
|
165
|
-
}
|
|
166
|
-
return i->second;
|
|
167
|
-
}
|
|
168
|
-
charT tolower(charT c)const
|
|
169
|
-
{
|
|
170
|
-
return ::boost::BOOST_REGEX_DETAIL_NS::w32_tolower(c, this->m_locale);
|
|
171
|
-
}
|
|
172
|
-
bool isctype(boost::uint32_t mask, charT c)const
|
|
173
|
-
{
|
|
174
|
-
return ::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, mask, c);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
private:
|
|
178
|
-
string_type get_default_message(regex_constants::syntax_type);
|
|
179
|
-
// TODO: use a hash table when available!
|
|
180
|
-
map_type m_char_map;
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
template <class charT>
|
|
184
|
-
w32_regex_traits_char_layer<charT>::w32_regex_traits_char_layer(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
|
|
185
|
-
: w32_regex_traits_base<charT>(l)
|
|
186
|
-
{
|
|
187
|
-
// we need to start by initialising our syntax map so we know which
|
|
188
|
-
// character is used for which purpose:
|
|
189
|
-
cat_type cat;
|
|
190
|
-
std::string cat_name(w32_regex_traits<charT>::get_catalog_name());
|
|
191
|
-
if(cat_name.size())
|
|
192
|
-
{
|
|
193
|
-
cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name);
|
|
194
|
-
if(!cat)
|
|
195
|
-
{
|
|
196
|
-
std::string m("Unable to open message catalog: ");
|
|
197
|
-
std::runtime_error err(m + cat_name);
|
|
198
|
-
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
//
|
|
202
|
-
// if we have a valid catalog then load our messages:
|
|
203
|
-
//
|
|
204
|
-
if(cat)
|
|
205
|
-
{
|
|
206
|
-
for(regex_constants::syntax_type i = 1; i < regex_constants::syntax_max; ++i)
|
|
207
|
-
{
|
|
208
|
-
string_type mss = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i, get_default_message(i));
|
|
209
|
-
for(typename string_type::size_type j = 0; j < mss.size(); ++j)
|
|
210
|
-
{
|
|
211
|
-
this->m_char_map[mss[j]] = i;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
else
|
|
216
|
-
{
|
|
217
|
-
for(regex_constants::syntax_type i = 1; i < regex_constants::syntax_max; ++i)
|
|
218
|
-
{
|
|
219
|
-
const char* ptr = get_default_syntax(i);
|
|
220
|
-
while(ptr && *ptr)
|
|
221
|
-
{
|
|
222
|
-
this->m_char_map[static_cast<charT>(*ptr)] = i;
|
|
223
|
-
++ptr;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
template <class charT>
|
|
230
|
-
typename w32_regex_traits_char_layer<charT>::string_type
|
|
231
|
-
w32_regex_traits_char_layer<charT>::get_default_message(regex_constants::syntax_type i)
|
|
232
|
-
{
|
|
233
|
-
const char* ptr = get_default_syntax(i);
|
|
234
|
-
string_type result;
|
|
235
|
-
while(ptr && *ptr)
|
|
236
|
-
{
|
|
237
|
-
result.append(1, static_cast<charT>(*ptr));
|
|
238
|
-
++ptr;
|
|
239
|
-
}
|
|
240
|
-
return result;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
//
|
|
244
|
-
// specialised version for narrow characters:
|
|
245
|
-
//
|
|
246
|
-
template <>
|
|
247
|
-
class w32_regex_traits_char_layer<char> : public w32_regex_traits_base<char>
|
|
248
|
-
{
|
|
249
|
-
typedef std::string string_type;
|
|
250
|
-
public:
|
|
251
|
-
w32_regex_traits_char_layer(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
|
|
252
|
-
: w32_regex_traits_base<char>(l)
|
|
253
|
-
{
|
|
254
|
-
init<char>();
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
regex_constants::syntax_type syntax_type(char c)const
|
|
258
|
-
{
|
|
259
|
-
return m_char_map[static_cast<unsigned char>(c)];
|
|
260
|
-
}
|
|
261
|
-
regex_constants::escape_syntax_type escape_syntax_type(char c) const
|
|
262
|
-
{
|
|
263
|
-
return m_char_map[static_cast<unsigned char>(c)];
|
|
264
|
-
}
|
|
265
|
-
char tolower(char c)const
|
|
266
|
-
{
|
|
267
|
-
return m_lower_map[static_cast<unsigned char>(c)];
|
|
268
|
-
}
|
|
269
|
-
bool isctype(boost::uint32_t mask, char c)const
|
|
270
|
-
{
|
|
271
|
-
return m_type_map[static_cast<unsigned char>(c)] & mask;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
private:
|
|
275
|
-
regex_constants::syntax_type m_char_map[1u << CHAR_BIT];
|
|
276
|
-
char m_lower_map[1u << CHAR_BIT];
|
|
277
|
-
boost::uint16_t m_type_map[1u << CHAR_BIT];
|
|
278
|
-
template <class U>
|
|
279
|
-
void init();
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
//
|
|
283
|
-
// class w32_regex_traits_implementation:
|
|
284
|
-
// provides pimpl implementation for w32_regex_traits.
|
|
285
|
-
//
|
|
286
|
-
template <class charT>
|
|
287
|
-
class w32_regex_traits_implementation : public w32_regex_traits_char_layer<charT>
|
|
288
|
-
{
|
|
289
|
-
public:
|
|
290
|
-
typedef typename w32_regex_traits<charT>::char_class_type char_class_type;
|
|
291
|
-
BOOST_STATIC_CONSTANT(char_class_type, mask_word = 0x0400); // must be C1_DEFINED << 1
|
|
292
|
-
BOOST_STATIC_CONSTANT(char_class_type, mask_unicode = 0x0800); // must be C1_DEFINED << 2
|
|
293
|
-
BOOST_STATIC_CONSTANT(char_class_type, mask_horizontal = 0x1000); // must be C1_DEFINED << 3
|
|
294
|
-
BOOST_STATIC_CONSTANT(char_class_type, mask_vertical = 0x2000); // must be C1_DEFINED << 4
|
|
295
|
-
BOOST_STATIC_CONSTANT(char_class_type, mask_base = 0x3ff); // all the masks used by the CT_CTYPE1 group
|
|
296
|
-
|
|
297
|
-
typedef std::basic_string<charT> string_type;
|
|
298
|
-
typedef charT char_type;
|
|
299
|
-
w32_regex_traits_implementation(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l);
|
|
300
|
-
std::string error_string(regex_constants::error_type n) const
|
|
301
|
-
{
|
|
302
|
-
if(!m_error_strings.empty())
|
|
303
|
-
{
|
|
304
|
-
std::map<int, std::string>::const_iterator p = m_error_strings.find(n);
|
|
305
|
-
return (p == m_error_strings.end()) ? std::string(get_default_error_string(n)) : p->second;
|
|
306
|
-
}
|
|
307
|
-
return get_default_error_string(n);
|
|
308
|
-
}
|
|
309
|
-
char_class_type lookup_classname(const charT* p1, const charT* p2) const
|
|
310
|
-
{
|
|
311
|
-
char_class_type result = lookup_classname_imp(p1, p2);
|
|
312
|
-
if(result == 0)
|
|
313
|
-
{
|
|
314
|
-
typedef typename string_type::size_type size_type;
|
|
315
|
-
string_type temp(p1, p2);
|
|
316
|
-
for(size_type i = 0; i < temp.size(); ++i)
|
|
317
|
-
temp[i] = this->tolower(temp[i]);
|
|
318
|
-
result = lookup_classname_imp(&*temp.begin(), &*temp.begin() + temp.size());
|
|
319
|
-
}
|
|
320
|
-
return result;
|
|
321
|
-
}
|
|
322
|
-
string_type lookup_collatename(const charT* p1, const charT* p2) const;
|
|
323
|
-
string_type transform_primary(const charT* p1, const charT* p2) const;
|
|
324
|
-
string_type transform(const charT* p1, const charT* p2) const
|
|
325
|
-
{
|
|
326
|
-
return ::boost::BOOST_REGEX_DETAIL_NS::w32_transform(this->m_locale, p1, p2);
|
|
327
|
-
}
|
|
328
|
-
private:
|
|
329
|
-
std::map<int, std::string> m_error_strings; // error messages indexed by numberic ID
|
|
330
|
-
std::map<string_type, char_class_type> m_custom_class_names; // character class names
|
|
331
|
-
std::map<string_type, string_type> m_custom_collate_names; // collating element names
|
|
332
|
-
unsigned m_collate_type; // the form of the collation string
|
|
333
|
-
charT m_collate_delim; // the collation group delimiter
|
|
334
|
-
//
|
|
335
|
-
// helpers:
|
|
336
|
-
//
|
|
337
|
-
char_class_type lookup_classname_imp(const charT* p1, const charT* p2) const;
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
template <class charT>
|
|
341
|
-
typename w32_regex_traits_implementation<charT>::string_type
|
|
342
|
-
w32_regex_traits_implementation<charT>::transform_primary(const charT* p1, const charT* p2) const
|
|
343
|
-
{
|
|
344
|
-
string_type result;
|
|
345
|
-
//
|
|
346
|
-
// What we do here depends upon the format of the sort key returned by
|
|
347
|
-
// sort key returned by this->transform:
|
|
348
|
-
//
|
|
349
|
-
switch(m_collate_type)
|
|
350
|
-
{
|
|
351
|
-
case sort_C:
|
|
352
|
-
case sort_unknown:
|
|
353
|
-
// the best we can do is translate to lower case, then get a regular sort key:
|
|
354
|
-
{
|
|
355
|
-
result.assign(p1, p2);
|
|
356
|
-
typedef typename string_type::size_type size_type;
|
|
357
|
-
for(size_type i = 0; i < result.size(); ++i)
|
|
358
|
-
result[i] = this->tolower(result[i]);
|
|
359
|
-
result = this->transform(&*result.begin(), &*result.begin() + result.size());
|
|
360
|
-
break;
|
|
361
|
-
}
|
|
362
|
-
case sort_fixed:
|
|
363
|
-
{
|
|
364
|
-
// get a regular sort key, and then truncate it:
|
|
365
|
-
result.assign(this->transform(p1, p2));
|
|
366
|
-
result.erase(this->m_collate_delim);
|
|
367
|
-
break;
|
|
368
|
-
}
|
|
369
|
-
case sort_delim:
|
|
370
|
-
// get a regular sort key, and then truncate everything after the delim:
|
|
371
|
-
result.assign(this->transform(p1, p2));
|
|
372
|
-
std::size_t i;
|
|
373
|
-
for(i = 0; i < result.size(); ++i)
|
|
374
|
-
{
|
|
375
|
-
if(result[i] == m_collate_delim)
|
|
376
|
-
break;
|
|
377
|
-
}
|
|
378
|
-
result.erase(i);
|
|
379
|
-
break;
|
|
380
|
-
}
|
|
381
|
-
if(result.empty())
|
|
382
|
-
result = string_type(1, charT(0));
|
|
383
|
-
return result;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
template <class charT>
|
|
387
|
-
typename w32_regex_traits_implementation<charT>::string_type
|
|
388
|
-
w32_regex_traits_implementation<charT>::lookup_collatename(const charT* p1, const charT* p2) const
|
|
389
|
-
{
|
|
390
|
-
typedef typename std::map<string_type, string_type>::const_iterator iter_type;
|
|
391
|
-
if(m_custom_collate_names.size())
|
|
392
|
-
{
|
|
393
|
-
iter_type pos = m_custom_collate_names.find(string_type(p1, p2));
|
|
394
|
-
if(pos != m_custom_collate_names.end())
|
|
395
|
-
return pos->second;
|
|
396
|
-
}
|
|
397
|
-
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
|
398
|
-
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)
|
|
399
|
-
std::string name(p1, p2);
|
|
400
|
-
#else
|
|
401
|
-
std::string name;
|
|
402
|
-
const charT* p0 = p1;
|
|
403
|
-
while(p0 != p2)
|
|
404
|
-
name.append(1, char(*p0++));
|
|
405
|
-
#endif
|
|
406
|
-
name = lookup_default_collate_name(name);
|
|
407
|
-
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
|
|
408
|
-
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)
|
|
409
|
-
if(name.size())
|
|
410
|
-
return string_type(name.begin(), name.end());
|
|
411
|
-
#else
|
|
412
|
-
if(name.size())
|
|
413
|
-
{
|
|
414
|
-
string_type result;
|
|
415
|
-
typedef std::string::const_iterator iter;
|
|
416
|
-
iter b = name.begin();
|
|
417
|
-
iter e = name.end();
|
|
418
|
-
while(b != e)
|
|
419
|
-
result.append(1, charT(*b++));
|
|
420
|
-
return result;
|
|
421
|
-
}
|
|
422
|
-
#endif
|
|
423
|
-
if(p2 - p1 == 1)
|
|
424
|
-
return string_type(1, *p1);
|
|
425
|
-
return string_type();
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
template <class charT>
|
|
429
|
-
w32_regex_traits_implementation<charT>::w32_regex_traits_implementation(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
|
|
430
|
-
: w32_regex_traits_char_layer<charT>(l)
|
|
431
|
-
{
|
|
432
|
-
cat_type cat;
|
|
433
|
-
std::string cat_name(w32_regex_traits<charT>::get_catalog_name());
|
|
434
|
-
if(cat_name.size())
|
|
435
|
-
{
|
|
436
|
-
cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name);
|
|
437
|
-
if(!cat)
|
|
438
|
-
{
|
|
439
|
-
std::string m("Unable to open message catalog: ");
|
|
440
|
-
std::runtime_error err(m + cat_name);
|
|
441
|
-
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
//
|
|
445
|
-
// if we have a valid catalog then load our messages:
|
|
446
|
-
//
|
|
447
|
-
if(cat)
|
|
448
|
-
{
|
|
449
|
-
//
|
|
450
|
-
// Error messages:
|
|
451
|
-
//
|
|
452
|
-
for(boost::regex_constants::error_type i = static_cast<boost::regex_constants::error_type>(0);
|
|
453
|
-
i <= boost::regex_constants::error_unknown;
|
|
454
|
-
i = static_cast<boost::regex_constants::error_type>(i + 1))
|
|
455
|
-
{
|
|
456
|
-
const char* p = get_default_error_string(i);
|
|
457
|
-
string_type default_message;
|
|
458
|
-
while(*p)
|
|
459
|
-
{
|
|
460
|
-
default_message.append(1, static_cast<charT>(*p));
|
|
461
|
-
++p;
|
|
462
|
-
}
|
|
463
|
-
string_type s = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i+200, default_message);
|
|
464
|
-
std::string result;
|
|
465
|
-
for(std::string::size_type j = 0; j < s.size(); ++j)
|
|
466
|
-
{
|
|
467
|
-
result.append(1, static_cast<char>(s[j]));
|
|
468
|
-
}
|
|
469
|
-
m_error_strings[i] = result;
|
|
470
|
-
}
|
|
471
|
-
//
|
|
472
|
-
// Custom class names:
|
|
473
|
-
//
|
|
474
|
-
static const char_class_type masks[14] =
|
|
475
|
-
{
|
|
476
|
-
0x0104u, // C1_ALPHA | C1_DIGIT
|
|
477
|
-
0x0100u, // C1_ALPHA
|
|
478
|
-
0x0020u, // C1_CNTRL
|
|
479
|
-
0x0004u, // C1_DIGIT
|
|
480
|
-
(~(0x0020u|0x0008u) & 0x01ffu) | 0x0400u, // not C1_CNTRL or C1_SPACE
|
|
481
|
-
0x0002u, // C1_LOWER
|
|
482
|
-
(~0x0020u & 0x01ffu) | 0x0400, // not C1_CNTRL
|
|
483
|
-
0x0010u, // C1_PUNCT
|
|
484
|
-
0x0008u, // C1_SPACE
|
|
485
|
-
0x0001u, // C1_UPPER
|
|
486
|
-
0x0080u, // C1_XDIGIT
|
|
487
|
-
0x0040u, // C1_BLANK
|
|
488
|
-
w32_regex_traits_implementation<charT>::mask_word,
|
|
489
|
-
w32_regex_traits_implementation<charT>::mask_unicode,
|
|
490
|
-
};
|
|
491
|
-
static const string_type null_string;
|
|
492
|
-
for(unsigned int j = 0; j <= 13; ++j)
|
|
493
|
-
{
|
|
494
|
-
string_type s(::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, j+300, null_string));
|
|
495
|
-
if(s.size())
|
|
496
|
-
this->m_custom_class_names[s] = masks[j];
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
//
|
|
500
|
-
// get the collation format used by m_pcollate:
|
|
501
|
-
//
|
|
502
|
-
m_collate_type = BOOST_REGEX_DETAIL_NS::find_sort_syntax(this, &m_collate_delim);
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
template <class charT>
|
|
506
|
-
typename w32_regex_traits_implementation<charT>::char_class_type
|
|
507
|
-
w32_regex_traits_implementation<charT>::lookup_classname_imp(const charT* p1, const charT* p2) const
|
|
508
|
-
{
|
|
509
|
-
static const char_class_type masks[22] =
|
|
510
|
-
{
|
|
511
|
-
0,
|
|
512
|
-
0x0104u, // C1_ALPHA | C1_DIGIT
|
|
513
|
-
0x0100u, // C1_ALPHA
|
|
514
|
-
0x0040u, // C1_BLANK
|
|
515
|
-
0x0020u, // C1_CNTRL
|
|
516
|
-
0x0004u, // C1_DIGIT
|
|
517
|
-
0x0004u, // C1_DIGIT
|
|
518
|
-
(~(0x0020u|0x0008u|0x0040) & 0x01ffu) | 0x0400u, // not C1_CNTRL or C1_SPACE or C1_BLANK
|
|
519
|
-
w32_regex_traits_implementation<charT>::mask_horizontal,
|
|
520
|
-
0x0002u, // C1_LOWER
|
|
521
|
-
0x0002u, // C1_LOWER
|
|
522
|
-
(~0x0020u & 0x01ffu) | 0x0400, // not C1_CNTRL
|
|
523
|
-
0x0010u, // C1_PUNCT
|
|
524
|
-
0x0008u, // C1_SPACE
|
|
525
|
-
0x0008u, // C1_SPACE
|
|
526
|
-
0x0001u, // C1_UPPER
|
|
527
|
-
w32_regex_traits_implementation<charT>::mask_unicode,
|
|
528
|
-
0x0001u, // C1_UPPER
|
|
529
|
-
w32_regex_traits_implementation<charT>::mask_vertical,
|
|
530
|
-
0x0104u | w32_regex_traits_implementation<charT>::mask_word,
|
|
531
|
-
0x0104u | w32_regex_traits_implementation<charT>::mask_word,
|
|
532
|
-
0x0080u, // C1_XDIGIT
|
|
533
|
-
};
|
|
534
|
-
if(m_custom_class_names.size())
|
|
535
|
-
{
|
|
536
|
-
typedef typename std::map<std::basic_string<charT>, char_class_type>::const_iterator map_iter;
|
|
537
|
-
map_iter pos = m_custom_class_names.find(string_type(p1, p2));
|
|
538
|
-
if(pos != m_custom_class_names.end())
|
|
539
|
-
return pos->second;
|
|
540
|
-
}
|
|
541
|
-
std::size_t state_id = 1u + (std::size_t)BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
|
|
542
|
-
if(state_id < sizeof(masks) / sizeof(masks[0]))
|
|
543
|
-
return masks[state_id];
|
|
544
|
-
return masks[0];
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
template <class charT>
|
|
549
|
-
boost::shared_ptr<const w32_regex_traits_implementation<charT> > create_w32_regex_traits(::boost::BOOST_REGEX_DETAIL_NS::lcid_type l)
|
|
550
|
-
{
|
|
551
|
-
// TODO: create a cache for previously constructed objects.
|
|
552
|
-
return boost::object_cache< ::boost::BOOST_REGEX_DETAIL_NS::lcid_type, w32_regex_traits_implementation<charT> >::get(l, 5);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
} // BOOST_REGEX_DETAIL_NS
|
|
556
|
-
|
|
557
|
-
template <class charT>
|
|
558
|
-
class w32_regex_traits
|
|
559
|
-
{
|
|
560
|
-
public:
|
|
561
|
-
typedef charT char_type;
|
|
562
|
-
typedef std::size_t size_type;
|
|
563
|
-
typedef std::basic_string<char_type> string_type;
|
|
564
|
-
typedef ::boost::BOOST_REGEX_DETAIL_NS::lcid_type locale_type;
|
|
565
|
-
typedef boost::uint_least32_t char_class_type;
|
|
566
|
-
|
|
567
|
-
struct boost_extensions_tag{};
|
|
568
|
-
|
|
569
|
-
w32_regex_traits()
|
|
570
|
-
: m_pimpl(BOOST_REGEX_DETAIL_NS::create_w32_regex_traits<charT>(::boost::BOOST_REGEX_DETAIL_NS::w32_get_default_locale()))
|
|
571
|
-
{ }
|
|
572
|
-
static size_type length(const char_type* p)
|
|
573
|
-
{
|
|
574
|
-
return std::char_traits<charT>::length(p);
|
|
575
|
-
}
|
|
576
|
-
regex_constants::syntax_type syntax_type(charT c)const
|
|
577
|
-
{
|
|
578
|
-
return m_pimpl->syntax_type(c);
|
|
579
|
-
}
|
|
580
|
-
regex_constants::escape_syntax_type escape_syntax_type(charT c) const
|
|
581
|
-
{
|
|
582
|
-
return m_pimpl->escape_syntax_type(c);
|
|
583
|
-
}
|
|
584
|
-
charT translate(charT c) const
|
|
585
|
-
{
|
|
586
|
-
return c;
|
|
587
|
-
}
|
|
588
|
-
charT translate_nocase(charT c) const
|
|
589
|
-
{
|
|
590
|
-
return this->m_pimpl->tolower(c);
|
|
591
|
-
}
|
|
592
|
-
charT translate(charT c, bool icase) const
|
|
593
|
-
{
|
|
594
|
-
return icase ? this->m_pimpl->tolower(c) : c;
|
|
595
|
-
}
|
|
596
|
-
charT tolower(charT c) const
|
|
597
|
-
{
|
|
598
|
-
return this->m_pimpl->tolower(c);
|
|
599
|
-
}
|
|
600
|
-
charT toupper(charT c) const
|
|
601
|
-
{
|
|
602
|
-
return ::boost::BOOST_REGEX_DETAIL_NS::w32_toupper(c, this->m_pimpl->m_locale);
|
|
603
|
-
}
|
|
604
|
-
string_type transform(const charT* p1, const charT* p2) const
|
|
605
|
-
{
|
|
606
|
-
return ::boost::BOOST_REGEX_DETAIL_NS::w32_transform(this->m_pimpl->m_locale, p1, p2);
|
|
607
|
-
}
|
|
608
|
-
string_type transform_primary(const charT* p1, const charT* p2) const
|
|
609
|
-
{
|
|
610
|
-
return m_pimpl->transform_primary(p1, p2);
|
|
611
|
-
}
|
|
612
|
-
char_class_type lookup_classname(const charT* p1, const charT* p2) const
|
|
613
|
-
{
|
|
614
|
-
return m_pimpl->lookup_classname(p1, p2);
|
|
615
|
-
}
|
|
616
|
-
string_type lookup_collatename(const charT* p1, const charT* p2) const
|
|
617
|
-
{
|
|
618
|
-
return m_pimpl->lookup_collatename(p1, p2);
|
|
619
|
-
}
|
|
620
|
-
bool isctype(charT c, char_class_type f) const
|
|
621
|
-
{
|
|
622
|
-
if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_base)
|
|
623
|
-
&& (this->m_pimpl->isctype(f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_base, c)))
|
|
624
|
-
return true;
|
|
625
|
-
else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_unicode) && BOOST_REGEX_DETAIL_NS::is_extended(c))
|
|
626
|
-
return true;
|
|
627
|
-
else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_word) && (c == '_'))
|
|
628
|
-
return true;
|
|
629
|
-
else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_vertical)
|
|
630
|
-
&& (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == '\v')))
|
|
631
|
-
return true;
|
|
632
|
-
else if((f & BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_horizontal)
|
|
633
|
-
&& this->isctype(c, 0x0008u) && !this->isctype(c, BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT>::mask_vertical))
|
|
634
|
-
return true;
|
|
635
|
-
return false;
|
|
636
|
-
}
|
|
637
|
-
boost::intmax_t toi(const charT*& p1, const charT* p2, int radix)const
|
|
638
|
-
{
|
|
639
|
-
return ::boost::BOOST_REGEX_DETAIL_NS::global_toi(p1, p2, radix, *this);
|
|
640
|
-
}
|
|
641
|
-
int value(charT c, int radix)const
|
|
642
|
-
{
|
|
643
|
-
int result = (int)::boost::BOOST_REGEX_DETAIL_NS::global_value(c);
|
|
644
|
-
return result < radix ? result : -1;
|
|
645
|
-
}
|
|
646
|
-
locale_type imbue(locale_type l)
|
|
647
|
-
{
|
|
648
|
-
::boost::BOOST_REGEX_DETAIL_NS::lcid_type result(getloc());
|
|
649
|
-
m_pimpl = BOOST_REGEX_DETAIL_NS::create_w32_regex_traits<charT>(l);
|
|
650
|
-
return result;
|
|
651
|
-
}
|
|
652
|
-
locale_type getloc()const
|
|
653
|
-
{
|
|
654
|
-
return m_pimpl->m_locale;
|
|
655
|
-
}
|
|
656
|
-
std::string error_string(regex_constants::error_type n) const
|
|
657
|
-
{
|
|
658
|
-
return m_pimpl->error_string(n);
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
//
|
|
662
|
-
// extension:
|
|
663
|
-
// set the name of the message catalog in use (defaults to "boost_regex").
|
|
664
|
-
//
|
|
665
|
-
static std::string catalog_name(const std::string& name);
|
|
666
|
-
static std::string get_catalog_name();
|
|
667
|
-
|
|
668
|
-
private:
|
|
669
|
-
boost::shared_ptr<const BOOST_REGEX_DETAIL_NS::w32_regex_traits_implementation<charT> > m_pimpl;
|
|
670
|
-
//
|
|
671
|
-
// catalog name handler:
|
|
672
|
-
//
|
|
673
|
-
static std::string& get_catalog_name_inst();
|
|
674
|
-
|
|
675
|
-
#ifdef BOOST_HAS_THREADS
|
|
676
|
-
static static_mutex& get_mutex_inst();
|
|
677
|
-
#endif
|
|
678
|
-
};
|
|
679
|
-
|
|
680
|
-
template <class charT>
|
|
681
|
-
std::string w32_regex_traits<charT>::catalog_name(const std::string& name)
|
|
682
|
-
{
|
|
683
|
-
#ifdef BOOST_HAS_THREADS
|
|
684
|
-
static_mutex::scoped_lock lk(get_mutex_inst());
|
|
685
|
-
#endif
|
|
686
|
-
std::string result(get_catalog_name_inst());
|
|
687
|
-
get_catalog_name_inst() = name;
|
|
688
|
-
return result;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
template <class charT>
|
|
692
|
-
std::string& w32_regex_traits<charT>::get_catalog_name_inst()
|
|
693
|
-
{
|
|
694
|
-
static std::string s_name;
|
|
695
|
-
return s_name;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
template <class charT>
|
|
699
|
-
std::string w32_regex_traits<charT>::get_catalog_name()
|
|
700
|
-
{
|
|
701
|
-
#ifdef BOOST_HAS_THREADS
|
|
702
|
-
static_mutex::scoped_lock lk(get_mutex_inst());
|
|
703
|
-
#endif
|
|
704
|
-
std::string result(get_catalog_name_inst());
|
|
705
|
-
return result;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
#ifdef BOOST_HAS_THREADS
|
|
709
|
-
template <class charT>
|
|
710
|
-
static_mutex& w32_regex_traits<charT>::get_mutex_inst()
|
|
711
|
-
{
|
|
712
|
-
static static_mutex s_mutex = BOOST_STATIC_MUTEX_INIT;
|
|
713
|
-
return s_mutex;
|
|
714
|
-
}
|
|
715
|
-
#endif
|
|
716
|
-
|
|
717
|
-
namespace BOOST_REGEX_DETAIL_NS {
|
|
718
|
-
|
|
719
|
-
#ifdef BOOST_NO_ANSI_APIS
|
|
720
|
-
inline UINT get_code_page_for_locale_id(lcid_type idx)
|
|
721
|
-
{
|
|
722
|
-
WCHAR code_page_string[7];
|
|
723
|
-
if (::GetLocaleInfoW(idx, LOCALE_IDEFAULTANSICODEPAGE, code_page_string, 7) == 0)
|
|
724
|
-
return 0;
|
|
725
|
-
|
|
726
|
-
return static_cast<UINT>(_wtol(code_page_string));
|
|
727
|
-
}
|
|
728
|
-
#endif
|
|
729
|
-
|
|
730
|
-
template <class U>
|
|
731
|
-
inline void w32_regex_traits_char_layer<char>::init()
|
|
732
|
-
{
|
|
733
|
-
// we need to start by initialising our syntax map so we know which
|
|
734
|
-
// character is used for which purpose:
|
|
735
|
-
std::memset(m_char_map, 0, sizeof(m_char_map));
|
|
736
|
-
cat_type cat;
|
|
737
|
-
std::string cat_name(w32_regex_traits<char>::get_catalog_name());
|
|
738
|
-
if (cat_name.size())
|
|
739
|
-
{
|
|
740
|
-
cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name);
|
|
741
|
-
if (!cat)
|
|
742
|
-
{
|
|
743
|
-
std::string m("Unable to open message catalog: ");
|
|
744
|
-
std::runtime_error err(m + cat_name);
|
|
745
|
-
::boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
//
|
|
749
|
-
// if we have a valid catalog then load our messages:
|
|
750
|
-
//
|
|
751
|
-
if (cat)
|
|
752
|
-
{
|
|
753
|
-
for (regex_constants::syntax_type i = 1; i < regex_constants::syntax_max; ++i)
|
|
754
|
-
{
|
|
755
|
-
string_type mss = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i, get_default_syntax(i));
|
|
756
|
-
for (string_type::size_type j = 0; j < mss.size(); ++j)
|
|
757
|
-
{
|
|
758
|
-
m_char_map[static_cast<unsigned char>(mss[j])] = i;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
else
|
|
763
|
-
{
|
|
764
|
-
for (regex_constants::syntax_type i = 1; i < regex_constants::syntax_max; ++i)
|
|
765
|
-
{
|
|
766
|
-
const char* ptr = get_default_syntax(i);
|
|
767
|
-
while (ptr && *ptr)
|
|
768
|
-
{
|
|
769
|
-
m_char_map[static_cast<unsigned char>(*ptr)] = i;
|
|
770
|
-
++ptr;
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
//
|
|
775
|
-
// finish off by calculating our escape types:
|
|
776
|
-
//
|
|
777
|
-
unsigned char i = 'A';
|
|
778
|
-
do
|
|
779
|
-
{
|
|
780
|
-
if (m_char_map[i] == 0)
|
|
781
|
-
{
|
|
782
|
-
if (::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, 0x0002u, (char)i))
|
|
783
|
-
m_char_map[i] = regex_constants::escape_type_class;
|
|
784
|
-
else if (::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, 0x0001u, (char)i))
|
|
785
|
-
m_char_map[i] = regex_constants::escape_type_not_class;
|
|
786
|
-
}
|
|
787
|
-
} while (0xFF != i++);
|
|
788
|
-
|
|
789
|
-
//
|
|
790
|
-
// fill in lower case map:
|
|
791
|
-
//
|
|
792
|
-
char char_map[1 << CHAR_BIT];
|
|
793
|
-
for (int ii = 0; ii < (1 << CHAR_BIT); ++ii)
|
|
794
|
-
char_map[ii] = static_cast<char>(ii);
|
|
795
|
-
#ifndef BOOST_NO_ANSI_APIS
|
|
796
|
-
int r = ::LCMapStringA(this->m_locale, LCMAP_LOWERCASE, char_map, 1 << CHAR_BIT, this->m_lower_map, 1 << CHAR_BIT);
|
|
797
|
-
BOOST_REGEX_ASSERT(r != 0);
|
|
798
|
-
#else
|
|
799
|
-
UINT code_page = get_code_page_for_locale_id(this->m_locale);
|
|
800
|
-
BOOST_REGEX_ASSERT(code_page != 0);
|
|
801
|
-
|
|
802
|
-
WCHAR wide_char_map[1 << CHAR_BIT];
|
|
803
|
-
int conv_r = ::MultiByteToWideChar(code_page, 0, char_map, 1 << CHAR_BIT, wide_char_map, 1 << CHAR_BIT);
|
|
804
|
-
BOOST_REGEX_ASSERT(conv_r != 0);
|
|
805
|
-
|
|
806
|
-
WCHAR wide_lower_map[1 << CHAR_BIT];
|
|
807
|
-
int r = ::LCMapStringW(this->m_locale, LCMAP_LOWERCASE, wide_char_map, 1 << CHAR_BIT, wide_lower_map, 1 << CHAR_BIT);
|
|
808
|
-
BOOST_REGEX_ASSERT(r != 0);
|
|
809
|
-
|
|
810
|
-
conv_r = ::WideCharToMultiByte(code_page, 0, wide_lower_map, r, this->m_lower_map, 1 << CHAR_BIT, NULL, NULL);
|
|
811
|
-
BOOST_REGEX_ASSERT(conv_r != 0);
|
|
812
|
-
#endif
|
|
813
|
-
if (r < (1 << CHAR_BIT))
|
|
814
|
-
{
|
|
815
|
-
// if we have multibyte characters then not all may have been given
|
|
816
|
-
// a lower case mapping:
|
|
817
|
-
for (int jj = r; jj < (1 << CHAR_BIT); ++jj)
|
|
818
|
-
this->m_lower_map[jj] = static_cast<char>(jj);
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
#ifndef BOOST_NO_ANSI_APIS
|
|
822
|
-
r = ::GetStringTypeExA(this->m_locale, CT_CTYPE1, char_map, 1 << CHAR_BIT, this->m_type_map);
|
|
823
|
-
#else
|
|
824
|
-
r = ::GetStringTypeExW(this->m_locale, CT_CTYPE1, wide_char_map, 1 << CHAR_BIT, this->m_type_map);
|
|
825
|
-
#endif
|
|
826
|
-
BOOST_REGEX_ASSERT(0 != r);
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
inline lcid_type BOOST_REGEX_CALL w32_get_default_locale()
|
|
830
|
-
{
|
|
831
|
-
return ::GetUserDefaultLCID();
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
inline bool BOOST_REGEX_CALL w32_is_lower(char c, lcid_type idx)
|
|
835
|
-
{
|
|
836
|
-
#ifndef BOOST_NO_ANSI_APIS
|
|
837
|
-
WORD mask;
|
|
838
|
-
if (::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER))
|
|
839
|
-
return true;
|
|
840
|
-
return false;
|
|
841
|
-
#else
|
|
842
|
-
UINT code_page = get_code_page_for_locale_id(idx);
|
|
843
|
-
if (code_page == 0)
|
|
844
|
-
return false;
|
|
845
|
-
|
|
846
|
-
WCHAR wide_c;
|
|
847
|
-
if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
|
|
848
|
-
return false;
|
|
849
|
-
|
|
850
|
-
WORD mask;
|
|
851
|
-
if (::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_LOWER))
|
|
852
|
-
return true;
|
|
853
|
-
return false;
|
|
854
|
-
#endif
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
inline bool BOOST_REGEX_CALL w32_is_lower(wchar_t c, lcid_type idx)
|
|
858
|
-
{
|
|
859
|
-
WORD mask;
|
|
860
|
-
if (::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER))
|
|
861
|
-
return true;
|
|
862
|
-
return false;
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
inline bool BOOST_REGEX_CALL w32_is_upper(char c, lcid_type idx)
|
|
866
|
-
{
|
|
867
|
-
#ifndef BOOST_NO_ANSI_APIS
|
|
868
|
-
WORD mask;
|
|
869
|
-
if (::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER))
|
|
870
|
-
return true;
|
|
871
|
-
return false;
|
|
872
|
-
#else
|
|
873
|
-
UINT code_page = get_code_page_for_locale_id(idx);
|
|
874
|
-
if (code_page == 0)
|
|
875
|
-
return false;
|
|
876
|
-
|
|
877
|
-
WCHAR wide_c;
|
|
878
|
-
if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
|
|
879
|
-
return false;
|
|
880
|
-
|
|
881
|
-
WORD mask;
|
|
882
|
-
if (::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_UPPER))
|
|
883
|
-
return true;
|
|
884
|
-
return false;
|
|
885
|
-
#endif
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
inline bool BOOST_REGEX_CALL w32_is_upper(wchar_t c, lcid_type idx)
|
|
889
|
-
{
|
|
890
|
-
WORD mask;
|
|
891
|
-
if (::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER))
|
|
892
|
-
return true;
|
|
893
|
-
return false;
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
inline void free_module(void* mod)
|
|
897
|
-
{
|
|
898
|
-
::FreeLibrary(static_cast<HMODULE>(mod));
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
inline cat_type BOOST_REGEX_CALL w32_cat_open(const std::string& name)
|
|
902
|
-
{
|
|
903
|
-
#ifndef BOOST_NO_ANSI_APIS
|
|
904
|
-
cat_type result(::LoadLibraryA(name.c_str()), &free_module);
|
|
905
|
-
return result;
|
|
906
|
-
#else
|
|
907
|
-
LPWSTR wide_name = (LPWSTR)_alloca((name.size() + 1) * sizeof(WCHAR));
|
|
908
|
-
if (::MultiByteToWideChar(CP_ACP, 0, name.c_str(), name.size(), wide_name, name.size() + 1) == 0)
|
|
909
|
-
return cat_type();
|
|
910
|
-
|
|
911
|
-
cat_type result(::LoadLibraryW(wide_name), &free_module);
|
|
912
|
-
return result;
|
|
913
|
-
#endif
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
inline std::string BOOST_REGEX_CALL w32_cat_get(const cat_type& cat, lcid_type, int i, const std::string& def)
|
|
917
|
-
{
|
|
918
|
-
#ifndef BOOST_NO_ANSI_APIS
|
|
919
|
-
char buf[256];
|
|
920
|
-
if (0 == ::LoadStringA(
|
|
921
|
-
static_cast<HMODULE>(cat.get()),
|
|
922
|
-
i,
|
|
923
|
-
buf,
|
|
924
|
-
256
|
|
925
|
-
))
|
|
926
|
-
{
|
|
927
|
-
return def;
|
|
928
|
-
}
|
|
929
|
-
#else
|
|
930
|
-
WCHAR wbuf[256];
|
|
931
|
-
int r = ::LoadStringW(
|
|
932
|
-
static_cast<HMODULE>(cat.get()),
|
|
933
|
-
i,
|
|
934
|
-
wbuf,
|
|
935
|
-
256
|
|
936
|
-
);
|
|
937
|
-
if (r == 0)
|
|
938
|
-
return def;
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
int buf_size = 1 + ::WideCharToMultiByte(CP_ACP, 0, wbuf, r, NULL, 0, NULL, NULL);
|
|
942
|
-
LPSTR buf = (LPSTR)_alloca(buf_size);
|
|
943
|
-
if (::WideCharToMultiByte(CP_ACP, 0, wbuf, r, buf, buf_size, NULL, NULL) == 0)
|
|
944
|
-
return def; // failed conversion.
|
|
945
|
-
#endif
|
|
946
|
-
return std::string(buf);
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
#ifndef BOOST_NO_WREGEX
|
|
950
|
-
inline std::wstring BOOST_REGEX_CALL w32_cat_get(const cat_type& cat, lcid_type, int i, const std::wstring& def)
|
|
951
|
-
{
|
|
952
|
-
wchar_t buf[256];
|
|
953
|
-
if (0 == ::LoadStringW(
|
|
954
|
-
static_cast<HMODULE>(cat.get()),
|
|
955
|
-
i,
|
|
956
|
-
buf,
|
|
957
|
-
256
|
|
958
|
-
))
|
|
959
|
-
{
|
|
960
|
-
return def;
|
|
961
|
-
}
|
|
962
|
-
return std::wstring(buf);
|
|
963
|
-
}
|
|
964
|
-
#endif
|
|
965
|
-
inline std::string BOOST_REGEX_CALL w32_transform(lcid_type idx, const char* p1, const char* p2)
|
|
966
|
-
{
|
|
967
|
-
#ifndef BOOST_NO_ANSI_APIS
|
|
968
|
-
int bytes = ::LCMapStringA(
|
|
969
|
-
idx, // locale identifier
|
|
970
|
-
LCMAP_SORTKEY, // mapping transformation type
|
|
971
|
-
p1, // source string
|
|
972
|
-
static_cast<int>(p2 - p1), // number of characters in source string
|
|
973
|
-
0, // destination buffer
|
|
974
|
-
0 // size of destination buffer
|
|
975
|
-
);
|
|
976
|
-
if (!bytes)
|
|
977
|
-
return std::string(p1, p2);
|
|
978
|
-
std::string result(++bytes, '\0');
|
|
979
|
-
bytes = ::LCMapStringA(
|
|
980
|
-
idx, // locale identifier
|
|
981
|
-
LCMAP_SORTKEY, // mapping transformation type
|
|
982
|
-
p1, // source string
|
|
983
|
-
static_cast<int>(p2 - p1), // number of characters in source string
|
|
984
|
-
&*result.begin(), // destination buffer
|
|
985
|
-
bytes // size of destination buffer
|
|
986
|
-
);
|
|
987
|
-
#else
|
|
988
|
-
UINT code_page = get_code_page_for_locale_id(idx);
|
|
989
|
-
if (code_page == 0)
|
|
990
|
-
return std::string(p1, p2);
|
|
991
|
-
|
|
992
|
-
int src_len = static_cast<int>(p2 - p1);
|
|
993
|
-
LPWSTR wide_p1 = (LPWSTR)_alloca((src_len + 1) * 2);
|
|
994
|
-
if (::MultiByteToWideChar(code_page, 0, p1, src_len, wide_p1, src_len + 1) == 0)
|
|
995
|
-
return std::string(p1, p2);
|
|
996
|
-
|
|
997
|
-
int bytes = ::LCMapStringW(
|
|
998
|
-
idx, // locale identifier
|
|
999
|
-
LCMAP_SORTKEY, // mapping transformation type
|
|
1000
|
-
wide_p1, // source string
|
|
1001
|
-
src_len, // number of characters in source string
|
|
1002
|
-
0, // destination buffer
|
|
1003
|
-
0 // size of destination buffer
|
|
1004
|
-
);
|
|
1005
|
-
if (!bytes)
|
|
1006
|
-
return std::string(p1, p2);
|
|
1007
|
-
std::string result(++bytes, '\0');
|
|
1008
|
-
bytes = ::LCMapStringW(
|
|
1009
|
-
idx, // locale identifier
|
|
1010
|
-
LCMAP_SORTKEY, // mapping transformation type
|
|
1011
|
-
wide_p1, // source string
|
|
1012
|
-
src_len, // number of characters in source string
|
|
1013
|
-
(LPWSTR) & *result.begin(), // destination buffer
|
|
1014
|
-
bytes // size of destination buffer
|
|
1015
|
-
);
|
|
1016
|
-
#endif
|
|
1017
|
-
if (bytes > static_cast<int>(result.size()))
|
|
1018
|
-
return std::string(p1, p2);
|
|
1019
|
-
while (result.size() && result[result.size() - 1] == '\0')
|
|
1020
|
-
{
|
|
1021
|
-
result.erase(result.size() - 1);
|
|
1022
|
-
}
|
|
1023
|
-
return result;
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
#ifndef BOOST_NO_WREGEX
|
|
1027
|
-
inline std::wstring BOOST_REGEX_CALL w32_transform(lcid_type idx, const wchar_t* p1, const wchar_t* p2)
|
|
1028
|
-
{
|
|
1029
|
-
int bytes = ::LCMapStringW(
|
|
1030
|
-
idx, // locale identifier
|
|
1031
|
-
LCMAP_SORTKEY, // mapping transformation type
|
|
1032
|
-
p1, // source string
|
|
1033
|
-
static_cast<int>(p2 - p1), // number of characters in source string
|
|
1034
|
-
0, // destination buffer
|
|
1035
|
-
0 // size of destination buffer
|
|
1036
|
-
);
|
|
1037
|
-
if (!bytes)
|
|
1038
|
-
return std::wstring(p1, p2);
|
|
1039
|
-
std::string result(++bytes, '\0');
|
|
1040
|
-
bytes = ::LCMapStringW(
|
|
1041
|
-
idx, // locale identifier
|
|
1042
|
-
LCMAP_SORTKEY, // mapping transformation type
|
|
1043
|
-
p1, // source string
|
|
1044
|
-
static_cast<int>(p2 - p1), // number of characters in source string
|
|
1045
|
-
reinterpret_cast<wchar_t*>(&*result.begin()), // destination buffer *of bytes*
|
|
1046
|
-
bytes // size of destination buffer
|
|
1047
|
-
);
|
|
1048
|
-
if (bytes > static_cast<int>(result.size()))
|
|
1049
|
-
return std::wstring(p1, p2);
|
|
1050
|
-
while (result.size() && result[result.size() - 1] == L'\0')
|
|
1051
|
-
{
|
|
1052
|
-
result.erase(result.size() - 1);
|
|
1053
|
-
}
|
|
1054
|
-
std::wstring r2;
|
|
1055
|
-
for (std::string::size_type i = 0; i < result.size(); ++i)
|
|
1056
|
-
r2.append(1, static_cast<wchar_t>(static_cast<unsigned char>(result[i])));
|
|
1057
|
-
return r2;
|
|
1058
|
-
}
|
|
1059
|
-
#endif
|
|
1060
|
-
inline char BOOST_REGEX_CALL w32_tolower(char c, lcid_type idx)
|
|
1061
|
-
{
|
|
1062
|
-
char result[2];
|
|
1063
|
-
#ifndef BOOST_NO_ANSI_APIS
|
|
1064
|
-
int b = ::LCMapStringA(
|
|
1065
|
-
idx, // locale identifier
|
|
1066
|
-
LCMAP_LOWERCASE, // mapping transformation type
|
|
1067
|
-
&c, // source string
|
|
1068
|
-
1, // number of characters in source string
|
|
1069
|
-
result, // destination buffer
|
|
1070
|
-
1); // size of destination buffer
|
|
1071
|
-
if (b == 0)
|
|
1072
|
-
return c;
|
|
1073
|
-
#else
|
|
1074
|
-
UINT code_page = get_code_page_for_locale_id(idx);
|
|
1075
|
-
if (code_page == 0)
|
|
1076
|
-
return c;
|
|
1077
|
-
|
|
1078
|
-
WCHAR wide_c;
|
|
1079
|
-
if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
|
|
1080
|
-
return c;
|
|
1081
|
-
|
|
1082
|
-
WCHAR wide_result;
|
|
1083
|
-
int b = ::LCMapStringW(
|
|
1084
|
-
idx, // locale identifier
|
|
1085
|
-
LCMAP_LOWERCASE, // mapping transformation type
|
|
1086
|
-
&wide_c, // source string
|
|
1087
|
-
1, // number of characters in source string
|
|
1088
|
-
&wide_result, // destination buffer
|
|
1089
|
-
1); // size of destination buffer
|
|
1090
|
-
if (b == 0)
|
|
1091
|
-
return c;
|
|
1092
|
-
|
|
1093
|
-
if (::WideCharToMultiByte(code_page, 0, &wide_result, 1, result, 2, NULL, NULL) == 0)
|
|
1094
|
-
return c; // No single byte lower case equivalent available
|
|
1095
|
-
#endif
|
|
1096
|
-
return result[0];
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
#ifndef BOOST_NO_WREGEX
|
|
1100
|
-
inline wchar_t BOOST_REGEX_CALL w32_tolower(wchar_t c, lcid_type idx)
|
|
1101
|
-
{
|
|
1102
|
-
wchar_t result[2];
|
|
1103
|
-
int b = ::LCMapStringW(
|
|
1104
|
-
idx, // locale identifier
|
|
1105
|
-
LCMAP_LOWERCASE, // mapping transformation type
|
|
1106
|
-
&c, // source string
|
|
1107
|
-
1, // number of characters in source string
|
|
1108
|
-
result, // destination buffer
|
|
1109
|
-
1); // size of destination buffer
|
|
1110
|
-
if (b == 0)
|
|
1111
|
-
return c;
|
|
1112
|
-
return result[0];
|
|
1113
|
-
}
|
|
1114
|
-
#endif
|
|
1115
|
-
inline char BOOST_REGEX_CALL w32_toupper(char c, lcid_type idx)
|
|
1116
|
-
{
|
|
1117
|
-
char result[2];
|
|
1118
|
-
#ifndef BOOST_NO_ANSI_APIS
|
|
1119
|
-
int b = ::LCMapStringA(
|
|
1120
|
-
idx, // locale identifier
|
|
1121
|
-
LCMAP_UPPERCASE, // mapping transformation type
|
|
1122
|
-
&c, // source string
|
|
1123
|
-
1, // number of characters in source string
|
|
1124
|
-
result, // destination buffer
|
|
1125
|
-
1); // size of destination buffer
|
|
1126
|
-
if (b == 0)
|
|
1127
|
-
return c;
|
|
1128
|
-
#else
|
|
1129
|
-
UINT code_page = get_code_page_for_locale_id(idx);
|
|
1130
|
-
if (code_page == 0)
|
|
1131
|
-
return c;
|
|
1132
|
-
|
|
1133
|
-
WCHAR wide_c;
|
|
1134
|
-
if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
|
|
1135
|
-
return c;
|
|
1136
|
-
|
|
1137
|
-
WCHAR wide_result;
|
|
1138
|
-
int b = ::LCMapStringW(
|
|
1139
|
-
idx, // locale identifier
|
|
1140
|
-
LCMAP_UPPERCASE, // mapping transformation type
|
|
1141
|
-
&wide_c, // source string
|
|
1142
|
-
1, // number of characters in source string
|
|
1143
|
-
&wide_result, // destination buffer
|
|
1144
|
-
1); // size of destination buffer
|
|
1145
|
-
if (b == 0)
|
|
1146
|
-
return c;
|
|
1147
|
-
|
|
1148
|
-
if (::WideCharToMultiByte(code_page, 0, &wide_result, 1, result, 2, NULL, NULL) == 0)
|
|
1149
|
-
return c; // No single byte upper case equivalent available.
|
|
1150
|
-
#endif
|
|
1151
|
-
return result[0];
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
#ifndef BOOST_NO_WREGEX
|
|
1155
|
-
inline wchar_t BOOST_REGEX_CALL w32_toupper(wchar_t c, lcid_type idx)
|
|
1156
|
-
{
|
|
1157
|
-
wchar_t result[2];
|
|
1158
|
-
int b = ::LCMapStringW(
|
|
1159
|
-
idx, // locale identifier
|
|
1160
|
-
LCMAP_UPPERCASE, // mapping transformation type
|
|
1161
|
-
&c, // source string
|
|
1162
|
-
1, // number of characters in source string
|
|
1163
|
-
result, // destination buffer
|
|
1164
|
-
1); // size of destination buffer
|
|
1165
|
-
if (b == 0)
|
|
1166
|
-
return c;
|
|
1167
|
-
return result[0];
|
|
1168
|
-
}
|
|
1169
|
-
#endif
|
|
1170
|
-
inline bool BOOST_REGEX_CALL w32_is(lcid_type idx, boost::uint32_t m, char c)
|
|
1171
|
-
{
|
|
1172
|
-
WORD mask;
|
|
1173
|
-
#ifndef BOOST_NO_ANSI_APIS
|
|
1174
|
-
if (::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation<char>::mask_base))
|
|
1175
|
-
return true;
|
|
1176
|
-
#else
|
|
1177
|
-
UINT code_page = get_code_page_for_locale_id(idx);
|
|
1178
|
-
if (code_page == 0)
|
|
1179
|
-
return false;
|
|
1180
|
-
|
|
1181
|
-
WCHAR wide_c;
|
|
1182
|
-
if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
|
|
1183
|
-
return false;
|
|
1184
|
-
|
|
1185
|
-
if (::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & m & w32_regex_traits_implementation<char>::mask_base))
|
|
1186
|
-
return true;
|
|
1187
|
-
#endif
|
|
1188
|
-
if ((m & w32_regex_traits_implementation<char>::mask_word) && (c == '_'))
|
|
1189
|
-
return true;
|
|
1190
|
-
return false;
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
#ifndef BOOST_NO_WREGEX
|
|
1194
|
-
inline bool BOOST_REGEX_CALL w32_is(lcid_type idx, boost::uint32_t m, wchar_t c)
|
|
1195
|
-
{
|
|
1196
|
-
WORD mask;
|
|
1197
|
-
if (::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation<wchar_t>::mask_base))
|
|
1198
|
-
return true;
|
|
1199
|
-
if ((m & w32_regex_traits_implementation<wchar_t>::mask_word) && (c == '_'))
|
|
1200
|
-
return true;
|
|
1201
|
-
if ((m & w32_regex_traits_implementation<wchar_t>::mask_unicode) && (c > 0xff))
|
|
1202
|
-
return true;
|
|
1203
|
-
return false;
|
|
1204
|
-
}
|
|
1205
|
-
#endif
|
|
1206
|
-
|
|
1207
|
-
} // BOOST_REGEX_DETAIL_NS
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
} // boost
|
|
1211
|
-
|
|
1212
|
-
#ifdef BOOST_MSVC
|
|
1213
|
-
#pragma warning(pop)
|
|
1214
|
-
#endif
|
|
1215
|
-
|
|
1216
|
-
#ifdef BOOST_MSVC
|
|
1217
|
-
#pragma warning(push)
|
|
1218
|
-
#pragma warning(disable: 4103)
|
|
1219
|
-
#endif
|
|
1220
|
-
#ifdef BOOST_HAS_ABI_HEADERS
|
|
1221
|
-
# include BOOST_ABI_SUFFIX
|
|
1222
|
-
#endif
|
|
1223
|
-
#ifdef BOOST_MSVC
|
|
1224
|
-
#pragma warning(pop)
|
|
1225
|
-
#endif
|
|
1226
|
-
|
|
1227
|
-
#endif // BOOST_REGEX_NO_WIN32_LOCALE
|
|
1228
|
-
|
|
1229
|
-
#endif
|