32 Commits

Author SHA1 Message Date
Alexander Grund
e8f9544352 Replace some TEST_REQUIRE by if TEST 2025-01-10 13:33:08 +01:00
Alexander Grund
5a58e65bda Remove superflous subfolders of src
The shorter paths make the sources easier to navigate.

Basically revert of #99 / f44b3bb771f01fb94614260d57e1d09cdfe1cdff
after the underlying issue is resolved.
2025-01-10 12:50:45 +01:00
Alexander Grund
6b6e656156 Fix types for to_unicode/from_unicode
Need to use utf::codepoint consistently.
2023-07-03 14:58:05 +02:00
Alexander Grund
26469cd230
Suppress or handle missing coverage of test code
Try to achieve 100% test code coverage to find accidentally missed ones.
Especially the WinAPI tests had some wrongly uncovered lines at function
start/end which needed to be excluded.
2023-06-27 23:04:08 +02:00
Alexander Grund
9b1813e757 Remove superflous braces
Make the code a bit shorter vertically, enforced formating ensures
correct indentation which provides enough readability
2023-05-16 12:04:59 +02:00
Alexander Grund
c59f928088 Add tests for failing create_simple_converter and fix missing coverage 2023-05-07 19:01:45 +02:00
Alexander Grund
0a68c52b7f Modernize using nullptr 2023-05-07 19:01:45 +02:00
Alexander Grund
329170e360
Fix comments, especially in examples
Some were outdated/wrong (C&P) or using the docstring triple-slash prefix
2023-04-16 16:17:29 +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
3609eca8b2 Make use of enhanced test macros
Use the TEST-macros that print the values on mismatch to aid debugging
2023-01-10 14:45:07 +01:00
Alexander Grund
6567d838b3
Use constexpr instead of static const 2022-10-13 20:58:26 +02:00
Alexander Grund
fa4afd7a5d Switch to consistent west-const
Especially for `const char*` which seems to be more common than `char const*`
2022-10-10 14:25:58 +02:00
Alexander Grund
7784f46243 Format sources
Use clang-format-14 to format source code consistently.
Closes #98
2022-10-10 14:25:58 +02:00
Alexander Grund
158e742424
Fix test crash when ICU has no Shift-JIS resources
Dereferenced nullptr
2022-09-17 22:41:22 +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
fadb2190ce
Move test headers to subfolder
Gets rid of the `test_` prefix in the filenames and avoids confusing those with the actual tests especially by renaming the test framework file from `test_locale.hpp` to `unit_test.hpp`
2022-09-13 12:50:23 +02:00
Alexander Grund
707f801c55
Remive vim markers
To be replaced by clang-format in the future.
2022-07-12 18:35:42 +02:00
Alexander Grund
595934f25e
Update license headers
Use the more concise format omitting the reference to the license file
and refer to the URL only.
2022-07-12 18:35:41 +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
aa30bd33aa Refactor test framework
Use a common `main` function calling into custom `test_main` functions and
move all common code into the former.
Also introduce an RAII class for a `locale_t` to avoid leaks and reduce
the code further.
Add some LCOV annotations for lines not expected to be reached.
2022-06-30 15:08:08 +02:00
Alexander Grund
8c7338cd0d Use \n instead of std::endl where appropriate
We usually don't need the flush so use \n at end of strings which
greatly shortens the code.
2022-06-30 15:08:08 +02:00
Alexander Grund
00c8e07689 Remove using std-namespace and reformat
Removes the `using namespace std` to easier differentiate between
Boost.Locale and Std stuff.
Add spaces around shift operators.
2022-06-30 15:08:08 +02:00
Alexander Grund
d1fc12426f Remove trailing spaces 2022-06-04 11:50:39 +02:00
Alexander Grund
039f016c8c
Handle constant-expression and implicit-cast warnings
Use explicit casts to narrow types and suppress the constant-expression
warnings on MSVC via a new macro
2022-05-30 17:20:23 +02:00
Alexander Grund
40c5c1bda7 Avoid some more warnings 2022-05-30 15:56:50 +02:00
Alexander Grund
f3fa220608
Fix includes and unify include style
For consistency the following rules are used:
- public includes (include folder) either include any <boost/locale/*>
  first. At least <boost/locale/config.hpp>
- The first include in a cpp file is the corresponding header if any
- Then <boost/locale/*>, <boost/*>, <*>, "*" in this order
- Warning suppression pragmas come last where possible
- Use the C++ headers where available (i.e. <cstring> not <string.h>)
2022-05-29 22:20:10 +02:00
Alexander Grund
04e7d5a6d1
Fix compilation without auto-ptr 2022-05-28 09:44:36 +02:00
Artyom Beilis
322437a485 Adding dual auto_ptr/unique_ptr support 2017-08-07 13:32:40 +03:00
Artyom Beilis
b7fcbdc2de POSIX backed support on FreeBSD 2015-09-30 17:56:37 +03:00
Artyom Beilis
eb14e99e18 Lineup with trunk
[SVN r82266]
2012-12-29 14:18:45 +00:00
Artyom Beilis
48ff4519b8 - Updates according to library requirements
- cleanup of inspect warnings
  - various requiremets like libraries.htm and maintainers.txt


[SVN r73786]
2011-08-15 19:04:34 +00:00
Artyom Beilis
4c30e01d23 First Version of Boost.Locale integrated into SVN trunk
[SVN r73017]
2011-07-12 13:57:36 +00:00