Commit Graph

82 Commits

Author SHA1 Message Date
Martchus bf8e0db87f Construct tuple in in string builder directly 2020-03-02 18:23:38 +01:00
Martchus 8744cf95ef Ensure no copy is made when using argsToString()
It seems that std::make_tuple() is using __decay_and_strip so
the arguments get copied. Using the std::tuple c'tor directly
instead.

When using the %-operator it is already taken care that strings
are stored as pointers and not by value.
2020-02-18 19:29:23 +01:00
Martchus 1154ed4d1c Improve exception messages of NativeFileStream
So one gets e.g. "open failed: Permission denied" instead of
just "open failed: iostream error".
2020-02-14 17:13:05 +01:00
Martchus 7204bc6f06 Support using string builder with types convertible to target string type
So e.g. std::filesystem::path can be used to build an std::string.
2020-02-13 17:05:46 +01:00
Martchus a5283535cc Support nested tuples in string builder
This is useful to concatenate previously constructed sub
strings passed around as tuples.
2020-01-26 19:02:22 +01:00
Martchus 7376a2bb9b Support string builder operator '+' for std::string_view 2019-11-28 23:10:16 +01:00
Martchus b8a60a0cd4 Support string builder operator '%' for std::string_view 2019-11-28 23:05:55 +01:00
Martchus 8e3aa84780 Support std::string_view in stringbuilder.h 2019-11-28 22:34:10 +01:00
Martchus 4e3393ee72 Apply clang-format 2019-10-30 23:02:30 +01:00
Martchus 1177381521 Add CppUtilities::endsWith() 2019-10-30 20:34:16 +01:00
Martchus 2cdde81077 Fix startsWith() if strings are equal 2019-10-27 17:59:26 +01:00
Martchus b693c72eb1 Fix old namespaces being mentioned in the documentation 2019-09-04 18:45:28 +02:00
Martchus b48b2f5c06 Have everything in one top-level namespace 2019-06-10 21:56:46 +02:00
Martchus 54aaad49a3 Use std::forward in argsToString() 2019-05-11 19:19:59 +02:00
Martchus eef6cd2f9e Use constexpr or inline in stringbuilder where possible 2019-05-11 19:10:36 +02:00
Martchus 9a50d2b8df Remove types 2019-04-13 20:33:39 +02:00
Martchus f40a800107 Remove USE_NOTHROW and make ConversionException inline 2019-04-13 20:33:39 +02:00
Martchus 264a349751 Remove widen.h, use iconv based string conversion instead 2019-04-13 20:33:39 +02:00
Martchus 41fa627ef4 Apply tidy 2019-03-11 17:47:17 +01:00
Martchus 7452d44e64 Prevent formatting bitrate as "-NaN GiB/s" 2019-03-10 16:26:23 +01:00
Martchus a0dff23c26 Remove extra handling for big endian
The detection for big endian seems to work. But the special
handling for big endian is wrong. Only without it tests pass
under ppc64. Tested with Tumbleweed ppc64 image ran within
qemu-system-ppc64.
2019-01-12 04:53:05 +01:00
Martchus fe4d2b5778 Improve readability of endianness detection 2018-12-29 23:48:01 +01:00
Martchus 8e32fc0229 Apply clang-format 2018-10-06 16:18:53 +02:00
Martchus 5356d793fc Make all tests pass under Windows
* Workaround some issues
* Disable some tests (better than not running tests
  at all)
2018-10-03 22:37:55 +02:00
Martchus 8e3c40abb5 Make conversion from multi byte to wide string generic 2018-10-03 21:26:41 +02:00
Martchus 3a14d39a14 Add conversion from const char* to float/double
Previously only conversion from std::string to float/double
was possible.
2018-09-22 16:47:44 +02:00
Martchus a6eefc3ab6 Fix documentation of string conversion functions 2018-09-22 16:46:48 +02:00
Martchus 651720552e Replace typedef's with using
* Except in code which will be discarded in v5 anyways
* Should not affect source and binary compatibility
2018-09-22 16:41:33 +02:00
Marius Kittler 7e4d9a6c59 Add missing header to fix compilation with GCC 4.9 2018-07-13 13:54:53 +02:00
Martchus 97aac2424a Reduce block-nesting in joinStrings() 2018-07-01 23:21:06 +02:00
Martchus 52734ebf51 Make use of thread_local optional
Because it doesn't seem to be implemented for
apple-darwin targets.
2018-06-03 22:14:22 +02:00
Martchus a21ed51505 Improve coding style in toFloat{32,64}() functions
* Use const
* Don't duplicate BE/LE branches
2018-05-31 22:45:45 +02:00
Martchus d174f3f157 Make toInt() functions constexpr 2018-05-31 22:43:35 +02:00
Martchus 7125e52e87 Make error messages in stringconversion.h more verbose 2018-05-31 22:28:38 +02:00
Martchus f4920abebc Fix thread-safety of character set conversion functions 2018-05-31 01:24:04 +02:00
Martchus 5bc2ca87e0 Don't use size factor for conversion from UTF-8 to Latin-1 2018-05-31 01:19:56 +02:00
Martchus d9f2ad7260 Fix warnings in character set conversion functions 2018-05-31 01:19:34 +02:00
Martchus 1aa8b387e1 Apply clang-format 2018-05-08 00:35:51 +02:00
Martchus a4435bbcf3 Fix usage of enable_if with GCC 8
Seems like the trick with the three dots isn't working
with GCC 8 anymore. So let's make it a default template
parameter then.

Not sure whether GCC 8 is here correct and whether this
workaround causes further trouble.
2018-05-07 23:22:43 +02:00
Martchus df7a3ee93c Apply clang-format from LLVM 6 2018-03-24 17:00:30 +01:00
Martchus 7b974a1b1d Add 'const char *' overload to ConversionException 2018-03-11 22:36:59 +01:00
Martchus da5a027ea3 Add simplified, string_view-compatible version of splitString() 2018-02-28 18:03:07 +01:00
Martchus 6a1280ba8a Fix warning about implicit conversion 2018-01-31 21:00:13 +01:00
Martchus a0c6868e88 Add conversion methods: multiline str <=> array of lines 2017-10-23 01:09:59 +02:00
Martchus e52fd5a4af Apply tidy after updating to clang-format 5.0.0
The behavior of clang-format slightly changed in Clang 5.0.0:
http://releases.llvm.org/5.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
2017-09-17 21:45:23 +02:00
Martchus 22c8e636dc Write digitToChar() in a more compact way 2017-06-29 18:24:11 +02:00
Martchus 28f37bbbcd string to int: Allow specifying string size 2017-06-08 00:41:29 +02:00
Martchus 045c713cf5 string to int: Ignore whitespaces at beginning 2017-06-08 00:39:54 +02:00
Martchus 06f401b393 Prevent warning in swapOrder(uint16 value) 2017-06-03 17:16:52 +02:00
Martchus db46948f2f Apply clang-format 2017-05-04 22:44:15 +02:00