@@ -202,36 +202,70 @@ class TRANTOR_EXPORT Date
202202 */
203203 std::string toFormattedString (bool showMicroseconds) const ;
204204
205+ /* clang-format off */
205206 /* *
206- * @brief Generate a UTC time string formated by the @p fmtStr
207+ * @brief Generate a UTC time string formatted by the @p fmtStr
207208 * @param fmtStr is the format string for the function strftime()
208209 * @param showMicroseconds whether the microseconds are returned.
209210 * @note Examples:
210211 * - "2018-01-01 10:10:25" if the @p fmtStr is "%Y-%m-%d %H:%M:%S" and the
211212 * @p showMicroseconds is false
212213 * - "2018-01-01 10:10:25:102414" if the @p fmtStr is "%Y-%m-%d %H:%M:%S"
213214 * and the @p showMicroseconds is true
215+ * @deprecated Replaced by toCustomFormattedString
214216 */
217+ [[deprecated(" Replaced by toCustomFormattedString" )]]
215218 std::string toCustomedFormattedString (const std::string &fmtStr,
216- bool showMicroseconds = false ) const ;
217-
219+ bool showMicroseconds = false ) const
220+ {
221+ return toCustomFormattedString (fmtStr, showMicroseconds);
222+ };
223+ /* clang-format on */
224+ /* *
225+ * @brief Generate a UTC time string formatted by the @p fmtStr
226+ * @param fmtStr is the format string for the function strftime()
227+ * @param showMicroseconds whether the microseconds are returned.
228+ * @note Examples:
229+ * - "2018-01-01 10:10:25" if the @p fmtStr is "%Y-%m-%d %H:%M:%S" and the
230+ * @p showMicroseconds is false
231+ * - "2018-01-01 10:10:25:102414" if the @p fmtStr is "%Y-%m-%d %H:%M:%S"
232+ * and the @p showMicroseconds is true
233+ */
234+ std::string toCustomFormattedString (const std::string &fmtStr,
235+ bool showMicroseconds = false ) const ;
218236 /* *
219237 * @brief Generate a local time zone string, the format of the string is
220- * same as the mothed toFormattedString
238+ * same as the method toFormattedString
221239 *
222240 * @param showMicroseconds
223241 * @return std::string
224242 */
225243 std::string toFormattedStringLocal (bool showMicroseconds) const ;
226244
245+ /* clang-format off */
227246 /* *
228- * @brief Generate a local time zone string formated by the @p fmtStr
247+ * @brief Generate a local time zone string formatted by the @p fmtStr
229248 *
230249 * @param fmtStr
231250 * @param showMicroseconds
232251 * @return std::string
252+ * @deprecated Replaced by toCustomFormattedString
233253 */
234- std::string toCustomedFormattedStringLocal (
254+ [[deprecated(" Replaced by toCustomFormattedStringLocal" )]]
255+ std::string toCustomedFormattedStringLocal (const std::string &fmtStr,
256+ bool showMicroseconds = false ) const
257+ {
258+ return toCustomFormattedStringLocal (fmtStr, showMicroseconds);
259+ }
260+ /* clang-format on */
261+ /* *
262+ * @brief Generate a local time zone string formatted by the @p fmtStr
263+ *
264+ * @param fmtStr
265+ * @param showMicroseconds
266+ * @return std::string
267+ */
268+ std::string toCustomFormattedStringLocal (
235269 const std::string &fmtStr,
236270 bool showMicroseconds = false ) const ;
237271
@@ -261,16 +295,34 @@ class TRANTOR_EXPORT Date
261295 */
262296 static Date fromDbString (const std::string &datetime);
263297
298+ /* clang-format off */
264299 /* *
265300 * @brief Generate a UTC time string.
266301 *
267302 * @param fmtStr The format string.
268303 * @param str The string buffer for the generated time string.
269304 * @param len The length of the string buffer.
305+ * @deprecated Replaced by toCustomFormattedString
270306 */
307+ [[deprecated(" Replaced by toCustomFormattedString" )]]
271308 void toCustomedFormattedString (const std::string &fmtStr,
272309 char *str,
273- size_t len) const ; // UTC
310+ size_t len) const
311+ {
312+ toCustomFormattedString (fmtStr, str, len);
313+ }
314+ /* clang-format on */
315+
316+ /* *
317+ * @brief Generate a UTC time string.
318+ *
319+ * @param fmtStr The format string.
320+ * @param str The string buffer for the generated time string.
321+ * @param len The length of the string buffer.
322+ */
323+ void toCustomFormattedString (const std::string &fmtStr,
324+ char *str,
325+ size_t len) const ; // UTC
274326
275327 /* *
276328 * @brief Return true if the time point is in a same second as another.
0 commit comments