Skip to content

Commit 47d4b17

Browse files
committed
Update contrib/restricted/boost/locale to 1.86.0
commit_hash:f67feab5ae9d126714c39799fa3cc1c08f434ae0
1 parent 1c41d60 commit 47d4b17

22 files changed

+534
-252
lines changed

contrib/restricted/boost/locale/.yandex_meta/devtools.copyrights.report

+28-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ BELONGS ya.make
5656
include/boost/locale/date_time_facet.hpp [2:2]
5757
include/boost/locale/encoding.hpp [2:2]
5858
include/boost/locale/encoding_errors.hpp [2:2]
59-
include/boost/locale/encoding_utf.hpp [2:2]
59+
include/boost/locale/encoding_utf.hpp [2:3]
6060
include/boost/locale/format.hpp [2:3]
6161
include/boost/locale/formatting.hpp [2:3]
6262
include/boost/locale/generator.hpp [2:2]
@@ -104,7 +104,7 @@ BELONGS ya.make
104104
src/boost/locale/shared/generator.cpp [2:2]
105105
src/boost/locale/shared/iconv_codecvt.cpp [2:3]
106106
src/boost/locale/shared/iconv_codecvt.hpp [2:2]
107-
src/boost/locale/shared/ids.cpp [2:2]
107+
src/boost/locale/shared/ids.cpp [2:3]
108108
src/boost/locale/shared/ios_prop.hpp [2:3]
109109
src/boost/locale/shared/localization_backend.cpp [2:2]
110110
src/boost/locale/shared/mo_hash.hpp [2:2]
@@ -150,6 +150,19 @@ BELONGS ya.make
150150
Files with this license:
151151
src/boost/locale/icu/uconv.hpp [2:3]
152152

153+
KEEP COPYRIGHT_SERVICE_LABEL 187d73eada66cef6d5d08ed727437603
154+
BELONGS ya.make
155+
License text:
156+
// Copyright (c) 2024 Alexander Grund
157+
Scancode info:
158+
Original SPDX id: COPYRIGHT_SERVICE_LABEL
159+
Score : 100.00
160+
Match type : COPYRIGHT
161+
Files with this license:
162+
include/boost/locale/detail/allocator_traits.hpp [2:2]
163+
src/boost/locale/shared/ids.cpp [2:3]
164+
src/boost/locale/shared/std_collate_adapter.hpp [2:2]
165+
153166
KEEP COPYRIGHT_SERVICE_LABEL 5f6f0ebf2d6180caac56d446585150fe
154167
BELONGS ya.make
155168
License text:
@@ -163,6 +176,18 @@ BELONGS ya.make
163176
include/boost/locale/generic_codecvt.hpp [2:3]
164177
include/boost/locale/utf8_codecvt.hpp [2:2]
165178

179+
KEEP COPYRIGHT_SERVICE_LABEL 70211eab6462dd6308fa5b813ba0f2c0
180+
BELONGS ya.make
181+
License text:
182+
// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
183+
// Copyright (c) 2022-2024 Alexander Grund
184+
Scancode info:
185+
Original SPDX id: COPYRIGHT_SERVICE_LABEL
186+
Score : 100.00
187+
Match type : COPYRIGHT
188+
Files with this license:
189+
include/boost/locale/encoding_utf.hpp [2:3]
190+
166191
KEEP COPYRIGHT_SERVICE_LABEL 8d04644911f5fff0cef0ea7eeadf74ee
167192
BELONGS ya.make
168193
License text:
@@ -182,13 +207,13 @@ BELONGS ya.make
182207
KEEP COPYRIGHT_SERVICE_LABEL a999dc6b43b371fa616fd4c0c30cf6f3
183208
BELONGS ya.make
184209
License text:
185-
// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
186210
// Copyright (c) 2023 Alexander Grund
187211
Scancode info:
188212
Original SPDX id: COPYRIGHT_SERVICE_LABEL
189213
Score : 100.00
190214
Match type : COPYRIGHT
191215
Files with this license:
216+
include/boost/locale/detail/any_string.hpp [2:2]
192217
include/boost/locale/util/locale_data.hpp [2:3]
193218
src/boost/locale/shared/message.hpp [2:2]
194219
src/boost/locale/util/make_std_unique.hpp [2:2]

