Simon Rozman
cb010bd72e
UnitTests: upgrade XCode project to include all .hpp files
...
This simplifies source code browsing.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-20 14:02:40 +02:00
Simon Rozman
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
Simon Rozman
dcfc4752b5
stream: add stdex::sstring method variants
2023-09-20 12:09:58 +02:00
Simon Rozman
475e6734a7
stream: extend open/create disposition flags
...
User could not create file only if it did not exist.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-20 11:13:16 +02:00
Simon Rozman
50fea81f83
parser: cleanup
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-20 08:07:50 +02:00
Simon Rozman
613bba9e05
parser: refine IBAN checking
...
Allow arbitrary spacing, minor optimizations...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-19 21:40:36 +02:00
Simon Rozman
b5984ea8f2
Port to macOS
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-19 18:02:18 +02:00
Simon Rozman
27afd7afa5
parser: add IBAN, RF and SI support
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-19 16:53:16 +02:00
Simon Rozman
0e8e119346
unicode: Fix charset detection on macOS
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-15 16:33:20 +02:00
Simon Rozman
fea0ed7754
unicode: add system charset detection
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-15 15:32:14 +02:00
Simon Rozman
bffb48c87d
string: streamline C locale management across platforms
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-15 15:31:18 +02:00
Simon Rozman
bb2578f65c
UnitTests: Revert to XCode 13
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-14 16:10:13 +02:00
Simon Rozman
edd480d64b
macOS fixes
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-14 15:57:55 +02:00
Simon Rozman
51d7ee3493
Fix to support pre-C++17
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-14 13:01:16 +02:00
Simon Rozman
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
Simon Rozman
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
Simon Rozman
a43e633d2b
chrono: fix aosn_date::from_system
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-14 08:38:24 +02:00
Simon Rozman
b2af5291f5
Fix issues introduced with porting to macOS and sync with Windows
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-13 23:19:46 +02:00
Simon Rozman
870961cd12
chrono: port to macOS
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-13 22:47:18 +02:00
Simon Rozman
3da2529b08
compat: add more SAL as needed by other projects
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-13 22:46:22 +02:00
Simon Rozman
f05bf56a61
Don't #define NOMINMAX when compiled with -DNOMINMAX
...
MSVC issues compile-time warning about redefining.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-13 14:27:14 +02:00
Simon Rozman
180f763184
exception: set default user_cancelled exception message
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-13 13:21:30 +02:00
Simon Rozman
657eac0c69
system: add PATH_SEPARATOR
...
I am aware of the std::filesystem::path::preferred_separator, but we
are targeting C++14 and we need this as a precompiler macro to allow
concatenation of the path strings in precompile stage.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-13 11:29:20 +02:00
Simon Rozman
bd14f7c629
Fix issues introduced with porting to macOS and sync with Windows
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-12 17:15:33 +02:00
Simon Rozman
83d7fd844d
Port to macOS
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-12 16:55:16 +02:00
Simon Rozman
1e993c8c65
math: port unit tests to XCode
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-11 17:34:40 +02:00
Simon Rozman
b326f819ab
Fix to compile using XCode
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-11 16:44:30 +02:00
Simon Rozman
fb66eeb852
Make inout param designations XCode-friendly
2023-09-11 16:12:22 +02:00
Simon Rozman
aa4de5aa40
Make space for and add macOS unit testing stub project
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-11 16:11:57 +02:00
Simon Rozman
a13aba304a
interval: extend arithmetic
...
Additional operators allow moving intervals left and right.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-11 11:46:23 +02:00
Simon Rozman
5558bd6ccc
string: add strchr, strstr and stristr
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-08 17:54:20 +02:00
Simon Rozman
753da36672
idrec: add support for stdex::stream
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-08 11:41:23 +02:00
Simon Rozman
b8cb07f456
stream: cleanup
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-07 14:35:03 +02:00
Simon Rozman
0848056487
string: fix strnlen parameter validation assert
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-09-04 10:10:03 +02:00
Simon Rozman
670cbb8d36
Catch by reference
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-29 16:19:53 +02:00
Simon Rozman
b76db46076
system: simplify and streamline system char and string type names
...
"sys_char" sticks out of "wchar_t", "char32_t", "uint32_t"...
Likewise, "sys_string" out of "string", "wstring", "u16string",
"u32string"...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-29 10:09:35 +02:00
Simon Rozman
e1f27662a1
string: streamline locale_t experience
...
Not that we would like to promote the use of C locale_t over C++
std::locale, but we need former for sprintf and we need decent support
for it.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-25 04:45:32 +02:00
Simon Rozman
2c2680dfb3
Resolve _WINSOCKAPI_ and WIN32_LEAN_AND_MEAN hell. Hopefully!
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-25 03:56:27 +02:00
Simon Rozman
fb48db73c1
string: add strdup and strndup
...
I know this is a step backward to C, but we need this in AJT for
backward compatibility.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-24 14:07:28 +02:00
Simon Rozman
703e43d055
string: add some more helpers for locale manipulation
...
Microsoft has nonstandard implementation.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-24 14:04:23 +02:00
Simon Rozman
b0b0a91729
unicode: add variants for zero-terminated input
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-24 13:58:55 +02:00
Simon Rozman
be83f36082
stream: add write_array variants for zero-terminated strings
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-24 13:57:57 +02:00
Simon Rozman
73d03d81af
stream: fix buffered_sys and cached_file destruction
...
We had to introduce out-of-order construction for those classes, but we
forgot to implement out-of-order destruction. File gets closed first
by cached_file::m_source destructor, then inherited destructor
cache::~cache() which flushes the cache is called.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-24 13:56:41 +02:00
Simon Rozman
2b1bfc235d
sgml, unicode: fix
2023-08-23 15:30:55 +02:00
Simon Rozman
52d6f8daf1
sgml, unicode: split strcat and strcpy variants
...
Previous implementation had only strcat-class conversion using vague
function names. This commit makes function names more explicit by adding
"cat" and deprecating previous function variants.
Since many situation required strcpy variant, the move above made space
to add strcpy variants too.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-23 14:45:39 +02:00
Simon Rozman
fe47a47e4e
string: add reusable C locale
...
This is frequently needed locale.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-22 17:16:23 +02:00
Simon Rozman
4ca3ed0718
system: add missing include
...
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-22 17:06:17 +02:00
Simon Rozman
1c622c3091
stream: fix ISequentialStream
...
MSVC 2019 didn't handle stdex::stream::ISequentialStream and
ISequentialStream disambiguation very well.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-22 17:05:49 +02:00
Simon Rozman
f9809adf0c
sgml: add variants to convert into fixed-sized buffers
...
This is a performance requirement of PRSkupno.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-22 17:04:36 +02:00
Simon Rozman
6bb4027553
parser::date_format_t: make classic enum
...
With scoped enum, bitwise operations in C++ require insane amount of
type-casting.
Signed-off-by: Simon Rozman <simon@rozman.si >
2023-08-22 17:03:24 +02:00