2
0
mirror of https://github.com/boostorg/locale.git synced 2026-01-19 04:22:08 +00:00

41 Commits

Author SHA1 Message Date
Alexander Grund
c2147f6486 Switch to boost::core::string_view
This is compatible to `std::string_view` and also to `boost::string_view`
so hence the better option.
2025-01-10 13:33:09 +01:00
Alexander Grund
258e959402 Use Boost::charconv for try_to_int 2025-01-10 13:33:05 +01:00
Alexander Grund
b919614216 Move try_to_int to extra header 2025-01-10 13:33:03 +01:00
Alexander Grund
5a58e65bda Remove superflous subfolders of src
The shorter paths make the sources easier to navigate.

Basically revert of #99 / f44b3bb771
after the underlying issue is resolved.
2025-01-10 12:50:45 +01:00
Alexander Grund
843fdc9157 Replace (semi-)absolute includes to implementation headers by relative ones
Makes it easier to see the distinction, especially for tools.
2025-01-04 20:55:49 +01:00
Alexander Grund
ec1676280e Raise minimum ICU version to 4.8.1
A lot of checks and a major workaround are for ICU 4.8 or earlier which
can be removed.
An annoying bug (Parsing of timezones like "GMT" in "full" format followed by unrelated text)
fixed in 4.8.1 is worth avoiding by requiring this version over 4.8.0.
2024-12-27 12:14:43 +01:00
Alexander Grund
bbfb763a98 Exclude ICU 50.1
This version has a regression with Integer parsing.
See https://unicode-org.atlassian.net/browse/ICU-9780
2024-12-27 12:14:43 +01:00
Alexander Grund
f29d950d80 Fix type confusion with boost::locale::collator
The class derived from `std::collate` which is always present in `std::locale`.
So checks for the `boost::locale::collator` facet may return wrongly true.
As a fix make this an independent facet with its own ID.
Use an adapter such that a std::collate derived class can use its abilities.
2024-02-07 20:14:39 +01:00
Alexander Grund
c67a5f2a1a Update CMakeLists 2023-10-13 18:42:45 +02:00
Alexander Grund
a4b80f9de2 Deprecate create_*_new_ptr functions and introduce helper to create a unique_ptr
Ownership should always be clear so remove those functions returning raw pointers.
2023-06-28 22:48:53 +02:00
Alexander Grund
573c8f78fb Refactoring: Simplify templates based on (supported) char types
Instead of explicit instantiation for each supported char type and an extra copy for documentation generation reduce to only a single template and instantiate the whole class explicitly.
To ensure a reasonable error is generated introduce an `is_supported_char`-trait and `static_assert` on it.
To further reduce the repetition when instantiating the templates create a macro to loop over the supported char types.
2023-05-14 21:18:07 +02:00
Alexander Grund
ce9c2f845a Introduce converter classes as alternative to to_utf/from_utf/between
May save some overhead creating implementation classes and allows to
write shorter code for doing the same conversions repeatatly.
Also allows a hook for testing each backend individually.
2023-05-10 14:17:12 +02:00
Alexander Grund
926655fba5 Rename *_codepage.ipp to _converter.hpp
No need to use a different extension why may confuse tooling.
Also the files contain converter classes, so the naming is confusing.
2023-05-09 14:18:23 +02:00
Alexander Grund
958ca63e4f Factor out iconv_codecvt and remove use of std::shared_ptr
Iconv is also available on Windows so not specific to the POSIX backend.
Instead of a shared_ptr to a vector we can simply use a `std::array`.
Finally the `iconv_t` can be put into an RAII class.
2023-03-06 16:37:38 +01:00
Alexander Grund
a7f94c0eb7 Put encoding utils into util/encoding.{hc}pp
This deduplicates e.g. `convert_encoding_name`/`normalize_encoding`
and makes the structure more logical by not mixing those util functions
with the char converter code.
2023-02-18 18:56:56 +01:00
Alexander Grund
e37106bd62 Make locale_data public
This can be useful for other projects
2023-02-18 18:56:55 +01:00
Alexander Grund
7b0c37d404 Move BOOST_LOCALE_SOURCE define to buildsystem
Ensures that this is defined consistently for all files.
Fixes #145
2023-02-17 17:17:29 +01:00
Alexander Grund
1cc2a017ab Fix some MSVC warnings
Define `_SCL_SECURE_NO_WARNINGS` for building the library to avoid "Call to 'std::copy' with parameters that may be unsafe" in `src\boost\locale\std\converter.cpp`
This also allows to remove the multiple suppressions of C4996
2022-11-22 09:15:17 +01:00
Alexander Grund
943eda0b60 Fix CMake Iconv check workaround 2022-10-27 10:17:17 +02:00
Alexander Grund
d860e99818 Factor out implementation of formatters_cache to source file 2022-10-26 19:55:39 +02:00
Alexander Grund
64ad69ce42 Rename predefined_formatters.hpp -> formatters_cache.hpp 2022-10-24 19:57:46 +02:00
Alexander Grund
fee802eb4a Add CMake option to enable C++11 char types
Fix some issues discovered
Experimental, may be removed
2022-10-24 19:57:45 +02:00
Alexander Grund
13b26b8237 Workaround iconv link issue on FreeBSD
FreeBSD has a builtin iconv and an external one in /usr/local.
When linking against ICU (in /usr/local) the (incompatible) headers
of the external libiconv are found failing with missing symbols such
as `libiconv_open`.
Account for that in the CMake build.

