diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-20 11:01:52 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-20 11:01:52 +0000 |
| commit | a1ba45b28c94244d2e1c6f00372d51d294cc3edc (patch) | |
| tree | ec93c86d6476aa8f612028f63582c95a55fd77ed /pseudocode-lib/_exp_string.cc | |
| parent | 65599524f5b41ffb6d8d55664611612c0b57ad47 (diff) | |
feat(library): add experimental string LCASE overloads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'pseudocode-lib/_exp_string.cc')
| -rw-r--r-- | pseudocode-lib/_exp_string.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pseudocode-lib/_exp_string.cc b/pseudocode-lib/_exp_string.cc index d406274..6155319 100644 --- a/pseudocode-lib/_exp_string.cc +++ b/pseudocode-lib/_exp_string.cc @@ -1,4 +1,5 @@ #include <algorithm> +#include <cctype> #include <cstdio> #include <exception> #include <stdexcept> @@ -88,6 +89,18 @@ void _exp_string_impl_mid(void *Target, void *Handle, long long Start, long long text(Target) = Source.substr(Position, Length); }); } +void _exp_string_impl_lcase(void *Target, void *Handle) { + checked([&] { + text(Target) = text(Handle); + for (char &Ch : text(Target)) + Ch = static_cast<char>(std::tolower(static_cast<unsigned char>(Ch))); + }); +} +char _exp_string_impl_lcase_char(char Ch) { + return checked([&] { + return static_cast<char>(std::tolower(static_cast<unsigned char>(Ch))); + }); +} void _exp_string_impl_output(void *Handle) { checked([&] { const auto &Text = text(Handle); |