contrib/restricted/boost/locale/.yandex_meta/devtools.licenses.report

+9-4
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ BELONGS ya.make
8686
include/boost/locale/config.hpp [5:5]
8787
include/boost/locale/conversion.hpp [5:5]
8888
include/boost/locale/date_time_facet.hpp [5:5]
89+
include/boost/locale/detail/allocator_traits.hpp [5:5]
8990
include/boost/locale/detail/encoding.hpp [5:5]
9091
include/boost/locale/detail/is_supported_char.hpp [5:5]
9192
include/boost/locale/encoding.hpp [5:5]
9293
include/boost/locale/encoding_errors.hpp [5:5]
93-
include/boost/locale/encoding_utf.hpp [5:5]
94+
include/boost/locale/encoding_utf.hpp [6:6]
9495
include/boost/locale/formatting.hpp [6:6]
9596
include/boost/locale/generic_codecvt.hpp [6:6]
9697
include/boost/locale/info.hpp [6:6]
@@ -116,9 +117,10 @@ BELONGS ya.make
116117
src/boost/locale/shared/date_time.cpp [6:6]
117118
src/boost/locale/shared/formatting.cpp [5:5]
118119
src/boost/locale/shared/iconv_codecvt.hpp [5:5]
119-
src/boost/locale/shared/ids.cpp [5:5]
120+
src/boost/locale/shared/ids.cpp [6:6]
120121
src/boost/locale/shared/ios_prop.hpp [6:6]
121122
src/boost/locale/shared/message.hpp [5:5]
123+
src/boost/locale/shared/std_collate_adapter.hpp [5:5]
122124
src/boost/locale/std/codecvt.cpp [5:5]
123125
src/boost/locale/std/collate.cpp [5:5]
124126
src/boost/locale/std/converter.cpp [5:5]
@@ -159,11 +161,12 @@ BELONGS ya.make
159161
include/boost/locale/config.hpp [4:4]
160162
include/boost/locale/conversion.hpp [4:4]
161163
include/boost/locale/date_time_facet.hpp [4:4]
164+
include/boost/locale/detail/allocator_traits.hpp [4:4]
162165
include/boost/locale/detail/encoding.hpp [4:4]
163166
include/boost/locale/detail/is_supported_char.hpp [4:4]
164167
include/boost/locale/encoding.hpp [4:4]
165168
include/boost/locale/encoding_errors.hpp [4:4]
166-
include/boost/locale/encoding_utf.hpp [4:4]
169+
include/boost/locale/encoding_utf.hpp [5:5]
167170
include/boost/locale/formatting.hpp [5:5]
168171
include/boost/locale/generic_codecvt.hpp [5:5]
169172
include/boost/locale/info.hpp [5:5]
@@ -189,9 +192,10 @@ BELONGS ya.make
189192
src/boost/locale/shared/date_time.cpp [5:5]
190193
src/boost/locale/shared/formatting.cpp [4:4]
191194
src/boost/locale/shared/iconv_codecvt.hpp [4:4]
192-
src/boost/locale/shared/ids.cpp [4:4]
195+
src/boost/locale/shared/ids.cpp [5:5]
193196
src/boost/locale/shared/ios_prop.hpp [5:5]
194197
src/boost/locale/shared/message.hpp [4:4]
198+
src/boost/locale/shared/std_collate_adapter.hpp [4:4]
195199
src/boost/locale/std/codecvt.cpp [4:4]
196200
src/boost/locale/std/collate.cpp [4:4]
197201
src/boost/locale/std/converter.cpp [4:4]
@@ -229,6 +233,7 @@ BELONGS ya.make
229233
include/boost/locale/boundary/boundary_point.hpp [4:5]
230234
include/boost/locale/boundary/types.hpp [4:5]
231235
include/boost/locale/date_time.hpp [4:5]
236+
include/boost/locale/detail/any_string.hpp [4:5]
232237
include/boost/locale/detail/facet_id.hpp [4:5]
233238
include/boost/locale/format.hpp [5:6]
234239
include/boost/locale/generator.hpp [4:5]

