Commit Graph

689 Commits

Author SHA1 Message Date
Victor Zverovich
9bb213e920 FormatError -> format_error 2016-08-25 08:38:07 -07:00
Victor Zverovich
a79c7b4e8f Fix handling of unsigned char strings (#373) 2016-08-23 08:42:25 -07:00
Victor Zverovich
f19d8f9655 Improve error reporting (#357) 2016-08-16 07:08:53 -07:00
Victor Zverovich
1a23f9c274 Correct buffer growth when formatting time (#367) 2016-08-04 08:47:59 -07:00
Victor Zverovich
8631694021 check -> const_check to avoid a conflict with AssertMacros.h (#350) 2016-07-12 06:40:23 -07:00
Victor Zverovich
0e6df7e511 Fix handling of thousands separator (#353) 2016-07-11 06:31:23 -07:00
Victor Zverovich
e2a332e5df Use a mock to test locale support 2016-05-19 17:38:44 -07:00
Victor Zverovich
5b106083e7 Check if setlocale succeeded 2016-05-19 06:48:35 -07:00
Victor Zverovich
90730e706b Move ostream support to ostream.{h,cc} 2016-05-06 07:37:20 -07:00
Victor Zverovich
fa5ebd27d4 Implement time formatting 2016-04-25 08:07:27 -07:00
Victor Zverovich
afd67497de cppformat -> fmt 2016-04-24 09:06:12 -07:00
vitaut
b69e6dcead Make BasicArgFormatter public and add ArgFormatter
This allows providing custom argument formatters without relying on
internal APIs (#235).
2016-04-19 08:56:31 -07:00
vitaut
f68771abe4 Implement locale-specific integer formatting 2016-04-17 19:06:03 -07:00
vitaut
a99891e7a5 Use a mock to test custom argument formatter 2016-03-19 07:36:28 -07:00
vitaut
52f89065e1 Make argument formatter customizable 2016-03-19 07:20:31 -07:00
Mario Werner
d411aa165e use quotes for including cppformat headers from the tests 2016-02-02 16:58:41 +01:00
Mario Werner
fee52f79b8 update the includes in the tests to get rid of the deprecated warnings 2016-01-30 22:33:37 +01:00
vitaut
b8bd80ff28 Fix handling of empty non-null-terminated strings 2015-11-25 09:49:01 -08:00
vitaut
6cff6d8137 Use overloaded operator<< for enums if available (#232) 2015-11-24 08:18:19 -08:00
vitaut
8b86a74ad5 Allow formatting C strings as pointers (#223) 2015-11-09 07:17:36 -08:00
vitaut
7c24973637 Format (un)signed char as integer by default (#217) 2015-11-05 20:46:22 -05:00
vitaut
b2714f83cc FMT_NO_STREAM_LIBRARIES -> FMT_USE_IOSTREAMS
for consistency with similar macros and removed unnecessary
checks.
2015-10-18 08:50:35 -07:00
Richard Maxwell
2cca51c744 Issue 205: Make iostream support optional. 2015-10-16 08:04:53 +13:00
Dean Moldovan
c0813c59f3 Work around UDL macro stringification bug on some versions of GCC
See bug report: https://gcc.gnu.org/ml/gcc-bugs/2015-04/msg02027.html
2015-10-09 11:55:36 +02:00
Dean Moldovan
bc6010cc21 Add _a literal for named arguments 2015-09-27 04:09:37 +02:00
Dean Moldovan
a63a24f2d7 Add _format literal 2015-09-27 04:00:24 +02:00
vitaut
79d8f59906 Implement formatting of objects with (s)printf. 2015-09-08 08:36:20 -07:00
vitaut
5b8d0a7aa9 Make Coverity happy 2015-08-04 07:22:03 -07:00
vitaut
6cf24c7f92 Fix MSVC warnings 2015-07-08 08:04:32 -07:00
vitaut
c669cbedf8 Rename None to Null because of conflict with an xlib.h macro 2015-07-07 07:05:17 -07:00
vitaut
438bd9b0e6 Add BasicCStringRef to represent a null-termated string (#100)
and use it instead of BasicStringRef in cases that assume that the
string is null-terminated such as POSIX function and format string
parser.
2015-06-26 07:43:54 -07:00
vitaut
948317b6dd Fix FormatLongDouble test on PowerPC (#180) 2015-06-23 07:39:49 -07:00
vitaut
8450f5e1d3 FormatIntTest: FormatDec: don't assume signedness of char type
Thanks to Eugene V. Lyubimkin for the patch.
2015-06-22 07:03:26 -07:00
vitaut
e39490500c Replace implicit conversion to std::string with to_string 2015-06-17 07:59:41 -07:00
vitaut
9d09214e7a Use textual representation for bool by default (#170) 2015-06-11 09:00:06 -07:00
vitaut
fd5c2e909b Report error when using precision with char 2015-06-11 08:58:31 -07:00
vitaut
b83ab16676 Break long lines 2015-06-11 06:14:42 -07:00
jamboree
3c99ed4498 Fix name parsing 2015-06-11 12:03:22 +08:00
jamboree
7487bde587 Support named arguments 2015-06-10 09:32:59 +08:00
vitaut
ed2dfe5124 Implement writing narrow strings into a wide writer 2015-06-09 08:20:44 -07:00
vitaut
8949a2e941 Fix formatting 2015-06-08 06:53:18 -07:00
jamboree
54a6cb34c7 Support runtime width specification 2015-06-04 13:59:37 +08:00
vitaut
90a12b1bb2 Fix warnings 2015-05-12 08:57:21 -07:00
vitaut
3e03934d15 If std::swprintf is broken, disable relevant test and warn about it 2015-05-08 07:57:43 -07:00
vitaut
85b985e9f2 Workaround a bug in formatting long double in MinGW, take 3 2015-05-07 08:17:30 -07:00
vitaut
3e379829a0 Workaround a bug in formatting long double in MinGW, take 2 2015-05-07 07:25:39 -07:00
vitaut
673a4525f6 Workaround a bug in formatting long double in MinGW 2015-05-07 07:18:46 -07:00
vitaut
87cb2935f8 Test and fix handling of exactly MAX_PACKED_ARGS arguments 2015-05-01 06:55:26 -07:00
vitaut
cf04d98d06 Pass as many types as possible in a single integer to reduce code bloat 2015-03-24 08:55:40 -07:00
Victor Zverovich
beaf6f7436 Add a fixed-size array writer 2015-03-01 18:08:24 -08:00
Victor Zverovich
53010624a0 Move Windows implementation of print_colored to a separate branch
as it needs further testing.
2015-02-19 07:54:59 -08:00
Victor Zverovich
bd133382f0 Fix BasicWriter::write without formatting arguments on C++11 (#109) 2015-02-16 14:32:38 -08:00
Victor Zverovich
cfd476bb8b Temporarily disable the test as the fix didn't work. 2015-02-08 20:41:13 -08:00
Ryuuke
5a9dc8f991 windows cli colors revision and test case 2015-02-08 16:08:29 +00:00
Victor Zverovich
43aebf51d6 Allow precision specifier for non-float arguments 2015-01-08 07:56:08 -08:00
Victor Zverovich
cd828a8691 Add a test for https://github.com/cppformat/cppformat/issues/86 2015-01-05 07:16:26 -08:00
Victor Zverovich
fb12cfd196 Suppress more bogus warnings 2014-12-17 06:53:32 -08:00
Victor Zverovich
8ea9f068c7 Convert tabs to spaces 2014-11-07 07:58:49 -08:00
Victor Zverovich
74dc571ba0 Support signed char and unsigned char strings 2014-09-30 08:15:56 -07:00
Victor Zverovich
313b259891 Use type_traits to test if copyable/assignable
Replace compile tests that check if types are copy constructible and copy assignable with normal tests that use type_traits (if available).
2014-09-30 07:30:05 -07:00
Victor Zverovich
d1ded569ff Separate memory management and formatting
Array is split into an abstract Buffer class and a concrete MemoryBuffer class. BasicWriter now does all memory allocation through a Buffer object. Subclasses of BasicWriter may use different buffer types. The new BasicMemoryBuffer class uses the default MemoryBuffer.
2014-09-29 08:48:16 -07:00
Victor Zverovich
49222dc0c7 Improve allocator test 2014-09-23 07:58:23 -07:00
Victor Zverovich
b9a568b1dd Add support for custom memory allocator to BasicWriter 2014-09-19 07:51:42 -07:00
Victor Zverovich
6a98f42336 Add support for custom allocators 2014-09-18 09:07:40 -07:00
Victor Zverovich
d59fbdcd4a Increase the maximum number of formatting arguments on compilers without variadic templates to 15. 2014-09-11 21:18:36 -07:00
Victor Zverovich
fe9888a1e2 Move implementation tests to format-impl-test. 2014-09-05 07:12:20 -07:00
Victor Zverovich
605d2600f8 Improve error reporting. 2014-08-29 07:45:55 -07:00
Victor Zverovich
279c7a6e6a Change "number is too big in format" to "number is too big" because the error can occur not only in the format function. 2014-08-28 06:50:52 -07:00
Victor Zverovich
526b7fc91d Throw exception in parse_nonnegative_int if the number is too big. 2014-08-28 06:42:59 -07:00
Victor Zverovich
da0f7c0a51 Improve error reporting in parse_arg_index. 2014-08-27 09:04:51 -07:00
Victor Zverovich
42de4f1f7d Get rid of FormatErrorReporter. 2014-08-27 08:24:31 -07:00
Victor Zverovich
f9561671cf Write docs. 2014-08-21 07:30:00 -07:00
Victor Zverovich
c978d88183 Test ArgConverter. 2014-08-15 08:40:13 -07:00
Victor Zverovich
fb32161fa4 Move implementation specific stuff from format.h to format.cc. 2014-08-15 08:40:03 -07:00
Victor Zverovich
c7cfa7d4e7 More tests. 2014-08-15 06:58:24 -07:00
Victor Zverovich
1a0c76a81a Fix formatting of long double. 2014-08-13 07:51:02 -07:00
Victor Zverovich
d346a4120d FormatDec -> format_decimal 2014-07-29 08:45:29 -07:00
Victor Zverovich
8f8fd769ee Fix Fix https://github.com/cppformat/cppformat/issues/50 in tests too. 2014-07-29 07:50:05 -07:00
Victor Zverovich
75b5eb4b9d More fixes for https://github.com/cppformat/cppformat/issues/50. 2014-07-27 15:09:05 -07:00
Victor Zverovich
a997de90eb Fix https://github.com/cppformat/cppformat/issues/57. 2014-07-25 07:10:33 -07:00
Victor Zverovich
a7d94f0c61 Fix https://github.com/cppformat/cppformat/issues/55. 2014-07-22 12:37:10 -07:00
Victor Zverovich
c0d55e6308 Remove WriteArrayOfUnknownSize because it shouldn't compile according to standard. 2014-07-10 08:42:33 -07:00
Victor Zverovich
e3a44c11f6 Add an overload of print that accepts std::ostream. 2014-07-09 06:56:36 -07:00
Victor Zverovich
ed421848b3 Test passing an array of unknown size as an argument. 2014-07-09 06:45:20 -07:00
Victor Zverovich
b9a06bafd8 internal::FormatParser -> BasicFormatter. 2014-07-08 16:38:50 -07:00
Victor Zverovich
e825156add Move FormatParser to the internal namespace. 2014-07-08 16:20:33 -07:00
Victor Zverovich
2dc108b31f Remove deprecated code 🎆 🎆 🎆 2014-07-01 09:10:43 -07:00
Victor Zverovich
b939860d6e write -> write_str 2014-06-30 15:44:08 -07:00
Victor Zverovich
53201033f2 Refactor error reporting API. 2014-06-30 14:26:29 -07:00
Victor Zverovich
e63a0ff125 Deprecate c_str() and str(). 2014-06-30 06:43:53 -07:00
Victor Zverovich
a1264926a0 Writer::format -> Writer::write. Make fmt::format return string. 2014-06-29 11:51:10 -07:00
Victor Zverovich
d5b8196749 Update the API. 2014-06-28 21:56:40 -07:00
Victor Zverovich
c649007ed8 Don't use deprecated API. 2014-06-28 19:59:44 -07:00
Victor Zverovich
0914c91284 Don't use deprecated API. 2014-06-28 19:53:15 -07:00
Victor Zverovich
4d5b1e8a13 Update the API and tests. 2014-06-28 17:35:57 -07:00
Victor Zverovich
876a5d1f43 Update more tests. 2014-06-28 16:05:02 -07:00
Victor Zverovich
e06e9f885c Deprecate Format and update tests. 2014-06-28 15:58:02 -07:00
Victor Zverovich
09f40191f4 Fix build, take 2. 2014-06-28 14:57:06 -07:00
Victor Zverovich
c164cb6ecd Fix build. 2014-06-28 14:53:16 -07:00
Victor Zverovich
5edda531f6 Add fmt::format and deprecate fmt::Format. 2014-06-28 14:48:42 -07:00
Victor Zverovich
9c8db26457 Fix build, take 2. 2014-06-28 13:06:49 -07:00
Victor Zverovich
3b3f76b809 Fix build. 2014-06-28 13:03:39 -07:00
Victor Zverovich
4f4e6c965f Fix MSVC build. FormatError -> FormatMessage to avoid ambiguity. 2014-06-28 12:49:51 -07:00
Victor Zverovich
2f6dddd6fd Simplify FMT_VARIADIC. 2014-06-28 11:07:43 -07:00
Victor Zverovich
55f6640cae Fix test. 2014-06-24 11:13:18 -07:00
Victor Zverovich
302b8f4406 Fix MSVC build, take 2. 2014-06-24 10:46:01 -07:00
Victor Zverovich
73fda2a8b1 Fix error on MSVC. 2014-06-24 10:30:37 -07:00
Victor Zverovich
0195f543d9 Initial support for variadic functions without C++11. 2014-06-24 10:14:50 -07:00
Victor Zverovich
7d5da66db9 Clean 2014-06-17 06:54:08 -07:00
Victor Zverovich
8666ea82f7 Merge branch 'master' of github.com:cppformat/cppformat 2014-06-16 07:49:37 -07:00
Victor Zverovich
da9457da61 Add a test case for https://github.com/cppformat/cppformat/pull/47 2014-06-16 07:48:57 -07:00
Constantine Tarasenkov
6aace693db Changes for MinGW compiler 2014-06-11 02:38:57 +04:00
Victor Zverovich
11f76fea94 Fix test, take 2. 2014-06-10 08:57:28 -07:00
Victor Zverovich
e1d4690566 Fix test. 2014-06-10 08:15:38 -07:00
Victor Zverovich
a2828412b6 Fix tests. 2014-06-10 07:36:23 -07:00
Victor Zverovich
03776dd988 Add support for hexadecimal floating point format specifiers a and A. 2014-06-10 07:03:49 -07:00
Victor Zverovich
546b62e74f More tests. 2014-06-10 06:21:41 -07:00
Victor Zverovich
eaa89e23d7 Put File, BufferedFile & ErrorCode in the fmt namespace. 2014-06-09 09:07:27 -07:00
Victor Zverovich
1ed23b9127 Warng about compilers mishandling negative NaN. 2014-06-06 18:54:45 -07:00
Victor Zverovich
acf94abffd Fix build. 2014-06-06 11:14:53 -07:00
Victor Zverovich
5b054ae7b8 Test signbit. 2014-06-06 11:04:27 -07:00
Victor Zverovich
18316cb25f Fix windows build. 2014-06-06 07:29:57 -07:00
Victor Zverovich
bf8b29fbe7 Add initial support for printf format specifications. 2014-06-06 06:38:37 -07:00
Victor Zverovich
5415b2a43b Fix example. 2014-05-14 08:20:20 -07:00
Victor Zverovich
a59dc93764 Fix ReportSystemError and ReportWinError tests. 2014-05-14 06:58:13 -07:00
Victor Zverovich
bb93cf12a7 Add a test. 2014-05-14 06:45:39 -07:00
Victor Zverovich
39561f8a08 Add tests. 2014-05-13 06:51:17 -07:00
Victor Zverovich
45c50a9f1a Fix warning. 2014-05-06 11:34:00 -07:00
Victor Zverovich
44b57bdf8b Fix warnings. 2014-05-06 11:29:07 -07:00
Victor Zverovich
eb09e58697 Fix warnings. 2014-05-06 08:13:28 -07:00
Victor Zverovich
5cf3b6dc7d Add a Print overload that writes to a file. 2014-05-06 08:05:51 -07:00
Victor Zverovich
e1c86f0b5d Fix warnings. 2014-05-06 06:58:32 -07:00
Victor Zverovich
494f53421e Fix warnings. 2014-05-06 06:11:39 -07:00
Victor Zverovich
0aacd0cf6d Replace EXPECT_STDOUT and EXPECT_STDERR with a single macro EXPECT_WRITE. 2014-05-05 08:35:59 -07:00
Victor Zverovich
c880e31d9f Fix warnings. 2014-05-03 16:25:26 -07:00
Victor Zverovich
1a2d7be3f5 Implement EXPECT_STDOUT and EXPECT_STDERR using pipes. 2014-05-03 09:48:54 -07:00
Victor Zverovich
f9eb0b8ba5 format-test.h -> gtest-extra.h 2014-05-02 07:23:25 -07:00
Victor Zverovich
61d5ebc0af Test EXPECT_THROW_MSG. 2014-05-02 06:33:21 -07:00
Victor Zverovich
9cf43ccdad Move tests to the test dir. 2014-05-01 16:49:08 -07:00