core: convert filter_constraint_data_to_string to C++

Return an std::string to avoid memory management headaches.

While doing that, convert time.c to C++ so that
format_datetime directly returns an std::string.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-02-29 11:31:46 +01:00 committed by Michael Keller
parent 898ecd2df5
commit 2e1d852e36
8 changed files with 29 additions and 32 deletions

View file

@ -16,12 +16,15 @@ extern int utc_weekday(timestamp_t timestamp);
/* parse and format date times of the form YYYY-MM-DD hh:mm:ss */
extern timestamp_t parse_datetime(const char *s); /* returns 0 on error */
extern char *format_datetime(timestamp_t timestamp); /* ownership of string passed to caller */
extern const char *monthname(int mon);
#ifdef __cplusplus
}
#include <string>
std::string format_datetime(timestamp_t timestamp); /* ownership of string passed to caller */
#endif
#endif