contrib/restricted/boost/locale/.yandex_meta/licenses.list.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ DEALINGS IN THE SOFTWARE.
7777

7878
====================COPYRIGHT====================
7979
// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
80-
// Copyright (c) 2023 Alexander Grund
80+
// Copyright (c) 2022-2024 Alexander Grund
8181

8282

8383
====================COPYRIGHT====================
@@ -94,5 +94,13 @@ DEALINGS IN THE SOFTWARE.
9494
// Copyright (c) 2021-2023 Alexander Grund
9595

9696

97+
====================COPYRIGHT====================
98+
// Copyright (c) 2023 Alexander Grund
99+
100+
97101
====================COPYRIGHT====================
98102
// Copyright (c) 2023-2023 Alexander Grund
103+
104+
105+
====================COPYRIGHT====================
106+
// Copyright (c) 2024 Alexander Grund

contrib/restricted/boost/locale/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ Distributed under the [Boost Software License, Version 1.0](https://www.boost.or
4242

4343
### Build Status
4444

45-
Branch | GH Actions | Appveyor | codecov.io | Deps | Docs | Tests |
46-
:-------------: | ---------- | -------- | ---------- | ---- | ---- | ----- |
47-
[`master`](https://github.com/boostorg/locale/tree/master) | [![CI](https://github.com/boostorg/locale/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/boostorg/locale/actions/workflows/ci.yml) | [![Build status](https://ci.appveyor.com/api/projects/status/github/boostorg/locale?branch=master&svg=true)](https://ci.appveyor.com/project/Flamefire/locale/branch/master) | [![codecov](https://codecov.io/gh/boostorg/locale/branch/master/graph/badge.svg)](https://codecov.io/gh/boostorg/locale/branch/master) | [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/locale.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](https://www.boost.org/doc/libs/master/libs/locale/doc/html/index.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/locale.html)
48-
[`develop`](https://github.com/boostorg/locale/tree/develop) | [![CI](https://github.com/boostorg/locale/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/boostorg/locale/actions/workflows/ci.yml) | [![Build status](https://ci.appveyor.com/api/projects/status/github/boostorg/locale?branch=develop&svg=true)](https://ci.appveyor.com/project/Flamefire/locale/branch/develop) | [![codecov](https://codecov.io/gh/boostorg/locale/branch/develop/graph/badge.svg)](https://codecov.io/gh/boostorg/locale/branch/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/locale.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](https://www.boost.org/doc/libs/develop/libs/locale/doc/html/index.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/locale.html)
45+
Branch | GH Actions | Appveyor | Drone | codecov.io | Deps | Docs | Tests |
46+
:-------------: | ---------- | -------- | ----- | ---------- | ---- | ---- | ----- |
47+
[`master`](https://github.com/boostorg/locale/tree/master) | [![CI](https://github.com/boostorg/locale/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/boostorg/locale/actions/workflows/ci.yml) | [![Build status](https://ci.appveyor.com/api/projects/status/github/boostorg/locale?branch=master&svg=true)](https://ci.appveyor.com/project/Flamefire/locale/branch/master) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/locale/status.svg?ref=refs/heads/master)](https://drone.cpp.al/boostorg/locale) | [![codecov](https://codecov.io/gh/boostorg/locale/branch/master/graph/badge.svg)](https://codecov.io/gh/boostorg/locale/branch/master) | [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/locale.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](https://www.boost.org/doc/libs/master/libs/locale/doc/html/index.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/locale.html)
48+
[`develop`](https://github.com/boostorg/locale/tree/develop) | [![CI](https://github.com/boostorg/locale/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/boostorg/locale/actions/workflows/ci.yml) | [![Build status](https://ci.appveyor.com/api/projects/status/github/boostorg/locale?branch=develop&svg=true)](https://ci.appveyor.com/project/Flamefire/locale/branch/develop) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/locale/status.svg?ref=refs/heads/develop)](https://drone.cpp.al/boostorg/locale) | [![codecov](https://codecov.io/gh/boostorg/locale/branch/develop/graph/badge.svg)](https://codecov.io/gh/boostorg/locale/branch/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/locale.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](https://www.boost.org/doc/libs/develop/libs/locale/doc/html/index.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/locale.html)
4949

5050
### Directories
5151

contrib/restricted/boost/locale/include/boost/locale/collator.hpp

+29-32
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define BOOST_LOCALE_COLLATOR_HPP_INCLUDED
99

1010
#include <boost/locale/config.hpp>
11+
#include <boost/locale/detail/facet_id.hpp>
1112
#include <locale>
1213

1314
#ifdef BOOST_MSVC
@@ -43,17 +44,16 @@ namespace boost { namespace locale {
4344

4445
/// \brief Collation facet.
4546
///
46-
/// It reimplements standard C++ std::collate,
47-
/// allowing usage of std::locale for direct string comparison
47+
/// It reimplements standard C++ std::collate with support for collation levels
4848
template<typename CharType>
49-
class collator : public std::collate<CharType> {
49+
class BOOST_SYMBOL_VISIBLE collator : public std::locale::facet, public detail::facet_id<collator<CharType>> {
5050
public:
5151
/// Type of the underlying character
5252
typedef CharType char_type;
5353
/// Type of string used with this facet
5454
typedef std::basic_string<CharType> string_type;
5555

56-
/// Compare two strings in rage [b1,e1), [b2,e2) according using a collation level \a level. Calls do_compare
56+
/// Compare two strings in range [b1,e1), [b2,e2) according to collation level \a level. Calls do_compare
5757
///
5858
/// Returns -1 if the first of the two strings sorts before the seconds, returns 1 if sorts after and 0 if
5959
/// they considered equal.
@@ -66,6 +66,13 @@ namespace boost { namespace locale {
6666
return do_compare(level, b1, e1, b2, e2);
6767
}
6868

69+
/// Default compare function as-in std::collate that does not take collation level into account.
70+
/// Uses identical level
71+
int compare(const char_type* b1, const char_type* e1, const char_type* b2, const char_type* e2) const
72+
{
73+
return compare(collate_level::identical, b1, e1, b2, e2);
74+
}
75+
6976
/// Create a binary string that can be compared to other in order to get collation order. The string is created
7077
/// for text in range [b,e). It is useful for collation of multiple strings for text.
7178
///
@@ -80,13 +87,24 @@ namespace boost { namespace locale {
8087
return do_transform(level, b, e);
8188
}
8289

90+
/// Default transform function as-in std::collate that does not take collation level into account.
91+
/// Uses identical level
92+
string_type transform(const char_type* b, const char_type* e) const
93+
{
94+
return transform(collate_level::identical, b, e);
95+
}
96+
8397
/// Calculate a hash of a text in range [b,e). The value can be used for collation sensitive string comparison.
8498
///
8599
/// If compare(level,b1,e1,b2,e2) == 0 then hash(level,b1,e1) == hash(level,b2,e2)
86100
///
87101
/// Calls do_hash
88102
long hash(collate_level level, const char_type* b, const char_type* e) const { return do_hash(level, b, e); }
89103

104+
/// Default hash function as-in std::collate that does not take collation level into account.
105+
/// Uses identical level
106+
long hash(const char_type* b, const char_type* e) const { return hash(collate_level::identical, b, e); }
107+
90108
/// Compare two strings \a l and \a r using collation level \a level
91109
///
92110
/// Returns -1 if the first of the two strings sorts before the seconds, returns 1 if sorts after and 0 if
@@ -107,7 +125,7 @@ namespace boost { namespace locale {
107125
/// Create a binary string from string \a s, that can be compared to other, useful for collation of multiple
108126
/// strings.
109127
///
110-
/// The transformation follows these rules:
128+
/// The transformation follows this rule:
111129
/// \code
112130
/// compare(level,s1,s2) == sign( transform(level,s1).compare(transform(level,s2)) );
113131
/// \endcode
@@ -118,29 +136,7 @@ namespace boost { namespace locale {
118136

119137
protected:
120138
/// constructor of the collator object
121-
collator(size_t refs = 0) : std::collate<CharType>(refs) {}
122-
123-
/// This function is used to override default collation function that does not take in account collation level.
124-
/// Uses primary level
125-
int
126-
do_compare(const char_type* b1, const char_type* e1, const char_type* b2, const char_type* e2) const override
127-
{
128-
return do_compare(collate_level::identical, b1, e1, b2, e2);
129-
}
130-
131-
/// This function is used to override default collation function that does not take in account collation level.
132-
/// Uses primary level
133-
string_type do_transform(const char_type* b, const char_type* e) const override
134-
{
135-
return do_transform(collate_level::identical, b, e);
136-
}
137-
138-
/// This function is used to override default collation function that does not take in account collation level.
139-
/// Uses primary level
140-
long do_hash(const char_type* b, const char_type* e) const override
141-
{
142-
return do_hash(collate_level::identical, b, e);
143-
}
139+
collator(size_t refs = 0) : std::locale::facet(refs) {}
144140

145141
/// Actual function that performs comparison between the strings. For details see compare member function. Can
146142
/// be overridden.
@@ -157,7 +153,7 @@ namespace boost { namespace locale {
157153
};
158154

159155
/// \brief This class can be used in STL algorithms and containers for comparison of strings
160-
/// with a level other than primary
156+
/// with a level other than identical
161157
///
162158
/// For example:
163159
///
@@ -169,21 +165,22 @@ namespace boost { namespace locale {
169165
template<typename CharType, collate_level default_level = collate_level::identical>
170166
struct comparator {
171167
public:
172-
/// Create a comparator class for locale \a l and with collation leval \a level
168+
/// Create a comparator class for locale \a l and with collation level \a level
173169
///
174170
/// \throws std::bad_cast: \a l does not have \ref collator facet installed
175171
comparator(const std::locale& l = std::locale(), collate_level level = default_level) :
176-
locale_(l), level_(level)
172+
locale_(l), collator_(std::use_facet<collator<CharType>>(locale_)), level_(level)
177173
{}
178174

179175
/// Compare two strings -- equivalent to return left < right according to collation rules
180176
bool operator()(const std::basic_string<CharType>& left, const std::basic_string<CharType>& right) const
181177
{
182-
return std::use_facet<collator<CharType>>(locale_).compare(level_, left, right) < 0;
178+
return collator_.compare(level_, left, right) < 0;
183179
}
184180

185181
private:
186182
std::locale locale_;
183+
const collator<CharType>& collator_;
187184
collate_level level_;
188185
};
189186

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// Copyright (c) 2024 Alexander Grund
3+
//
4+
// Distributed under the Boost Software License, Version 1.0.
5+
// https://www.boost.org/LICENSE_1_0.txt
6+
7+
#ifndef BOOST_LOCALE_DETAIL_ALLOCATOR_TRAITS_HPP_INCLUDED
8+
#define BOOST_LOCALE_DETAIL_ALLOCATOR_TRAITS_HPP_INCLUDED
9+
10+
#include <boost/locale/config.hpp>
11+
#include <memory>
12+
#include <type_traits>
13+
14+
/// \cond INTERNAL
15+
namespace boost { namespace locale { namespace conv { namespace detail {
16+
template<class Alloc, typename T>
17+
using rebind_alloc = typename std::allocator_traits<Alloc>::template rebind_alloc<T>;
18+
19+
template<class Alloc, typename T, typename Result = void>
20+
using enable_if_allocator_for =
21+
typename std::enable_if<std::is_same<typename Alloc::value_type, T>::value, Result>::type;
22+
template<class Alloc, typename T, class Alloc2, typename T2, typename Result = void>
23+
using enable_if_allocator_for2 = typename std::enable_if<std::is_same<typename Alloc::value_type, T>::value
24+
&& std::is_same<typename Alloc2::value_type, T2>::value,
25+
Result>::type;
26+
}}}} // namespace boost::locale::conv::detail
27+
28+
/// \endcond
29+
30+
#endif

0 commit comments

Comments
 (0)