Signed-off-by: Alexander Grund <Flamefire@users.noreply.github.com>
2022-10-21 21:29:28 +02:00
Flamefire
2e937d339e Update CMake dependencies 2022-09-14 10:43:44 +02:00
Alexander Grund
3467716f92 Use std::function and std::unordered_map 2022-09-14 10:13:03 +02:00
Alexander Grund
63381d6d9f Replace Boost.TypeTraits by C++11 <type_traits> 2022-09-14 09:44:29 +02:00
Alexander Grund
14f80f5d0d Remove dependency on Boost.StaticAssert
Replace by C++11 `static_assert`
2022-09-14 09:40:58 +02:00
Alexander Grund
f3f53fa381 Replace boost::shared_ptr, std::auto_ptr by std::shared_ptr and std::unique_ptr 2022-09-14 09:36:20 +02:00
Alexander Grund
3bc127eb35 Require C++11
Modify build configs and CI files to check for C++11 support
2022-09-14 09:36:08 +02:00
Alexander Grund
b232a219b2 CMake: Group headers and sources into (IDE) folders 2022-09-13 12:50:22 +02:00
Alexander Grund
17120704b0 CMake: Add option to enable Werror 2022-09-13 12:50:22 +02:00
Alexander Grund
41868c62a0 Support systems without implicit include path
To support e.g. recent Cygwins where relative paths to the current file are not automatically resolved
move the sources into a `boost/locale` subfolder and add `src` to the private include paths.
This then allows to include those files as `"boost/locale/foo/bar.hpp"`.
2022-07-02 15:38:31 +02:00
Alexander Grund
52331a466b Use Boost.Predef to detect Linux
The `__linux` define may not be set. `__linux__` or `linux` mayb be used.
So use Boost.Predef `BOOST_OS_LINUX` instead.
Closes #49
2022-06-04 11:50:39 +02:00
Alexander Grund
cece0fb018 Enable warnings-as-error in test
Ensures a warning-free build
2022-05-30 17:20:22 +02:00
Alexander Grund
7ff789522d Suppress remaining CRT "secure" warnings
Add _CRT_SECURE_NO_WARNINGS to test files and build rules
2022-05-30 10:32:01 +02:00
Alexander Grund
f61245a3d2 Add examples and performance test to CMake build
Make sure performance examples compile at least and examples also run.
2022-05-29 22:20:10 +02:00
Alexander Grund
425c54abae Add headers to CMake project
Adding headers makes them appear in IDEs which enables searching them.
2022-05-24 18:58:16 +02:00
Peter Dimov
5789ae2532 Do not define BOOST_LOCALE_SOURCE in CMakeLists.txt 2021-06-09 18:46:54 +03:00
Peter Dimov
f831b87be9 Enable POSIX backend on Linux/macOS, per Jamfile 2021-06-07 02:02:49 +03:00
Peter Dimov
d50ed5103e Move status message after find_package(REQUIRED) calls 2021-06-07 00:30:32 +03:00
Peter Dimov
14e45fa61b Add CMakeLists.txt 2021-06-07 00:09:34 +03:00