Commit Graph

909 Commits

Author SHA1 Message Date
Elias Kosunen
7fbbfed8c6 Fix warnings caused by usage of deprecated functionality 2019-02-02 05:48:39 -08:00
Elias Kosunen
c3268f4e50 Remove use cases of deprecated functionality 2019-02-02 05:48:39 -08:00
Victor Zverovich
5289dd600b Test formatting of special numbers 2019-01-30 06:56:46 -08:00
Daniela Engert
0700612249 Implement 'chrono' formatting specifiers '%Q' and '%q'
Howard Hinnant's 'date' library recently gained these two new formatting specifiers. This implementation in {fmt} includes support for 'std::chrono::duration' specializations with floating-point representation types and user-definable precision.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2019-01-27 11:10:08 -08:00
Victor Zverovich
06c005b7b0 Clarify that compile-time checks don't support named arguments 2019-01-27 10:10:13 -08:00
Victor Zverovich
4f6fda558c Add a grisu test stub 2019-01-27 10:10:13 -08:00
Daniela Engert
9f70b034e1 Implement precision for floating-point durations.
The formatting syntax follows p1361r0, augmented by a precision field as proposed in #1004.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2019-01-23 07:17:00 -08:00
Victor Zverovich
5f1ceebc7f Make formatter<T> override ostream<< for templates (#952) 2019-01-21 09:42:55 -08:00
Victor Zverovich
83f052930a Add code from p0645 2019-01-20 15:12:01 -08:00
Victor Zverovich
fdd8e333c1 Fix compilation with locales disabled (#1011) 2019-01-19 07:16:05 -08:00
Daniela Engert
b0cde860ae Implement 'snprintf(OutputIt it, size_t n, const S &format, const Args & ... args)' (#917)
Mostly equivalent to 'sprintf(const S &format, const Args & ... args)' but generates at most 'n' characters through output iterator 'it'. The output type is the same as with 'format_to_n'.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2019-01-13 13:08:01 -05:00
Daniela Engert
e05dfb0887 Fix compile errors due to name-hiding and an unused function argument.
These problems are pointed out by clang-tidy and fail compilation on msvc at /W4 /WX.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2019-01-13 12:18:05 -05:00
Victor Zverovich
58b6f8db48 Format the code using clang-format 2019-01-13 06:58:20 -08:00
stryku
9a777b9e1c Implemented fmt::prepare()
Implementation of fmt::prepare() function and features around it.
2019-01-12 10:53:31 -08:00
Victor Zverovich
dc8f8ce4c0 Fix handling of dynamic width in chrono formatter
Thanks to Howard Hinnant.
2019-01-09 15:23:21 -08:00
Michael Winterberg
39623a7400 Replaced usage of gtest's internal scoped_ptr with unique_ptr.
scoped_ptr was removed in with gtest google/googletest@e857f9cdd9.
2019-01-02 19:05:51 -05:00
Denis Blank
ae1de3a8d3 Add support for using text_style in format and vformat directly (#993)
* Closes #993
2019-01-01 09:26:54 -05:00
Sign Bit
0bbdca5b8b Fix conversion warnings (#989)
* Fix sign conversion warnings

* Ignore unused local typedefs

* Remove cast reported as useless on GCC

* Remove warning on unused variable

* Enable conversion warning checking for pedantic build

* Fix sign-conversion warnings in headers
2018-12-20 06:24:19 -08:00
Victor Zverovich
77a7244804 Implement fill/align/width for strftime-like formatting 2018-12-19 07:03:02 -08:00
Victor Zverovich
3e01376e08 Implement fill/align/width parsing in chrono formatter 2018-12-16 09:08:11 -08:00
Victor Zverovich
8668639ae2 Get rid of null_terminating_iterator in format 2018-12-15 06:17:25 -08:00
Nicolas
93fd473b8f Add support for builtin terminal colors. (#974) 2018-12-15 06:16:00 -08:00
Victor Zverovich
b180b39152 Fix default formatting 2018-12-12 06:39:47 -08:00
Nicolas
24594c747e Disable printing the reset escape code when no style modifiers where applied. (#973) 2018-12-09 15:57:20 -08:00
Victor Zverovich
b0f2224719 Implement default chrono formatting 2018-12-09 15:56:15 -08:00
Nicolas
749276072f Add file stream support for stylized text printing. (#967) 2018-12-09 09:28:48 -08:00
Victor Zverovich
f54f3d0fb7 Move chrono-specific code to a separate header 2018-12-09 06:45:20 -08:00
Victor Zverovich
bf1f1c73e3 Fix time test 2018-12-07 08:19:13 -08:00
Victor Zverovich
acfa95d4a8 Workaround a bug in MSVC's strftime (#965) 2018-12-07 07:07:21 -08:00
Victor Zverovich
628f830583 More chrono formatting 2018-12-07 06:36:08 -08:00
Victor Zverovich
aa3b5aba41 Implement locale-specific minute formatting 2018-12-06 16:12:10 -08:00
Victor Zverovich
639de21757 Workaround more MSVC bugs 2018-12-06 12:16:04 -08:00
Victor Zverovich
bd1104046b Workaround a bug in MSVC 2018-12-06 08:16:01 -08:00
Nicolas
81b5c4a5fd Add experimental emphasis support (#961) 2018-12-06 07:56:01 -08:00
Victor Zverovich
b31680990e Fix a warning 2018-12-05 09:49:39 -08:00
Victor Zverovich
68214bd904 More time formatting 2018-11-30 20:12:01 -08:00
Victor Zverovich
322b2594e0 Implement more time specifiers 2018-11-30 09:25:18 -08:00
Victor Zverovich
f5fe849238 Specialize formatter for chrono durations 2018-11-28 11:39:21 -08:00
tnovotny
e37d6a9840 add make_printf_args and make_wprintf_args functions (#934)
* add make_printf_args and make_wprintf_args to printf.h
add minimal test for make_printf_args and make_wprintf_args to printf-test.cc

renamed the old printf_context template to basic_printf_context_t. the original wish was to rename it basic_printf_context, but that clashed with the name of the inner typedef. this style matches the format_context_t struct.
2018-11-22 13:57:07 -08:00
Victor Zverovich
982ee5c699 parse_context -> format_parse_context 2018-11-21 07:10:22 -08:00
Victor Zverovich
00a8cc8325 Fix formatting 2018-11-20 07:43:40 -08:00
Andreas Schönle
bd6121596f Disable fmt-impl-test in windows + shared lib. 2018-11-20 07:01:21 -08:00
Victor Zverovich
19e008876b More locale support 2018-11-14 16:25:49 -08:00
Victor Zverovich
f2ee988105 Improve locale support 2018-11-14 12:07:39 -08:00
Victor Zverovich
1385050e26 More formatter tests 2018-11-08 16:26:55 -08:00
Victor Zverovich
03c1b110a5 Fix gcc 4.4 build 2018-11-08 12:41:55 -08:00
Victor Zverovich
cc805c6162 Test enabled formatters 2018-11-08 10:59:10 -08:00
Victor Zverovich
e01579231d Disallow leading zeros in arg-id 2018-11-08 08:48:56 -08:00
Victor Zverovich
a23d592472 Fix check_format_string (#925) 2018-11-03 16:51:15 -07:00
Daniela Engert
5ee1a4bc8a check for property 'mutable iterator' and SFINAE on it 2018-10-28 08:57:43 -07:00