20 Commits

Author SHA1 Message Date
be273d4263 exception: Add exception_msg helper
Signed-off-by: Simon Rozman <simon@rozman.si>
2025-05-13 09:36:22 +02:00
a7543cf9ab string: add snprintf
Signed-off-by: Simon Rozman <simon@rozman.si>
2025-01-13 11:01:01 +01:00
8fd9fbf191 Bump Copyright year
Signed-off-by: Simon Rozman <simon@rozman.si>
2025-01-08 12:36:35 +01:00
5675f8b139 string: add recoding from UTF-16 to UTF-32
I know there are system functions for this (and libiconv), but this is
so trivial and quick in our implementation.
2024-09-27 14:11:11 +02:00
7b21a3983c stdex: add langid
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-08-19 11:20:42 +02:00
0a719e3081 Xcode: turn on and resolve all warnings 2024-02-14 15:05:41 +01:00
0560c7bce9 Add missing UTF-8 BOM
This is required on Windows with default charset set to Windows-1252 or
another non-UTF-8 charset.

Signed-off-by: Simon Rozman <simon@rozman.si>
2024-02-14 12:33:29 +01:00
9acd185d44 UnitTest: redesing to avoid #include ".cpp" in Xcode
Each unit test .cpp file is not a separate compilation unit in Xcode project
like it is in Visual Studio. Hopefully, Visual Studio test tool still likes
this arrangement.

Signed-off-by: Simon Rozman <simon@rozman.si>
2024-02-08 15:18:42 +01:00
1e627e1c6b UnitTests: add zlib testing
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-02-08 14:38:34 +01:00
08a18d1519 macOS support
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-02-08 12:09:33 +01:00
38c6b40b21 Bump Copyright year
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-06 10:55:09 +01:00
424f297c7b sgml: sgml2wstr→sgml2str, wstr2sgml→str2sgml 🧨
This is analogous to string.hpp's strlen, strcpy, strcat, which use C++
polymorphism rather than function name decorations for char/wchar_t
flavors.

Signed-off-by: Simon Rozman <simon@rozman.si>
2023-11-17 15:14:53 +01:00
67d328a550 watchdog: add
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-10-10 16:42:03 +02:00
b8fae2d0dd pch.h -> pch.hpp
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-09-25 15:05:36 +02:00
4e25c13d08 hash: macOS support
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-09-25 15:04:19 +02:00
10d74988aa Add mising UTF-8 BOM's
Curse you XCode! 😔

Signed-off-by: Simon Rozman <simon@rozman.si>
2023-09-22 13:07:14 +02:00
6689aa5210 stream: add file::exists and file::readonly
We are targeting C++14, while C++17 already has std::filesystem::exists. 😢

Signed-off-by: Simon Rozman <simon@rozman.si>
2023-09-20 13:00:20 +02:00
13703b1747 unicode: extend conversion with reusable charset_encoder
Windows takes care of internal converter state in MultiByteToWideChar
and WideCharToMultiByte and keeps them thread-safe. On other platforms,
iconv requires user to setup and keep converter state for thread-safe
conversions. This sounds time consuming for every string conversion,
therefore the concept of string converter (or converter state) has been
extended to Windows too, allowing uniform client code. On Windows, using
charset_encoder has no performance benefit, where on Linux and macOS,
there should be. To be measured...

Signed-off-by: Simon Rozman <simon@rozman.si>
2023-09-14 12:28:05 +02:00
66f8a6c3b7 Re-add UTF-8 BOM XCode is removing
Visual Studio IDE really needs it on non-UTF-8 PCs.

Signed-off-by: Simon Rozman <simon@rozman.si>
2023-09-14 09:13:04 +02:00
83d7fd844d Port to macOS
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-09-12 16:55:16 +02:00