summaryrefslogtreecommitdiff
path: root/lib/utils/mu-utils.hh
AgeCommit message (Collapse)Author
2026-04-10lib/utils: small cleanupsDirk-Jan C. Binnema
Fix some static analysis warnings
2026-03-07mu/lib: fix some possible quoting issuesDirk-Jan C. Binnema
2026-01-29mu-utils: replace #define with constexpr for MU_COLOR_Dirk-Jan C. Binnema
2026-01-28utils: fix typoDirk-Jan C. Binnema
2026-01-27utils: rework MU_ENABLE_BITOPS using C++20 codeDirk-Jan C. Binnema
Instead of macros, we using C++20 concepts to define the helpers to deal with bitops on enum-class conveniently. x# Please enter the commit message for your changes. Lines starting
2025-12-13utils: rework logging functionsDirk-Jan C. Binnema
Use a general mu_log which does the formatting, and specific mu_debug, mu_info etc., to call it.
2025-10-25utils: add utf8_clean helperDirk-Jan C. Binnema
To morph text into valid utf8 if it isn't already.
2025-09-28utils: avoid fmt:gmtime/fmt::localtimeDirk-Jan C. Binnema
They've been deprecated and give build warnings with new enough libfmt.
2025-08-24utils: add set_thread_nameDirk-Jan C. Binnema
With HAVE_PTHREAD_SETNAME_NP
2025-07-24fmt: prefer system package if foundDirk-Jan C. Binnema
mu embeds a "vendored" subset of the libfmt package under thirdparty; but it's better to use the system-package if the user has one. So, use the system package if found or user -Duse-embedded-fmt=true is specified.
2025-06-14mu_utils: add to_string_charDirk-Jan C. Binnema
Like to_string_gchar, but for malloc/free strings.
2024-12-06lib/utils: include fmt/xchar.hDirk-Jan C. Binnema
Needed for 'join'
2024-09-22Fix typos.James Cook
2024-04-13mu-utils: update casting from int64_t -> time_tDirk-Jan C. Binnema
Esp. for systems with 32-bit time_t.
2024-04-01mu-utils: Fix build with muslMatthew Smith
In musl, `stdout` is a macro that expands to `(stdout)`, and `::(stdout)` is not valid C++. ../mu-1.12.2/lib/utils/mu-utils.hh:268:32: error: expected id-expression before '(' token 268 | ::stdout); | ^~~~~~ Nothing in the Mu namespace is named stdout, so it is safe to drop the `::`. Bug: https://bugs.gentoo.org/928361
2023-09-24utils/add: improve unit test coverageDirk-Jan C. Binnema
2023-09-21mu-utils: add to_string_viewDirk-Jan C. Binnema
2023-09-17utils: add utf8_wordbreakDirk-Jan C. Binnema
Determine if a string has wordbreaks in a mostly Xapian-compatible way. We need this to determine what strings should be considered "phrases".
2023-09-09utils: handle "unbroken" scriptsDirk-Jan C. Binnema
Do not removing combining characters from scripts without explicit word boundaries, such as those for CJK. Reuse some Xapian code for that.
2023-08-27utils: small tweaksDirk-Jan C. Binnema
2023-08-21mu-utils: support UTC in parse_date_timeDirk-Jan C. Binnema
Parsing dates known to be in UTC.
2023-08-19remove Mu::format, use mu_formatDirk-Jan C. Binnema
Use the new fmt-based formatting.
2023-08-11utils: add mu_print[ln] for ostreamsDirk-Jan C. Binnema
2023-08-06utils: replace time_to_string with fmt-based formattingDirk-Jan C. Binnema
It's faster; make "mu find" ~5-10% faster, and removes some code we no longer need.
2023-07-25utils: implement html-to-textDirk-Jan C. Binnema
Implement a crude html-to-text scraper function, to extract plain text from html messages, so we can use it for indexing.
2023-07-08migrate to fmt-based logging in some more placesDirk-Jan C. Binnema
and improve logging.
2023-07-06fmt: more update to use new fmt-based APIsDirk-Jan C. Binnema
2023-07-05update to use fmt-based apisDirk-Jan C. Binnema
Not complete, but a first big stab converting users of Mu::Error and various g_warning & friends, format to the new libfmt-based APIs.
2023-07-05utils: rework Mu::Error and g_ logging macros with fmtDirk-Jan C. Binnema
A bit more C++ template magic to remove a lot of code.
2023-01-19server: add a few stopwatchesDirk-Jan C. Binnema
For measuring performance.
2023-01-14utils: get rid of mu-util.[ch]Dirk-Jan C. Binnema
It was getting old... Remove the unused parts, refactor the few parts still in use.
2022-12-30many: use Mu::Regex instead of std::regexDirk-Jan C. Binnema
The former is PCRE-compatible, and faster than std::regex.
2022-12-10mu-utils: use const char* from for time_to_stringDirk-Jan C. Binnema
To avoid lifetime problems with some(?) compilers.
2022-11-16lib: remove mu-runtimeDirk-Jan C. Binnema
Remove runtime; update the logger for that, and move the runtime-paths stuff to utils.
2022-10-02utils: add helpers for assoc-pairsDirk-Jan C. Binnema
Add some unit-test, too.
2022-08-11tests: update test helpers and usersDirk-Jan C. Binnema
Move test-mu-common to mu-test-utils. Use mu_test_init as a wrapper for g_test_init. Update users.
2022-06-16utils: add regex-splitDirk-Jan C. Binnema
2022-05-18tests: skip missing timezones in queries, tooDirk-Jan C. Binnema
2022-05-17utils: add locale_workaroundDirk-Jan C. Binnema
Attempt to work around some locale handling throwing in some systems. "locale::facet::_S_create_c_locale name not valid" Ugly, but maybe it helps.
2022-05-14utils: insist on semicolon after MU_ENABLE_BITOPSDirk-Jan C. Binnema
2022-04-30utils: update date/size parsing, factor out formatDirk-Jan C. Binnema
And update tests
2022-04-30lib/tests: rework in terms of Mu::MessageDirk-Jan C. Binnema
2022-04-18option: rename to to_string_opt and to_string_view_optDirk-Jan C. Binnema
to_option_string -> to_string_opt to_string_view -> to_string_view_opt
2022-04-16utils: add deletable_unique_ptrDirk-Jan C. Binnema
2022-04-14utils: add TempDir RAII classDirk-Jan C. Binnema
For tests
2022-03-28utils: add seq_someDirk-Jan C. Binnema
2022-03-26utils: add some handy STL conveniencesDirk-Jan C. Binnema
2022-03-19utils: improve split / joinDirk-Jan C. Binnema
2022-03-07utils: add rename has_flag into one_if in BITOPSDirk-Jan C. Binnema
2022-02-26utils: add has_flag to MU_ENABLE_BITOPSDirk-Jan C. Binnema