Commit Graph

538 Commits

Author SHA1 Message Date
Andreone
67662702aa allow to stream user defined types in a MemoryWriter (#456)
* allow to stream user defined types in a MemoryWriter

* fix indent

* follow Google C++ Style

* make code c++98 compatible

* fix macro usage

* disable ability to stream user defined types if not at least c++11

* fix for disable ability to stream user defined types if not at least c++11

* use FMT_STATIC_ASSERT
2017-01-19 20:47:43 +01:00
mojoBrendan
d8754af063 Allow %s as generic format specifier in printf (#453)
* Allow %s as generic format specifier in printf

Signed integers are formatted as %d
Unsigned integers are formatted as %u
Doubles are formatted as %f
Chars are formatted as %c
Void Pointers are formatted as %p

* Remove '%S' handling and use visitor for generic format strings

* Default for floating point is now "%g" rather than "%f"
2017-01-14 11:45:48 -08:00
Jean-Charles Lefebvre
e0251fdcef BasicContainerWriter utility added 2017-01-05 20:44:35 -08:00
Jean-Charles Lefebvre
e1689cb985 Custom FormatSpec (#439) (#444)
* A custom FormatSpec type can be passed as a template argument to the ArgFormatter chain (#439)

* Corrected nested-name-specifier error

* Spec template argument defaulted to FormatSpec

* Forward declaration of FormatSpec

* Style

* Style (part 2)

* Style (part 3)
2016-12-30 11:29:40 -08:00
Victor Zverovich
fac5546321 Fix test compilation for FreeBSD (#433) 2016-12-14 06:28:41 -08:00
Victor Zverovich
796beaaddb Fix collision with global convert function (#425) 2016-11-19 12:05:49 -08:00
alabuzhev
25f8ad13dd Correction of 418 (#420) 2016-11-11 18:27:39 +01:00
alabuzhev
1d2049b53e Issue #418 - Minimal supported library subset (#419) 2016-11-10 20:29:12 +01:00
Victor Zverovich
6274401919 Fix warnings 2016-11-06 12:37:31 -08:00
Victor Zverovich
1daddec151 FMT_NULLPTR -> FMT_NULL and improve formatting 2016-11-06 09:05:58 -08:00
alabuzhev
49ccb2e449 Using FMT_NULLPTR instead of literal 0 2016-11-03 06:39:40 -07:00
codicodi
1e018e65cb Thread-safe time formatting
This adds thread-safe (at least on platforms that provide necessary extensions) replacement functions for std::localtime and std::gmtime. Alternatively they could be placed in a new source file time.cc, but time.h seems so empty right now...
2016-10-17 07:00:04 -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
a5d0adf395 Use a heuristic to detect empty strftime result (#367) 2016-08-05 07:27:56 -07:00
Victor Zverovich
1a23f9c274 Correct buffer growth when formatting time (#367) 2016-08-04 08:47:59 -07:00
Victor Zverovich
9dbb60c4c8 Move fmt::fprintf to printf.h 2016-08-03 08:52:05 -07:00
Victor Zverovich
6ee9f2ed09 Make printf argument formatters public (#335, #360) 2016-07-21 06:59:28 -07:00
Victor Zverovich
ab054532ce Move writer to PrintfFormatter object for consistency with BasicFormatter 2016-07-20 08:21:13 -07:00
Victor Zverovich
d4ddaaf2b1 Make PrintfFormatter public (#335, #360) 2016-07-20 08:09:14 -07:00
Victor Zverovich
65cd664195 Fix handling of wide strings in StringWriter 2016-07-18 08:47:11 -07:00
Victor Zverovich
1acfd07f1e Workaround broken MinGW installation on AppVeyor (#355) 2016-07-16 08:00:53 -07:00
Victor Zverovich
d4885cea62 Document BasicStringWriter 2016-07-16 08:00:53 -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
4569b4dbd6 Fix -Wpessimizing-move 2016-06-14 15:53:40 -07:00
Victor Zverovich
c9bb5468b6 Fix clang warning 2016-06-14 15:42:32 -07:00
Glen Stark
72d51e0b1e Implemented #335: custom printf support 2016-06-09 08:41:56 -07:00
Victor Zverovich
96c28f748d Detect if lconv contains thousands_sep 2016-05-23 07:41:22 -07:00
Victor Zverovich
e160c2b79a Add fmt prefix to includes (#332)
Technically it is not necessary, but prevents errors when people add the
fmt directory itself rather than its parent to includes.
2016-05-22 16:42:44 -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
b6c0cf9683 Add fmt::to_string (#326) 2016-05-18 19:54:52 -07:00
Victor Zverovich
d00b43c592 Workaround an issue with "delete this" in GMock and gcc 6.1.1 2016-05-14 17:58:14 -07:00
Victor Zverovich
cc9b051d12 Move format_system_error to the public API (#323) 2016-05-13 07:19:39 -06:00
Victor Zverovich
90730e706b Move ostream support to ostream.{h,cc} 2016-05-06 07:37:20 -07:00
Dean Moldovan
f3d6d3a8f2 Fix find-package-test failure with non-default compiler
The failure would happen when the main project was configured with
a compiler which is not the system default. The new configuration
was not forwarded to "ctest --build-and-test". This fixes it.
2016-05-04 00:51:28 +02:00
Dean Moldovan
8eaad79de7 Fix FMT_STATIC_ASSERT compile test
FMT_STATIC_ASSERT is defined in posix.h so expect_compile_error was
actually failing on a missing macro instead of the static assert.
2016-05-04 00:36:48 +02:00
Dean Moldovan
131d446183 Fix compile tests not clearing the cache after an error
The cache bug meant that a failed test would appear forever broken,
even if the proper fix was applied.
2016-05-04 00:36:11 +02:00
Dean Moldovan
3a04ebf14f Fix user-defined literal detection for Intel C++ compiler 2016-05-03 13:43:51 +02: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
Victor Zverovich
5e1576f79f cppformat -> fmt 2016-04-24 08:17:47 -07:00
vitaut
bfdca8b576 Make ArgVisitor public and document it
Also remove unnecessary namespace qualification.
2016-04-20 09:11:33 -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
581afee039 Enable wstring in gtest (#304) 2016-04-13 08:26:42 -04: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
vitaut
9ffe98c00e Fix/suppress MSVC warnings 2016-03-19 06:39:33 -07:00