Commit Graph

289 Commits

Author SHA1 Message Date
Victor Zverovich
bf5b246717 fmt_isinf -> isinfinity 2014-07-29 08:22:52 -07:00
Victor Zverovich
24d6baa60f Fix Clang build. 2014-07-29 07:49:34 -07:00
Victor Zverovich
481c313df5 Fix the build. 2014-07-29 07:19:54 -07:00
Victor Zverovich
d8b9f413fe Fix https://github.com/cppformat/cppformat/issues/50. 2014-07-29 06:38:05 -07:00
Victor Zverovich
4d049cf598 More fixes for https://github.com/cppformat/cppformat/issues/50. 2014-07-28 08:41:50 -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
5d4803a567 More fixes for https://github.com/cppformat/cppformat/issues/50. 2014-07-27 12:53:42 -07:00
Victor Zverovich
2a1c0c9969 Obey line length limit. 2014-07-26 09:45:03 -07:00
Victor Zverovich
f634ccb344 ReportUnknownType -> report_unknown_type (https://github.com/cppformat/cppformat/issues/50) 2014-07-26 08:42:19 -07:00
Victor Zverovich
b498ba0bc5 FormatFloat -> format_float (https://github.com/cppformat/cppformat/issues/50) 2014-07-26 08:03:03 -07:00
Victor Zverovich
d142e3b55f Simplify handling of flags. 2014-07-25 08:29:06 -07:00
Victor Zverovich
d699c2a0d9 Don't duplicate integer format specifiers when formatting char as integer. 2014-07-25 08:24:27 -07:00
Victor Zverovich
a997de90eb Fix https://github.com/cppformat/cppformat/issues/57. 2014-07-25 07:10:33 -07:00
Victor Zverovich
c1db293518 Don't use Writer's buffer directly in formatters. Unfriend BasicFormatter. 2014-07-24 08:53:27 -07:00
Victor Zverovich
a7d94f0c61 Fix https://github.com/cppformat/cppformat/issues/55. 2014-07-22 12:37:10 -07:00
Victor Zverovich
f1dfd59a41 HandleArgIndex -> handle_arg_index. Use error_ instead of a local. 2014-07-16 08:49:23 -07:00
Victor Zverovich
4edc88f609 Add FormatterBase. 2014-07-16 08:38:15 -07:00
Victor Zverovich
9144a8fbbe PrintfParser -> PrintfFormatter. 2014-07-16 07:59:45 -07:00
Victor Zverovich
9d74f9542b IsNegative -> is_negative. Simplify WidthHandler and ArgFormatter. 2014-07-16 07:27:54 -07:00
Victor Zverovich
512e2ced93 Rewrite argument formatting using ArgVisitor. 2014-07-14 08:47:03 -07:00
Victor Zverovich
e3a2ac8725 Move StringValue to Arg & simplify StringTraits. 2014-07-14 08:04:17 -07:00
Victor Zverovich
591ad0a64a Add ArgVisitor. 2014-07-14 06:55:29 -07:00
Victor Zverovich
9c47f3e057 Fix MinGW issues, take 2. 2014-07-09 09:45:18 -07:00
Victor Zverovich
0ffcec0090 Fix MinGW issues. 2014-07-09 09:35:36 -07:00
Victor Zverovich
8321d0ecf9 Fix warnings on MinGW. 2014-07-09 08:39:01 -07:00
Victor Zverovich
e3a44c11f6 Add an overload of print that accepts std::ostream. 2014-07-09 06:56:36 -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
6e5551e77a ArgInfo -> Arg 2014-07-02 06:33:25 -07:00
Victor Zverovich
5d15bdd5a5 Clean. 2014-07-01 16:23:50 -07:00
Victor Zverovich
39166f9aa9 Remove more deprecated code. 2014-07-01 09:15:20 -07:00
Victor Zverovich
2dc108b31f Remove deprecated code 🎆 🎆 🎆 2014-07-01 09:10:43 -07:00
Victor Zverovich
cff1c79469 Fix another warning. 2014-07-01 06:27:15 -07:00
Victor Zverovich
537c6c4e18 Fix a warning. 2014-07-01 06:21:51 -07:00
Victor Zverovich
eb034a0589 Suppress warnings. 2014-06-30 17:40:53 -07:00
Victor Zverovich
f4208771a8 Replace ThrowWinError with WindowsError class. 2014-06-30 17:32:08 -07:00
Victor Zverovich
a318244a1c Fix Windows build. 2014-06-30 16:48:05 -07:00
Victor Zverovich
53201033f2 Refactor error reporting API. 2014-06-30 14:26:29 -07:00
Victor Zverovich
d29e505568 Move PrintfParser from BasicWriter to the internal namespace. 2014-06-30 07:12:09 -07:00
Victor Zverovich
e63a0ff125 Deprecate c_str() and str(). 2014-06-30 06:43:53 -07:00
Victor Zverovich
21111cc954 MakeArg -> make_arg. Move printf out of Writer. 2014-06-29 19:52:26 -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
2e03963e9e Add fmt::print. Undocument and deprecate old API. 2014-06-28 19:44:39 -07:00
Victor Zverovich
ddbd50de4a Fix build. 2014-06-28 17:44:52 -07:00
Victor Zverovich
302b8f4406 Fix MSVC build, take 2. 2014-06-24 10:46:01 -07:00
Victor Zverovich
ea99bfb902 Move ArgInfo to internal namespace and add ArgList. 2014-06-24 07:54:26 -07:00
Victor Zverovich
3e53ac2451 Fix warnings. 2014-06-23 08:48:42 -07:00
Victor Zverovich
d0587445cb Test negative precision. 2014-06-23 08:39:32 -07:00
Victor Zverovich
4099a1269b Add support for negative width. 2014-06-23 08:10:50 -07:00
Victor Zverovich
1a75ed01cd Implement dynamic precision in printf. 2014-06-23 07:16:46 -07:00
Victor Zverovich
5be9a8de3f Reduce the number of integer types that need to be handled. 2014-06-21 09:40:04 -07:00
Victor Zverovich
b1bbc90919 Use precision from FormatSpec. 2014-06-21 08:32:00 -07:00
Victor Zverovich
879838a539 Implement integer precision. 2014-06-20 07:34:02 -07:00
Victor Zverovich
cb743c0249 Parse printf format specs. 2014-06-19 07:40:35 -07:00
Victor Zverovich
1275923a68 Implement dynamic width in printf. 2014-06-17 06:53:48 -07:00
Victor Zverovich
8666ea82f7 Merge branch 'master' of github.com:cppformat/cppformat 2014-06-16 07:49:37 -07:00
Victor Zverovich
1f19b986a0 Implement printf specifications. 2014-06-16 07:49:30 -07:00
Constantine Tarasenkov
6aace693db Changes for MinGW compiler 2014-06-11 02:38:57 +04: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
1b80148420 Implement '#' flag. 2014-06-07 08:57:55 -07:00
Victor Zverovich
bf790d2819 Ignore '0' flag for non-numeric types as printf does. 2014-06-07 07:31:25 -07:00
Victor Zverovich
80c99760fb Fix warnings. 2014-06-07 07:11:34 -07:00
Victor Zverovich
533c8214d4 Avoid unnecessary check. 2014-06-06 08:54:37 -07:00
Victor Zverovich
438eba1402 Fix parsing of flags. 2014-06-06 08:01:48 -07:00
Victor Zverovich
9aba05b76a Parse '0' flag. 2014-06-06 07:07:57 -07:00
Victor Zverovich
bf8b29fbe7 Add initial support for printf format specifications. 2014-06-06 06:38:37 -07:00
Victor Zverovich
1a2d7be3f5 Implement EXPECT_STDOUT and EXPECT_STDERR using pipes. 2014-05-03 09:48:54 -07:00
Victor Zverovich
9830c52816 Fix UTF8ToUTF16. 2014-05-01 07:20:38 -07:00
Victor Zverovich
dcd039df81 Define WIN32_LEAN_AND_MEAN. 2014-05-01 07:09:42 -07:00
Victor Zverovich
42764e54ae Fix UTF16ToUTF8. 2014-05-01 07:09:08 -07:00
Victor Zverovich
53b4c31afb Move Format*ErrorMessage to internal namespace. 2014-04-30 15:00:41 -07:00
Victor Zverovich
400812a905 CError -> WinError 2014-04-30 12:38:17 -07:00
Victor Zverovich
34712da2e7 Fix MSVC build. 2014-04-30 11:28:07 -07:00
Victor Zverovich
99e6112fda Fix StrError, move Format*ErrorMessage to the implementation. 2014-04-30 11:20:41 -07:00
Victor Zverovich
25ce9e7153 Fix MSVC build. 2014-04-30 10:39:24 -07:00
Victor Zverovich
f79398699b Add ThrowCError to throw an exception on C library errors. 2014-04-30 10:18:11 -07:00
Victor Zverovich
2c6372d790 Add a portable thread-safe version of strerror. 2014-04-30 09:42:48 -07:00
Victor Zverovich
ed2bdbaeaf Fix Windows build. 2014-04-30 07:41:54 -07:00
Victor Zverovich
c16217bf9b Test UTF8ToUTF16 and UTF16ToUTF8. 2014-04-30 07:38:43 -07:00
Victor Zverovich
da9aeab810 Add UTF8ToUTF16 and UTF16ToUTF8. 2014-04-30 07:23:43 -07:00
Victor Zverovich
859a4975f6 Throw SystemError if fwrite fails. 2014-04-30 06:55:21 -07:00
Victor Zverovich
d9db89814f Refactor action classes, Action -> Sink, add comments. 2014-04-28 08:59:29 -07:00
Victor Zverovich
26277c8ab3 Implement move assignment operator for Array. 2014-04-25 08:18:07 -07:00
Victor Zverovich
f28645f900 Fix includes. 2014-04-24 12:37:06 -07:00
Victor Zverovich
cfeba45c35 Let the buffer grow as it pleases. 2014-04-23 18:37:49 -07:00
Victor Zverovich
33baa8f382 Fix the error when formatting a float with a filled buffer on MSVC. 2014-04-23 18:37:08 -07:00
Victor Zverovich
e78904b9b9 Move formatting functionality from BasicFormatter to BasicWriter & FormatPaser to simplify the implementation of standalone formatting methods. 2014-04-23 08:27:50 -07:00
Victor Zverovich
656a8378d1 Use ArgInfo instead of Arg where possible. 2014-04-22 08:58:54 -07:00
Victor Zverovich
03f68857e2 Replace BasicFormatter::Format with BasicWriter::FormatInt. 2014-04-20 08:46:09 -07:00
Victor Zverovich
f2e06804c5 Workaround an issue with Intel C++ compiler. 2014-04-10 10:49:55 -07:00
jdale88
4cabe16241 Should use Char not char, as Char is typedef'd to the correct type (char or wchar_t) 2014-03-11 19:03:26 +00:00
jdale88
a9862fdb22 Fixed some level 4 warnings in VS2013 2014-03-11 18:56:24 +00:00
Victor Zverovich
43fe100875 Move the implementation of ColorWriter::operator() to format.cc 2014-02-19 14:20:26 -08:00
Victor Zverovich
6968ef3bb3 Implement PrintColored.
Thanks https://github.com/jose55 for the idea.
2014-02-19 13:51:23 -08:00
Victor Zverovich
f1d8516467 Fix a warning about empty macro args. 2014-02-19 13:02:22 -08:00
Victor Zverovich
e9b2191689 Add a 32-bit version of CountDigits. 2014-02-19 12:43:55 -08:00
Victor Zverovich
3017fc6fb7 Improve 32-bit integer formatting performance by parameterizing FormatDecimal on integer type. 2014-02-17 09:12:24 -08:00
Victor Zverovich
6f6fe519e2 Fix more warnings. 2014-02-15 11:16:44 -08:00
Victor Zverovich
447e02c54c Add a missing using declaration. 2014-02-15 10:48:34 -08:00
Victor Zverovich
db2cf61cde Fix warnings on older GCC, take 2. 2014-02-15 10:39:41 -08:00
Victor Zverovich
ff0d5d1771 Fix more warnings on older GCC. 2014-02-15 10:17:10 -08:00
Victor Zverovich
0c3a2f5dcb Fix warnings about constants being too large. 2014-02-15 10:08:19 -08:00
Victor Zverovich
6f0387fc22 Expose in-place decimal integer formatting via FormatDec. Improve performance of CountDigits based on the results from https://github.com/localvoid/cxx-benchmark-count-digits. 2014-02-14 10:36:17 -08:00
Victor Zverovich
ea5dce3957 Simplify format specs. 2014-01-28 12:47:37 -08:00
Victor Zverovich
a1bd3358bb Produce a compile error when using wide fill character on a narrow stream. 2014-01-08 08:17:38 -08:00
Victor Zverovich
641df95491 Implement string padding. 2013-12-31 09:43:32 -08:00
Victor Zverovich
a684d0cebf Fix https://github.com/vitaut/format/issues/14 2013-12-27 08:00:10 -08:00
Victor Zverovich
cc6af50514 Fix a warning. 2013-12-10 08:01:08 -08:00
Victor Zverovich
e3b4a3f166 Disallow formatting of wchar_t when using a char formatter. 2013-12-07 08:12:03 -08:00
Victor Zverovich
f406a42baa Fix a warning about long long. 2013-12-06 07:12:38 -08:00
Victor Zverovich
56f12b737c Add support for long long and more tests for unsigned long long. https://github.com/vitaut/format/issues/9 2013-11-22 07:45:43 -08:00
Victor Zverovich
a4e72b4db2 Remove IntTraits<uint32_t> because uint32_t is a typedef, not a built-in type. Rename ULLONG to ULONG_LONG for consistency with ulong_long_value. Remove extra whitespace. 2013-11-21 09:11:58 -08:00
Gregory Czajkowski
a65542bdaf add support for unsigned long long
Want to be able to format the following without any casting

std::cout << fmt::str(fmt::Format("{:x}") << 0xAEull) << std::endl;
std::cout << fmt::str(fmt::Format("{:x}") << 0xAEul) << std::endl;
std::cout << fmt::str(fmt::Format("{:x}") << uint64_t(0xae)) <<
std::endl;
2013-11-21 08:47:55 -08:00
Victor Zverovich
43fa564e9b Remove unused typedef. 2013-11-14 08:44:05 -08:00
Victor Zverovich
b605b3980c Disallow writing a wide string to a char stream and vice versa, because there is no good way to implement these function without knowing the encodings and what std::ostream doesn't make any sense. 2013-09-09 22:21:40 -07:00
Victor Zverovich
65d47e5e09 Add FormatInt for fast stand-alone integer formatting. 2013-09-09 06:51:03 -07:00
Victor Zverovich
c62c475291 Fix a warning. 2013-09-08 14:25:22 -07:00
Victor Zverovich
563a575c0c Fix more warnings. 2013-09-08 13:47:06 -07:00
Victor Zverovich
88972f487b Fix warnings. 2013-09-08 13:30:14 -07:00
Victor Zverovich
93e4125248 Move DIGITS to the implementation. Widen fill_ to support both char and wchar_t. 2013-09-08 13:07:04 -07:00
Victor Zverovich
0fc73164eb Fix warnings. 2013-09-07 12:52:52 -07:00
Victor Zverovich
9ff3b97779 Move more code from header to source. 2013-09-07 10:15:08 -07:00
Victor Zverovich
7cae763c91 Move code from header to source. 2013-09-06 20:23:42 -07:00
Victor Zverovich
9d49321115 Fix MSVC build. 2013-02-05 07:43:15 -08:00
Victor Zverovich
688de77b36 Parameterize Formatter on character type and rename it to BasicFormatter. 2013-02-05 07:28:54 -08:00
Victor Zverovich
03dccc3c91 Rename BasicFormatter to BasicWriter. 2013-02-02 20:29:02 -08:00
Victor Zverovich
687301c516 Parameterize BasicFormatter on char type. 2013-01-26 16:07:28 -08:00
Victor Zverovich
fbfedcf0ac Fix the issue with signbit in C++11. 2013-01-14 15:16:20 -08:00
Victor Zverovich
3c90a8736b Fix the build. 2013-01-12 10:08:16 -08:00
Victor Zverovich
877abaf301 Parameterize integer formatting method on format spec type. Add Sprint/iomanip style formatting methods (oct, hex, hexu, pad). 2013-01-08 09:56:05 -08:00
Victor Zverovich
de17baae2d Move formatting methods to BasicFormat. 2013-01-04 09:14:34 -08:00
Victor Zverovich
251e8774b0 Fix the build on MSVC. 2012-12-29 09:54:57 -08:00
Victor Zverovich
4762a8afd0 Format infinity. 2012-12-29 06:44:14 -08:00
Victor Zverovich
529045b65d Fix the build. 2012-12-28 09:41:03 -08:00
Victor Zverovich
7b970285da Fix the build. 2012-12-28 09:24:06 -08:00
Victor Zverovich
10108c75a5 Implement signbit for MSVC. 2012-12-28 09:08:29 -08:00
Victor Zverovich
ce60483833 Format NaN. 2012-12-28 08:27:54 -08:00
Victor Zverovich
8412ad6aeb Implement automatic argument indexing. 2012-12-27 06:56:55 -08:00
Victor Zverovich
73f13eeb5b Implement '#' flag. 2012-12-25 18:19:51 -08:00
Victor Zverovich
3f73987a62 Move single argument formatting to BasicFormatter. 2012-12-25 17:55:41 -08:00
Victor Zverovich
17ca809135 Implement space sign. 2012-12-25 13:45:12 -08:00
Victor Zverovich
0f46a3df6a Fix the build. 2012-12-25 13:30:42 -08:00
Victor Zverovich
0a138ad865 Implement minus flag. 2012-12-25 13:25:14 -08:00
Victor Zverovich
d96337914f Make integer formatting faster. 2012-12-25 09:00:11 -08:00
Victor Zverovich
84310c3a84 Implement center alignment. 2012-12-24 19:37:50 -08:00
Victor Zverovich
4d1ee0bb5b Fix a warning. 2012-12-24 18:19:33 -08:00
Victor Zverovich
995d01a6fa Fix a warning. 2012-12-24 12:14:26 -08:00
Victor Zverovich
26d2ae6281 Fix compilation on pre C++11. 2012-12-24 11:58:49 -08:00
Victor Zverovich
100149eb58 Fix compilation on pre C++11. 2012-12-24 11:41:20 -08:00