Commit Graph

89 Commits

Author SHA1 Message Date
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 c1cc495908 Fix typo 2018-09-30 14:23:37 +02:00
Martchus e023c1af79 Declare throwIoFailure() as [[noreturn]] 2018-09-30 13:56:25 +02:00
Martchus 749eea2ab6 Support NativeFileStream via Boost.Iostreams
So it can also be enabled when not using libstdc++.
2018-09-30 13:55:30 +02:00
Martchus 2186ce15d9 Use using instead of typedef 2018-09-16 00:25:16 +02:00
Martchus 5c9a834236 Implement NativeFileStream under Unix/Linux/Android as well
* Like the Windows implementation this is disabled by default and
  can be enabled via compile-time switch which will affect the ABI.
* Add support for opening a file from a file descriptor.
2018-09-05 00:21:40 +02:00
Martchus 61f7ce90e1 Improve coding style (after running clang-tidy) 2018-08-12 22:09:22 +02:00
Martchus d82e7bb869 Fix warning regarding multi-line comment 2018-08-04 15:20:54 +02:00
Martchus 0c7e7eb91d Fix BinaryReader::read(int32 &one32BitInt) 2018-06-21 23:25:14 +02:00
Martchus 5deb077fe5 Extend Binary{Reader,Writer} to ease binary (de)serialization
To implement reflection-enabled binary (de)serialization
in https://github.com/Martchus/reflective-rapidjson.
2018-06-20 23:07:08 +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 64be5bce63 Document the whole story behind catchiofailure.cpp 2018-04-14 14:48:36 +02:00
Martchus 51e87f3740 Don't wrongly detect libstdc++ 6.4 as >= 7
6.4 has been release after 20170502 but still throws
ios_base::failure with old ABI. It is not a good idea
to use the timestamp to distinguish release versions.

Note that _GLIBCXX_RELEASE is not defined in older
GCC versions. But if the macro is not present, we also
know that it will throw the old version.
2018-04-14 14:43:35 +02:00
Martchus 557856dc5c Apply clang-format 2018-04-01 23:08:41 +02:00
Martchus 8bc3cf9615 Add phrase for overriding current line 2018-04-01 23:08:31 +02:00
Martchus 76ee4a158b Add color overload for ANSI escape codes 2018-03-25 20:02:21 +02:00
Martchus e2e4b4641f Add EscapeCodes::Strikethrough 2018-03-25 20:00:01 +02:00
Martchus df7a3ee93c Apply clang-format from LLVM 6 2018-03-24 17:00:30 +01:00
Martchus cdecc48a1d Fix warning about signedness conversion in BinaryReader
Length is expected to be positive
2018-03-04 21:06:29 +01:00
Martchus b375ea80b0 Deprecate BinaryReader::readTerminatedString() methods 2018-01-29 16:30:46 +01:00
Martchus 209a59106e Fix BinaryReader::readMultibyteTerminatedStringXX methods 2018-01-29 16:29:49 +01:00
Martchus d6361e1cfd Fix some mistakes in ANSI escape codes 2018-01-29 16:26:28 +01:00
Martchus fe3929c340 Add phrase for info 2017-11-27 10:25:41 +01:00
Martchus 9829dbe727 Make use of escape codes configurable 2017-10-17 00:00:46 +02:00
Martchus 4011040e57 Add Phrases::EndFlush 2017-10-09 20:43:18 +02:00
Martchus 0b19d0b523 Export std::ostream&operator<<(std::ostream&,Phrases) correctly 2017-10-07 22:52:06 +02:00
Martchus 784f3d963a Add 'makepkg'-style messages to Phrases 2017-09-30 19:16:43 +02:00
Martchus 09efb1ff3e Move phrases from tag editor to c++utilities
because they are also useful for syncthingctl
2017-09-26 15:23:23 +02:00
Martchus 72806d69fd Add << overloads for formatting output 2017-09-22 00:22:08 +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 1d4a4bd2be binary reader/writer: Increase limit of length-prefixed strings
So strings with a size up to 0xFFFFFFFFFFFFFF byte can be handled.
2017-07-28 20:34:50 +02:00
Steven Penny 7f140c7058 catchiofailure: defined _GLIBCXX_USE_CXX11_ABI first to cover GCC 5
Fix #7
2017-06-25 12:29:32 -05:00
Martchus 9429f7e23f Fix BitReader::bitsAvailable() 2017-06-25 16:00:11 +02:00
Martchus 2625f82e49 ios_base::failure workaround: Ensure c++config.h is included 2017-06-01 11:29:33 +02:00
Martchus dc73538170 Adjust ios_base::failure workaround for GCC 7
* Use new ABI under GCC >= 7
* See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66145
2017-05-31 00:35:31 +02:00
Martchus db46948f2f Apply clang-format 2017-05-04 22:44:15 +02:00
Martchus 59e20b1043 Apply clang-format 2017-05-01 03:13:11 +02:00
Martchus c4cf107de2 Make cast in binary reader explicit 2017-02-06 18:32:27 +01:00
Martchus 06af1c4a73 Use std::make_unique provided by C++14 2017-02-05 21:00:52 +01:00
Martchus 6115933756 Add convenience function to read entire file at once 2017-02-03 01:06:38 +01:00
Martchus 94a6b47811 Improve documentation 2017-02-03 00:54:44 +01:00
Martchus 33d368397f Make use of newly introduced string builder 2017-01-27 18:51:54 +01:00
Martchus 8d95b4497f Clean io/path.h 2017-01-14 00:33:02 +01:00
Steven Penny 025be1e54e io/nativefilestream.cpp: proper catchiofailure.h include
1. Using <> makes no sense if cpp-utilities is being built for first time

2. Again, search in <prefix>/c++utilities/io makes no sense if cpp-utilities is
   being built for first time
2016-12-29 22:16:38 -06:00
Martchus 9d91cfca07 Add NativeFileStream to support unicode filenames under Windows 2016-12-21 00:29:57 +01:00
Martchus aed4788c64 Make 'DirectoryEntryType &operator|=' not constexpr 2016-10-29 00:24:18 +02:00
Martchus 72426e2d4c Fix bash completion when dir/file contains single quote
Also a few other improvements in bash completion code
2016-10-22 20:52:08 +02:00
Martchus 4c40004f0b Improve CLI utils
- Add ArgumentParser::readArgs()
- Add Indentation
- Fix eraseLine()
2016-10-02 21:53:58 +02:00