Commit Graph

89 Commits

Author SHA1 Message Date
yumeyao
c5d4fcb119
Appending a space to guarantee non-empty strftime() result. (#2244) 2021-04-18 19:13:51 -07:00
Daniela Engert
f4bbc54cc4
Tag official API for module export (#2235)
* functions
 * classes
 * UDLs
 * other declarations

Export everything in namespace 'fmt' from core.h and format.h
2021-04-16 11:04:55 -07:00
Victor Zverovich
06b3a1000c Add support for time points with arbitrary durations (#2208) 2021-04-02 11:17:14 -07:00
Alexey Ochapov
29cc8282b1 update chrono duration formatter (constness), use it in compile-test for specs checks 2021-02-20 11:50:12 -08:00
Yuval Gamzon-Kapeller
c5979d564e Fix fmt::localtime formatting not working in wide-char string contexts 2021-02-13 06:53:30 -08:00
Yin Zhong
1980ca8c4e
fix #2118: FMT_COMPILE did not work with tm formatter (#2119)
Co-authored-by: summivox <summivox@github.com>
2021-01-30 08:44:49 -08:00
Alexey Ochapov
cdc5ef6710
Remove fallback to inline specifier from FMT_CONSTEXPR(20) macro (#2075) 2020-12-30 06:23:20 -08:00
Victor Zverovich
1256541d7a Fix formatting 2020-12-24 07:07:15 -08:00
Walter Gray
4fa4c9248f
Add tests for FMT_ENFORCE_COMPILE_STRING, fix several errors (#2038) 2020-12-24 06:40:46 -08:00
Björn Schäpers
5a37e182de
Disable warning about format string (#2067)
Reported by MinGW/GCC 10
2020-12-21 08:43:30 -08:00
Victor Zverovich
bcc20b29df Implement compile-time checks by default 2020-11-15 17:24:36 -08:00
Walter Gray
befd7d4a2f
Always use FMT_STRING internally where possible [Issue #2002] (#2006)
Co-authored-by: Walter Gray <walter.gray@getcruise.com>
2020-11-15 05:19:06 -08:00
Victor Zverovich
7abc3c01e0 Suppress a useless warning (#2004) 2020-11-12 08:18:28 -08:00
Victor Zverovich
b5dac0f0f8 Reduce <algorithm> usage (#1998) 2020-11-11 09:12:15 -08:00
Victor Zverovich
8f2131cf2d Document chrono 2020-11-07 10:51:08 -08:00
Adam Burgess
f39e6fb617
Add formatters for chrono::time_point<system_clock> (#1837)
Add formatters for chrono::time_point and helper overloads for localtime/gmtime(time_point)
Fixes #1819
2020-08-28 07:41:38 -07:00
Victor Zverovich
77b627be20 Fix bogus MSVC warnings (#1825) 2020-08-26 12:33:54 -07:00
Victor Zverovich
92bff2fe2c Revert "Add missing includes"
This reverts commit 06895a7687.
2020-08-21 16:24:53 -07:00
Victor Zverovich
06895a7687 Add missing includes 2020-08-19 20:33:04 -07:00
Victor Zverovich
1f8f5450b5 Reuse format_decimal 2020-06-14 07:42:52 -07:00
Victor Zverovich
547f12ae63 Fix a warning (#1722) 2020-06-11 15:02:42 -07:00
Victor Zverovich
519571edec Simplify arg_formatter_base 2020-05-29 14:44:18 -07:00
Daniil Goncharov
8cadb96506
fix max/min macro (#1697) 2020-05-22 06:38:43 -07:00
Victor Zverovich
8069265373 internal -> detail (#1538) 2020-05-10 07:34:30 -07:00
Victor Zverovich
7f723fbcb8 Consistently namespace qualify size_t 2020-05-07 15:59:46 -07:00
Victor Zverovich
c06851456d Purge basic_writer 2020-05-07 15:04:48 -07:00
Victor Zverovich
f2ed03b919 Fix a warning (#1649) 2020-04-28 06:39:24 -07:00
Victor Zverovich
4a617f25c6 Clarify encoding conversion in chrono 2020-04-27 09:57:08 -07:00
Victor Zverovich
f499b393d1 Apply coding conventions 2020-01-26 19:48:48 -08:00
zeffy
1acb73f970 Fix formatting std::chrono::duration types to wide strings (#1533)
* Fix formatting chrono durations to wide strings

* Make format buffers const correct

* Add FormatWide chrono test case

* Fix incorrect wide encoding of 'µs'
I think might be a source file encoding issue, so I used \u00B5 instead.

* Update FormatWide test to use proper encoding of µs

* Revert changes to format_localized's parameters

* Use different overload of `std::time_put<T>::put` to avoid needing a format string

* Use utf8_to_utf16 instead of having redundant overloads of get_units

* Revert some minor changes

* Remove FMT_CONSTEXPR from expression

This should hopefully fix compilation on VS <2019

* Make suggested changes from code review

* Run clang-format on chrono.h

* Make sure unit isn't null before constructing a string_view from it
2020-01-23 18:48:36 -08:00
Victor Zverovich
e5f2f8ce7a Add variable-width fill support (#1109) 2020-01-19 14:49:51 -08:00
Victor Zverovich
9bd9738da0 Remove static and simplify names 2020-01-18 07:43:59 -08:00
Florin Iucha
72879db40e Clean-up sign-conversion warnings in public headers 2019-12-08 16:07:55 -08:00
Victor Zverovich
092d2dc7b2 Merge safe-duration-cast.h into chrono.h 2019-11-20 08:05:18 -08:00
Victor Zverovich
ffd05e65ed basic_parse_context -> basic_format_parse_context per standard and document 2019-11-05 07:13:58 +00:00
Victor Zverovich
d39ebf3ff2 Optimize counting 2019-10-21 06:57:42 -07:00
Victor Zverovich
c85ae23c73 Add max_value 2019-09-08 09:21:30 -07:00
Deniz Evrenci
6de0454b42 Add support for built-in __int128 when available 2019-09-04 07:05:08 -07:00
Victor Zverovich
466128de00 Remove unused code and refactor 2019-09-01 13:08:53 -07:00
Victor Zverovich
f18a3f36a7 Remove string_view_metadata
string_view_metadata was introduced to make compiled format relocatable.
However, format string compilation is an optimization and therefore
adding overhead and extra complexity for relocation is undesirable.
In most cases the string will be either static or outlive compilation
and formatting and if it doesn't, it's possible to make compiled
representation relocatale by other means.
2019-09-01 11:10:49 -07:00
hhb
9e2490be4c Rename precision parameter
To avoid clang warning:

fmtlib/include/fmt/chrono.h:753:32: error: declaration shadows a field of 'formatter<duration<type-parameter-0-0, type-parameter-0-1>, type-parameter-0-2, void>' [-Werror,-Wshadow]
2019-08-28 07:29:04 -07:00
Bruce Mitchener
ad3c7855e2 Fix typos. 2019-08-27 06:26:17 -07:00
Victor Zverovich
c1e97392be Fix warnings 2019-08-11 08:44:12 -07:00
Victor Zverovich
af4734fd15 Fix warnings 2019-07-12 16:03:12 -07:00
Victor Zverovich
f6f0415b83 typedef -> using 2019-07-07 17:14:26 -07:00
Victor Zverovich
5488d0b53a spec -> specs 2019-07-07 06:39:20 -07:00
Victor Zverovich
e4f84ee1c6 Refactor format_specs for #1109 and #940
Refactor `format_specs` and related APIs to support variable-width fill
(#1109), improve naming consistency, remove legacy setters (#940), and
optimize layout.
2019-07-06 20:57:40 -07:00
Victor Zverovich
c286ffc88d int_traits -> uint32_or_64_t 2019-07-03 16:01:21 -07:00
Victor Zverovich
ded0a3bb3d Internalize undocumented basic_writer 2019-07-03 10:01:03 -07:00
Victor Zverovich
bd3fd3bfda clang-format 2019-06-30 06:58:49 -07:00