Commit Graph

212 Commits

Author SHA1 Message Date
Victor Zverovich
7561ff27e5 Fix warnings about unsigned long long as well. 2014-02-15 10:02:02 -08:00
Victor Zverovich
7325ebc965 Fix the warning about long long on older gcc. 2014-02-15 09:58:33 -08:00
Victor Zverovich
245faa745b ConvertWChar -> ConvertChar. 2014-02-15 09:39:49 -08:00
Victor Zverovich
eadd2ee421 Add FormatInt::data() and document members. 2014-02-15 09:39:06 -08:00
Victor Zverovich
f43de4a469 Only append terminating '\0' when necessary. 2014-02-15 09:24:31 -08:00
Victor Zverovich
430c45d618 Too much Python 🐍 2014-02-14 14:06:39 -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
d473a79581 Add FormatInt::size, and support for long and long long. 2014-02-13 09:59:49 -08:00
Victor Zverovich
bfedba5a0a Add support for int64_t in FormatInt. 2014-01-30 08:02:06 -08:00
Victor Zverovich
c3f5dce8d5 Fixed bug https://github.com/vitaut/format/issues/16 . Thanks to https://github.com/fil222 ! 2014-01-28 12:49:36 -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
1f17447fac Simplify pad. 2014-01-07 08:44:15 -08:00
Victor Zverovich
8efc8ac075 Fixed https://github.com/vitaut/format/issues/15 . Thanks! 2014-01-06 17:49:27 -08:00
Victor Zverovich
24fcd6e97f Fix compilation with clang. 2014-01-02 12:29:53 -08:00
Victor Zverovich
6038c85231 format_test -> format-test. Add support for wide char to BasicWriter. 2014-01-02 11:30:28 -08:00
Victor Zverovich
342b76d278 Implement pad for wide strings. 2014-01-01 10:00:55 -08:00
Victor Zverovich
09f98854bf StrFormatter -> StrFormatSpec. 2014-01-01 09:22:55 -08:00
Victor Zverovich
ba6c5fe522 IntFormatter -> IntFormatSpec. 2014-01-01 09:20:16 -08:00
Victor Zverovich
fec6bc04f5 Spec -> EmptySpec. Improve comments. 2014-01-01 09:06:25 -08:00
Victor Zverovich
59c5612e87 Add comments. 2013-12-31 10:15:16 -08:00
Victor Zverovich
641df95491 Implement string padding. 2013-12-31 09:43:32 -08:00
Victor Zverovich
fbed12ac58 Fix warnings. 2013-12-13 15:13:14 -08:00
Victor Zverovich
2d485d1916 Improve support for C++98 compilers that require a copy ctor when binding a reference to a temporary. 2013-12-10 08:08:41 -08:00
Victor Zverovich
21f3a700c5 Fix a typo. 2013-12-09 17:51:11 -08:00
Victor Zverovich
8ca31c8473 Fix compilation on GCC when -std=c++11 is not specified. 2013-12-09 17:45:27 -08:00
Victor Zverovich
3d7faaf0bd Detect the availability of initialize lists. 2013-12-09 08:31:08 -08:00
Victor Zverovich
bd5fe67eef Conditionally compile C++11 parts. 2013-12-09 08:12:33 -08:00
Victor Zverovich
185ec1d91e Fix a typo. 2013-12-09 08:12:21 -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
206c846e12 Replace BasicFormatter.Add with args_.push_back. 2013-12-07 08:03:23 -08:00
Victor Zverovich
2d620be6ff Pre-allocate space for arguments. 2013-12-06 09:16:50 -08:00
Victor Zverovich
5789930096 Variadic version of BasicFormatter's ctor. 2013-12-06 09:08:37 -08:00
Victor Zverovich
f406a42baa Fix a warning about long long. 2013-12-06 07:12:38 -08:00
Victor Zverovich
39cc99e2c2 Disable MSVC warning about multiple copy ctors. 2013-12-06 07:00:06 -08:00
Victor Zverovich
383a8423ef Forbid copying from a temporary (Basic)Formatter object. 2013-12-04 22:22:25 -08:00
Victor Zverovich
e8a2bdf2d1 Add comments. 2013-12-01 06:59:14 -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
f184ad0a2c Restore the 'B' type by https://github.com/gcflymoto and add tests. 2013-11-16 21:25:48 -08:00
Victor Zverovich
2aa4cd9827 Fix gcc version check for noexcept. 2013-11-16 07:19:59 -08:00
Victor Zverovich
d49845510e Check gcc version for diagnostic once. 2013-11-16 07:19:41 -08:00
vitaut
16cb991fd8 Merge pull request #6 from gcflymoto/master
add support for older GCC versions
2013-11-16 07:15:18 -08:00
Gregory Czajkowski
7b22272fbf add support for older GCC versions 2013-11-15 16:00:09 -08:00
Victor Zverovich
52b55e1791 Always use noexcept for gcc >= 4.8 because dtors are implicitly noexcept there. Remove binu and 'B' specifier. 2013-11-14 08:45:20 -08:00
vitaut
e0afc418b3 Merge pull request #4 from gcflymoto/master
Added support for binary modifier
2013-11-14 07:57:16 -08:00
Gregory Czajkowski
9cc24166b5 revert back changes and to create a single pull request for bin mode 2013-11-12 14:12:17 -08:00
Gregory Czajkowski
631f407f99 add better support for different GCC and 64bit longs 2013-11-08 17:06:54 -08:00
Victor Zverovich
d3ec9a1316 Add support for StringRef in BasicFormatter. 2013-11-08 09:53:50 -07:00
Gregory Czajkowski
e4ffc06875 add support for binary type and test long longs more 2013-10-23 20:04:32 -07:00
Victor Zverovich
eded10cf31 Fix FormatInt. 2013-09-10 09:28:04 -07:00
Victor Zverovich
2951f8b3d8 API docs. 2013-09-10 09:26:11 -07: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
1733198bf5 Guard gcc pragmas from -dumb compilers- MSVC. 2013-09-09 15:47:09 -07:00
Victor Zverovich
4523ed7887 Disable -Wlong-long on gcc. 2013-09-09 15:38:43 -07:00
Victor Zverovich
e1a02c5141 Fix formatting of long long. 2013-09-09 15:23:05 -07:00
Victor Zverovich
aefb3bb918 Simplify tests. Add support for long long in Writer. 2013-09-09 15:12:51 -07:00
Victor Zverovich
ad1be3c17a Add a missing header. 2013-09-09 10:42:33 -07:00
Victor Zverovich
65d47e5e09 Add FormatInt for fast stand-alone integer formatting. 2013-09-09 06:51:03 -07:00
Victor Zverovich
bcef11c0d1 Add support for long double in Writer. 2013-09-08 16:27:12 -07:00
Victor Zverovich
1e724a9d33 Write docs. 2013-09-08 15:37:14 -07:00
Victor Zverovich
2a9f358d7e Add support for long and unsigned long in Writer. 2013-09-08 14:18:08 -07:00
Victor Zverovich
563a575c0c Fix more warnings. 2013-09-08 13:47:06 -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
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
c2e65d1371 Test and fix writing wide chars. 2013-09-06 19:34:55 -07:00
Victor Zverovich
525de51320 Test and fix writing wide strings. 2013-09-06 19:32:19 -07:00
Victor Zverovich
9b619782a0 Fix the build. 2013-09-04 22:10:58 -07:00
Victor Zverovich
bc6c1c17cc Add support for wide strings. 2013-09-04 22:03:37 -07:00
Victor Zverovich
3a7962fc1b Update the docs. 2013-09-04 20:44:13 -07:00
Victor Zverovich
ca171307f3 TempFormatter -> Formatter. Complete refactoring. 2013-09-04 19:23:55 -07:00
Victor Zverovich
50cf5e17a7 Merge ArgInserter into TempFormatter and replace BasicFormatter::operator() with BasicWriter::Format. 2013-09-03 18:58:13 -07:00
Victor Zverovich
6829819b8d Fix MSVC build. 2013-09-03 15:59:46 -07:00
Victor Zverovich
82475e4874 Use checked iterators if _SECURE_SCL is defined. 2013-09-03 08:16:53 -07:00
Victor Zverovich
62a00e333a Fix more "secure" warnings. 2013-09-02 20:31:00 -07:00
Victor Zverovich
f211e313e2 Fix MSVC "secure" warnings instead of (unsuccessfully) trying to disable them. 2013-09-02 20:24:09 -07:00
Victor Zverovich
0802941d4f Disable MSVC "secure" warnings in format.h only. 2013-09-02 19:25:14 -07:00
Victor Zverovich
8b4a466716 Correct a miselading comment. 2013-08-31 11:14:43 -07:00
Victor Zverovich
c31eaef1b0 Fix an example. 2013-08-28 10:54:18 -07:00
Victor Zverovich
6323d30247 Implement compatibility with compilers other than clang 2013-05-15 10:04:11 -07:00
Victor Zverovich
5adb9f7a39 Add support for noexcept 2013-05-15 08:59:44 -07:00
Victor Zverovich
1cad3fadd6 Remove warning pragmas since there is no effect on "security" warnings 2013-04-22 08:37:01 -07:00
Victor Zverovich
ca7e689e08 Add missing include, try disable warnings on MSVC. 2013-04-22 08:11:57 -07:00
Victor Zverovich
6da2c53099 Fix compilation when windows.h is included (issue 2) 2013-04-22 07:39:36 -07:00
Victor Zverovich
d3be932534 Handle short and float arguments 2013-03-31 07:01:09 -07:00
Victor Zverovich
aa9a94c8df Fix MSVC build 2013-02-28 11:13:43 -08:00
Victor Zverovich
6afa2994d5 Allocate large enough buffer to make _ecvt_s happy. Swap the order of template parameters in TempFormatter for convenience. 2013-02-28 10:47:20 -08:00
Victor Zverovich
478d004c1d Get rid of secure warnings. 2013-02-27 14:45:04 -08:00
Victor Zverovich
6cc758b6e2 Workaround MSCRT brain damage, take 2. 2013-02-27 14:17:07 -08:00
Victor Zverovich
ab05af06f2 Workaround MSCRT brain damage. 2013-02-27 13:44:00 -08:00
Victor Zverovich
1e58ebf1b7 Fix a crash when exception is throws in nested Format. Check automatically assigned argument index. Add double output method to BasicWriter. 2013-02-27 13:17:09 -08:00
Victor Zverovich
dcb82310eb Fix the build when isinf is a macro. 2013-02-21 17:44:29 -08:00
Victor Zverovich
695bb2f3d4 Fix a compilation issue when math.h is included before format.h 2013-02-21 16:53:58 -08:00
Victor Zverovich
60d51406ef Look for isinf in std namespace too. 2013-02-05 08:11:04 -08:00
Victor Zverovich
b09f371306 Implement a workaround for older GCC. 2013-02-05 08:05:01 -08:00
Victor Zverovich
74494c29cb Fix the build. 2013-02-05 07:49:43 -08: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