Commit Graph

385 Commits

Author SHA1 Message Date
Victor Zverovich
b31680990e Fix a warning 2018-12-05 09:49:39 -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
XZiar
2dea780fbd change type naming and fix sfinae bug 2018-10-28 06:00:55 -07:00
XZiar
b98e8301d5 add non-char support for compile-time format check 2018-10-28 06:00:55 -07:00
Victor Zverovich
ccd3e8bbf3 Make is_constructible public (#918) 2018-10-27 17:10:19 -07:00
Daniela Engert
1e3dcbba81 fix: 'format_to_n' compiles 'std::back_inserter' arguments
std::back_insert_iterators model the OutputIterator concept but differ considerably in their traits and behavior. In particular the former made compilation to fail when format_to_n is given a back_inserter as first argument. The emulation of an OutputIterator is not perfect due to the behavioural differences of back_insert_iterators (e.g. assignment always implies increment) but good enough to be used within fmt's machinery.
2018-10-24 16:45:18 -07:00
Victor Zverovich
f0328f8e36 Use char_traits::length in string_view ctor (#914) 2018-10-24 15:21:21 -07:00
Victor Zverovich
20c708bf6d Fix build on gcc 4.4 2018-10-24 10:52:02 -07:00
Victor Zverovich
846c644e84 Workeround broken sprintf in MSVC 2018-10-19 07:30:59 -07:00
Victor Zverovich
13d472bd8c Compute output size for grisu 2018-10-18 17:16:50 -07:00
Victor Zverovich
b71d3fe7ab Remove use_grisu 2018-10-17 17:01:45 -07:00
Victor Zverovich
847abb6f8f Fix test 2018-10-17 11:57:06 -07:00
Victor Zverovich
2924622157 Fix naming of basic_format_specs members 2018-10-17 10:13:10 -07:00
Victor Zverovich
ddd7caf38e Fix locale-dependent formatting (#905) 2018-10-13 11:15:41 -07:00
superfunc
939fbe5567 Remove basic_fixed_buffer.
Issue #873 indicates that this class is no longer required,
as it has been superseded by a new API.

Fixes #873
2018-10-09 06:51:01 -07:00
Victor Zverovich
38325248e5 Count width in code points (#628) 2018-10-03 20:09:46 -07:00
Daniela Engert
deb901b9e4 Parameterize core functions on the type of the format string.
Take #2 of n

Signed-off-by: Daniela Engert <dani@ngrt.de>
2018-10-03 14:19:08 -07:00
Victor Zverovich
3f4cfa6c60 Implement UTF-8 string support 2018-09-30 15:45:58 -07:00
Victor Zverovich
5bced12421 Parameterize more functions on string type 2018-09-30 08:02:19 -07:00
Victor Zverovich
e4fea22d15 Make char8_t a strongly-typed enum 2018-09-30 07:11:37 -07:00
Guillaume Fraux
e864acfdbd Fix compilation with intel compilers (ICC/ICPC) v14.0 2018-09-27 07:11:23 -07:00
Victor Zverovich
e4ca37ccf6 Parameterize format_to on string type (#880) 2018-09-25 07:47:15 -07:00
Victor Zverovich
cb122a4d03 Fix format_to formatting to wmemory_buffer 2018-09-21 09:48:21 -07:00
Victor Zverovich
3f4984fb36 Clean core-test and fix linkage errors on older gcc 2018-09-19 12:24:38 -07:00
Victor Zverovich
7110b46076 Optimize default formatting 2018-09-12 08:45:14 -07:00
Victor Zverovich
dd8c5ce442 Implement more FP formatting options 2018-08-29 09:34:57 -07:00
Victor Zverovich
46484da711 Fix a warning 2018-08-29 07:00:24 -07:00
Victor Zverovich
569ac91e0b Implement Grisu boundary computation 2018-08-25 11:39:38 -07:00
Victor Zverovich
c68bab7014 Remove broken fmt::internal::format_enum (#818) 2018-08-01 07:11:53 -07:00
Victor Zverovich
2a4e948864 Add UTF-8 types 2018-07-22 06:36:21 -07:00
MikePopoloski
d778bded95 Make line in tests fit within 80chars 2018-07-20 17:07:23 -07:00
MikePopoloski
b1d10a2884 Add support for dynamic arg sets
This allows construction of basic_format_args from a dynamic set of arguments. The syntax is a little clunky and could probably be improved but this at least enables the functionality.
2018-07-20 17:07:23 -07:00
Victor Zverovich
cf2719bd12 Add support for types explicitly convertible to wstring_view 2018-07-18 19:12:10 -07:00
Victor Zverovich
50584f42b4 Test formatting of an object with templated conversion to string-like 2018-07-18 16:24:46 -07:00
Victor Zverovich
73bed45b7a Add support for types explicitly convertible to fmt::string_view 2018-07-18 14:42:26 -07:00
Victor Zverovich
e7e9578ed4 Optimize format string parsing 2018-07-14 14:27:56 -07:00
Victor Zverovich
f66ba6508a Optimize format string parsing 2018-07-08 10:15:24 -07:00
Victor Zverovich
f21268aa72 Revert "Optimize format string parsing" because of a bug in MSVC
https://godbolt.org/g/rpiDgh

This reverts commit f9e9bf0231.
2018-07-08 08:08:50 -07:00
Victor Zverovich
f9e9bf0231 Optimize format string parsing 2018-07-07 16:50:22 -07:00
Victor Zverovich
479ee2a8c6 Fix MSVC build, take 2 2018-07-04 14:24:07 -07:00
Victor Zverovich
c04fb91b03 Fix handling of user-defined types in format_to (#793) 2018-07-04 07:40:56 -07:00
Victor Zverovich
ab2d88ca8e Make format_to work with basic_memory_buffer (#776) 2018-06-23 08:29:26 -07:00
Remotion
ce500635c7 Renamed enum color to colors.
Added enum colors conversion to rgb struct.
Added colors_test.cpp.

Removed print_colored.
Renamed enum colors back to color.

Removed unnecessary inline keyword.
Removed print_rgb.
2018-06-23 06:14:44 -07:00
Victor Zverovich
0508bbc7ae Add wchar_t overload of format_to_n (#764) 2018-06-13 08:24:32 +02:00
Victor Zverovich
1b8a7f8fa0 Fix postincrement in truncating and counting iterators 2018-06-07 20:20:36 +02:00
Victor Zverovich
fc6e0fe992 Fix FP formatting to a non-back_insert_iterator with sign & numeric alignment (#756) 2018-06-07 18:41:40 +02:00
Elias Kosunen
691a7a91a1 Add more compilers to CI and increase FMT_PEDANTIC warning levels (#736)
* Add a _lot_ more warnings to FMT_PEDANTIC
Fix these warnings

* Add more compilers to CI
Fix (some) of the compiler errors with them

* Enable -Werror on CI
Increase warning level on MSVC when compiling with FMT_PEDANTIC

* Add VS 2013 and 2015 to Appveyor

* Fix Appveyor tests
Formatting

* Implement requested changes
Fix some of the MSVC warnings
Implement C++11 integer_sequence

* Reintroduce appveyor-build.py

* Remove ranges-test from tests

* Remove (some) explicit warning suppressions
Fix C++ standard setting in CI

* Remove (some) explicit warning suppressions
Fix C++ standard setting in CI

* Fix test builds with C++11

* Enable pedantic warnings on tests

* Fix warnings from edits to master

* Cleanups

* Add C++11 support to ranges.h
Re-enable ranges-test
Fix a Visual Studio error about function not returning a value in printf.h
Fix a bug in .travis.yml
2018-06-06 15:57:59 +02:00
Victor Zverovich
d5c462596b Fix formatting of more than 15 named arguments (#754) 2018-06-05 08:32:28 +02:00
Victor Zverovich
e2cd521b8f Fix incorrect call to on_align in '{:}=' (#750) 2018-05-26 09:23:09 -07:00
Victor Zverovich
edd5f1445d Fix compilation errors on gcc 4.4 2018-05-20 09:09:03 -07:00
Victor Zverovich
69823bf852 Improve naming consistency 2018-05-19 08:59:37 -07:00
Victor Zverovich
d940fa679c Disable unsafe implicit conversion to std::string (#729) 2018-05-19 07:14:27 -07:00
Victor Zverovich
838400d29b Add inline namespace fmt::v5 2018-05-12 11:02:15 -07:00
Michael Winterberg
ca31ca13f1 Fixed arg_formatter_base::write_pointer to not mutate the format specs.
This fixes cases where arg_formatters are reused, like with arg_join.
2018-05-01 07:12:27 -07:00
Victor Zverovich
fa9066fe3e context_base::begin -> out 2018-04-22 09:16:32 -07:00
Victor Zverovich
7d28674d3a make_args -> make_format_args 2018-04-08 07:21:26 -07:00
Victor Zverovich
fd0b07a75a (w)context -> (w)format_context 2018-04-08 07:03:44 -07:00
Victor Zverovich
5859e58ba1 Fix msvc warnings 2018-04-04 21:11:31 -07:00
Victor Zverovich
1e747f603f Fix msvc warnings 2018-04-04 20:57:02 -07:00
Victor Zverovich
23759b2688 basic_arg -> basic_format_arg, arg_store -> format_arg_store 2018-04-04 07:38:21 -07:00
Victor Zverovich
3cf0526316 Return output iterator to the end from format_to_n 2018-03-30 08:20:12 -10:00
Victor Zverovich
174087bfdb Implement format_to_n 2018-03-29 15:13:10 -10:00
Victor Zverovich
050f3f1f0e Remove parts of obsolete write API 2018-03-29 07:36:37 -10:00
Victor Zverovich
6957d28cfb Detect string_view on libc++ (#686) 2018-03-26 06:50:22 -10:00
Victor Zverovich
8c29459eda Fix handling of empty string_view (#689) 2018-03-21 09:01:51 -07:00
Victor Zverovich
3da71d51e0 Move source files to the src directory 2018-03-21 07:50:59 -07:00
Victor Zverovich
7db0e94b9e Fix handling of numeric alignment with no width (#675) 2018-03-11 21:04:42 -04:00
Victor Zverovich
80e57c7a3d Update to new naming conventions 2018-03-07 07:36:13 -08:00
Victor Zverovich
f1ede6380b Make inline_buffer_size public and update docs 2018-03-04 10:33:42 -08:00
Victor Zverovich
86a9bc8291 Cleanup 2018-03-04 09:16:51 -08:00
Victor Zverovich
5281ea6ad2 do_vformat_to -> vformat_to and update docs 2018-03-04 06:40:43 -08:00
Victor Zverovich
418659adbe Fix compilation errors on gcc 4.4 2018-03-03 14:04:59 -08:00
Victor Zverovich
81074c7048 Fix more compilation errors on gcc 4.6 2018-02-28 05:23:25 -08:00
Victor Zverovich
1b4525384b Fix more compilation errors on gcc 4.6 2018-02-28 05:09:24 -08:00
Victor Zverovich
4d35f94133 Always use fallback string_view to pass format string (#664) 2018-02-24 18:19:30 +00:00
Victor Zverovich
0565d65461 Fix gcc 7.2 issue 2018-02-24 09:29:15 +00:00
Lars Gullik Bjønnes
ea06f021f8 test: comment out one FormatStringErrors constexpr test
GCC 7.3 complains that this is not a compile time constant.

test/format-test.cc: In member function ‘virtual void FormatTest_FormatStringErrors_Test::TestBody()’:
test/format-test.cc:1919:3: error: non-constant condition for static assertion
   static_assert(test_error<__VA_ARGS__>(fmt, error), "")
   ^
test/format-test.cc:1924:3: note: in expansion of macro ‘EXPECT_ERROR’
   EXPECT_ERROR("{0:s", "unknown format specifier", Date);
   ^~~~~~~~~~~~
2018-02-24 08:20:20 +00:00
Lars Gullik Bjønnes
5b49177352 test: Initialize some local variables
GCC 7.3 complains about uninitialized varaibles in constexpr context.
2018-02-24 08:20:20 +00:00
Victor Zverovich
24d249b0b4 Fix formatting of objects convertible to string_view 2018-02-19 20:25:56 +00:00
Victor Zverovich
18ac98700e Fix formatting of objects convertible to std::string 2018-02-17 12:57:18 +00:00
Victor Zverovich
ce4a65ffea Add pointer support to basic_writer 2018-02-17 09:38:46 +00:00
Victor Zverovich
8ed264fcd4 Rename type enum constants to prevent collision with poorly written C libs (#644) 2018-02-16 17:20:33 +00:00
Victor Zverovich
affb35cfb9 Replace using with typedef for compatibility with gcc-4.6 2018-02-11 09:23:47 -08:00
Victor Zverovich
d8ef8a9e9b Cleanup 2018-02-11 06:24:22 -08:00
Victor Zverovich
0b635c9dc5 Fix handling of fixed enums in clang (#580) 2018-02-10 06:17:42 -08:00
Victor Zverovich
67e070fe5a Make format work with C++17 std::string_view (#571) 2018-02-07 08:14:54 -08:00
Victor Zverovich
2f13d41e30 Add to_wstring 2018-02-07 07:08:14 -08:00
Victor Zverovich
1f57243b49 Relax constexpr requirements 2018-02-04 08:52:43 -08:00
Victor Zverovich
dc5403612e Conditionally compile constexpr 2018-02-04 08:21:31 -08:00
Victor Zverovich
1c7b751d70 Fix handling of implicit conversion to integral types larger than int 2018-02-01 16:42:15 -08:00
Victor Zverovich
a980d3b46b Add fmt::join to format ranges (#466) 2018-01-27 16:04:45 -08:00
Victor Zverovich
64b349aee2 More iterator support & fmt::count 2018-01-17 22:04:24 -08:00
Victor Zverovich
322736d3bb Add support for arbitrary output iterators 2018-01-15 12:46:44 -08:00
Victor Zverovich
c1d137ed5f Add support for nonconiguous iterators 2018-01-15 11:30:53 -08:00