Commit Graph

56 Commits

Author SHA1 Message Date
Victor Zverovich 0641b844ac Cleanup string traits 2024-01-05 19:31:04 -08:00
Bruce Mitchener ebd5c8f994 Consistently use fmt:: when invoking format_to. (#3779)
This has been done partially in previous commits:

* 2ac6c5ca8b
* 258000064d
* ba50c19e82
* 5ab9d39253

A patch that includes the `std::error_code` changes here is
upstream in vcpkg, so that will be able to be removed when
updating to the next release.
2024-01-01 06:57:03 -08:00
Victor Zverovich 23826669cf Cleanup error handling 2023-12-31 07:51:57 -08:00
Victor Zverovich c4283ec471 Fix a libc++ warning and move the test to the right place 2023-11-25 08:20:53 -08:00
Victor Zverovich 130cf54cbc Use a more sensible locale in tests 2023-10-08 10:49:21 -07:00
Vladislav Shchapov 492a99c964 Fix error: 'char_traits<custom_char>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it. [-Werror,-Wdeprecated-declarations] (#3634)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2023-09-18 15:46:17 -07:00
Nico Rieck 171a020c82 Pass correct Char to base format_as formatter (#3457) 2023-05-24 14:50:47 -07:00
Victor Zverovich ea49c91cd1 Cleanup argument construction 2023-05-11 18:43:39 -07:00
Victor Zverovich ebfb2e6779 Remove unused alias 2023-05-11 10:51:32 -07:00
Victor Zverovich 5780269d57 Improve API safety 2023-05-11 10:19:56 -07:00
Victor Zverovich 02bf4d1c1c Disable to_string_view ADL 2023-04-09 08:49:05 -07:00
tom-huntington 5b8302079d Add optional support (#3303) 2023-02-25 06:45:56 -08:00
Shawn Zhong 87c066a35b Implement println (#3267) 2023-01-24 12:30:00 -08:00
Shawn Zhong 39971eb336 Fix localized format for float-point numbers (#3272) 2023-01-15 11:47:24 -08:00
Victor Zverovich a73a9b6a84 Refactor format string checks 2022-12-30 16:03:41 -08:00
Victor Zverovich 8fe4d97d5e Reduce template instantiations 2022-12-30 08:44:23 -08:00
Victor Zverovich bd12aaa98e Simplify format string parsing 2022-12-25 12:31:38 -08:00
Vladislav Shchapov 4841784e82 Simplify C99 strftime detection conditions
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-12-25 10:16:19 -08:00
Vladislav Shchapov cb72c23e9e Improve timezone tests
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-12-25 10:16:19 -08:00
Victor Zverovich dfb857ebef Refactor format spec parsing 2022-12-25 07:25:32 -08:00
Victor Zverovich d1745084e0 Simplify parse context 2022-12-24 15:20:24 -08:00
Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) 115001a3b1 Formatting of system clocks ought to be to UTC, not to local time.
This improves standards conformance of fmt.
2022-12-21 14:23:02 -08:00
Patrick Roocks 9254cfa6f0 Support formatting of subseconds (#3115)
* Timestamp formatting shall print also subseconds, fixed a bug for fractional durations
2022-10-12 14:33:53 -07:00
Victor Zverovich b98ffb7dbd Improve locale handling 2022-09-04 21:07:30 -07:00
Victor Zverovich f187274d36 Add loc_value 2022-09-02 13:45:23 -07:00
Victor Zverovich fc5e59fe4a Don't use stringstream 2022-09-02 13:05:26 -07:00
Victor Zverovich d6a8704605 Improve locale support 2022-09-02 11:52:19 -07:00
Victor Zverovich 56c72a671c Reduce locale dependency 2022-09-02 10:22:11 -07:00
Victor Zverovich 64e29893cf Improve locale support 2022-09-01 14:48:43 -07:00
Victor Zverovich e724bbea16 Fix wchar_t corner cases 2022-08-24 12:23:10 -07:00
Victor Zverovich 1f95c34381 Fix sign handling with large code units 2022-08-20 07:46:58 -07:00
Dimitrij Mijoski fc23cfbf4e Fix testsuite on MinGW + MSVCRT
Fixes #2952. The testsuite indirectly called strftime() with conversion
specifiers defined only in C99. In MSVCRT this function conforms only to
C89. Only in the updated UCRT this functon provides the functionality of
C99.
2022-08-14 08:40:38 -07:00
Vladislav Shchapov b31d1a75a0 Add xchar support for fmt::streamed().
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-07-05 19:07:06 -07:00
Vladislav Shchapov 115e00e0b9 Replace __cplusplus with FMT_CPLUSPLUS.
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-07-04 07:18:21 -07:00
Victor Zverovich 0c06c81da8 Deprecated implicit conversion of enums to ints for consistency with scoped enums 2022-07-03 09:02:22 -07:00
Victor Zverovich 9cb02aaaad Fix UDLs 2022-06-25 08:52:10 -07:00
Victor Zverovich cb682f36f4 Move to_string_view to detail 2022-05-29 22:51:31 -07:00
Victor Zverovich c83a5d42bb FMT_MSC_VER -> FMT_MSC_VERSION 2022-05-29 15:39:08 -07:00
Vladislav Shchapov 1f9eae7e31 Add xchar support for write_escaped_string.
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-05-27 08:36:38 -07:00
Victor Zverovich 192f79aaae Fix handling of locale separators in FP formatting 2022-04-12 08:00:17 -07:00
Victor Zverovich 4e39e13085 Remove xchar.h include from ostream.h 2022-03-18 10:53:15 -07:00
Victor Zverovich 17b362f78c Simplify ostream opt-in API 2022-02-04 18:33:59 -08:00
Victor Zverovich f055ebbd25 Make ostream operators opt in to reduce the risk of ODR violations 2022-02-04 15:06:45 -08:00
Victor Zverovich 8a21e328b8 Remove problematic constructibility check 2022-02-04 12:20:02 -08:00
Victor Zverovich c28500556a FMT_NOEXCEPT -> noexcept 2022-01-20 16:55:47 -08:00
Vladislav Shchapov 5abe9e8266 Add platform-specific 'z' formatter 2021-11-25 06:52:39 -08:00
Vladislav Shchapov 1031eedf27 Replacing strftime with std::time_put (#2550)
* Fix unicode test

* Add xchar support to chrono formatter

* Replace strftime with std::time_put

* Add std::locale support to std::tm formatter

* Use predefined names and formats for C-locale

* Performance improvement

* Make locale-independent and C locale formats consistent among platforms
2021-10-30 08:25:45 -07:00
Vladislav Shchapov aeb54b0dd9 Fix bug on '%Y' and '%C' formats with negative years
Requested changes
2021-10-16 15:03:57 -07:00
Vladislav Shchapov f88c020fc0 Generalization of strftime/wcsftime function calls in tests 2021-10-16 15:03:57 -07:00
Vladislav Shchapov d3d30a46f0 New tests 2021-10-16 15:03:57 -07:00