Commit Graph

588 Commits

Author SHA1 Message Date
Max Kellermann 36ca9d01fb util/ForeignFifoBuffer: shift the buffer in MoveFrom() on demand
The API documentation says "move as much data as possible", and if
there is room at the head of the buffer, we should use that if the
room after the tail is not large enough.
2018-08-20 15:21:05 +02:00
Max Kellermann 3bceed1b53 util/ForeignFifoBuffer: add "noexcept" 2018-08-20 14:53:39 +02:00
Max Kellermann 90de2c4bd6 util/Exception: move code to NestCurrentException() 2018-08-20 14:52:54 +02:00
Max Kellermann 9d63c8220b util/Cast: reverse operands in ContainerAttributeOffset()
The result shall be positive.
2018-08-20 14:23:02 +02:00
Max Kellermann edd9d16c84 util/Cast: move OffsetPointer() to OffsetPointer.hxx 2018-08-20 13:46:18 +02:00
Max Kellermann ec373eba5d util/BindMethod: add "noexcept" 2018-08-20 13:45:41 +02:00
Max Kellermann 0dfb27b7e5 util/StringAPI: stpcpy() was added in Bionic API level 21 2018-08-20 13:31:23 +02:00
Max Kellermann cf471e830f Merge branch 'v0.20.x' 2018-08-02 11:07:40 +02:00
Max Kellermann 906972973e case-insensitive URI scheme comparison
Required according to RFC 3986:

> An implementation should accept uppercase letters as equivalent to
> lowercase in scheme names

Closes #330
2018-08-02 11:01:45 +02:00
Max Kellermann 116edf5fce util/ASCII: add StringStartsWithCaseASCII() 2018-08-02 10:42:28 +02:00
Max Kellermann 7db7568dcf lib/gcrypt/MD5: move code to util/HexFormat.cxx 2018-07-26 17:46:56 +02:00
Max Kellermann 235ddc0990 util/TimeISO8601: new utility library 2018-07-25 08:43:06 +02:00
Max Kellermann 517f5b1999 util/TimeConvert: new utility library 2018-07-25 08:34:52 +02:00
Max Kellermann b778fb38a9 util/StringAPI: add raw strcmp() wrapper 2018-07-18 17:18:34 +02:00
Max Kellermann 6448b31b11 util/StringAPI: add strpbrk() wrapper 2018-07-18 16:51:29 +02:00
Max Kellermann edb44a536a util/PrintException: new utility class 2018-07-17 21:58:07 +02:00
Max Kellermann 60d5bf0240 util/StringFormat: new utility library 2018-07-06 19:07:02 +02:00
Max Kellermann e1ee8e7812 util/FormatString: remove obsolete Windows fallback
Since 7d353bbe2a, _GNU_SOURCE is always
defined, which implies __USE_MINGW_ANSI_STDIO and thus switches to
the mingw implementations of the printf() family.  That's
standards-compliant, unlike Microsoft's CRT implementations.
2018-07-06 19:04:33 +02:00
Max Kellermann ae8a2ab652 util/SparseBuffer: new utility class 2018-06-22 22:18:26 +02:00
Max Kellermann eeb00ac45b util/TemplateString: new utility library 2018-06-03 12:13:47 +02:00
Max Kellermann 65bbb0e0aa Merge tag 'v0.20.17'
release v0.20.17
2018-02-11 13:22:43 +01:00
Max Kellermann 0f8d223c7f protocol/ArgParser: move strtof()/strtod() switch to util/NumberParser.hxx 2018-02-09 22:54:22 +01:00
Max Kellermann 97f670658f util/StringFormat: new utility library 2018-01-24 13:28:28 +01:00
Max Kellermann be137a191e util/FormatString: remove obsolete Windows fallback
Since 7d353bbe2a, _GNU_SOURCE is always
defined, which implies __USE_MINGW_ANSI_STDIO and thus switches to
the mingw implementations of the printf() family.  That's
standards-compliant, unlike Microsoft's CRT implementations.
2018-01-24 13:22:43 +01:00
Max Kellermann fe1f3df36e util/StringBuffer: add "noexcept" 2018-01-24 12:52:05 +01:00
Max Kellermann 3ca80a7336 util/RefCount, db/simple/Mount: remove obsolete libc++ workarounds
No longer a problem with NDK r16.
2018-01-19 23:19:46 +01:00
Max Kellermann 3e2e0d062b util/OptionParser: support option values 2018-01-17 11:14:57 +01:00
Max Kellermann c45fe3517c util/OptionParser: add struct Result
Prepare for option values.
2018-01-17 11:08:05 +01:00
Max Kellermann 735a371249 util/OptionParser: pass array of OptionDefs to constructor 2018-01-17 10:24:06 +01:00
Max Kellermann 5ab086e337 util/OptionParser: loop in ParseNext() until a new option is found 2018-01-16 11:25:18 +01:00
Max Kellermann 68f660dbcc util/OptionParser: collect remaining arguments
Allow the caller to use a simple "for" loop without checking
arguments.
2018-01-16 11:08:23 +01:00
Max Kellermann 0066f7a818 util/{Const,Writable}Buffer: add constructor with two pointers 2018-01-16 11:06:33 +01:00
Max Kellermann 65059f2add util/{Const,Writable}Buffer: eliminate static method Null(), use nullptr cast instead 2018-01-16 11:04:51 +01:00
Max Kellermann 23dff4f209 util/OptionParser: use ConstBuffer<const char*> to store argv/argc 2018-01-16 10:22:06 +01:00
Max Kellermann 4a304bf34e util/OptionParser: make string pointers "const" 2018-01-16 10:20:53 +01:00
Max Kellermann 36a6405e8b util/OptionParser: add "constexpr" 2018-01-16 10:20:52 +01:00
Max Kellermann 42c1fe963b util/OptionParser: add "noexcept" 2018-01-16 10:13:39 +01:00
Max Kellermann 465b154fc0 util/OptionParser: use C++11 initializers 2018-01-16 10:12:48 +01:00
Max Kellermann a0c4102b5a util/OptionDef: add "constexpr" 2018-01-16 10:11:35 +01:00
Max Kellermann 90cc32f6f8 util/RefCount: remove obsolete class 2017-12-22 16:37:30 +01:00
Max Kellermann 300a619991 Merge branch 'v0.20.x' 2017-12-22 16:10:05 +01:00
Max Kellermann 412c0a965c util/WStringAPI: fix indent 2017-12-21 18:45:26 +01:00
Ilya ilyxa Tyshchenko 2becf79223 correct action for compile on Solaris 11.3 X86 2017-12-21 18:42:36 +01:00
Max Kellermann 1d559bf00c util/SliceBuffer: add "noexcept" 2017-12-20 14:41:03 +01:00
Max Kellermann 3d960b5e55 util/RuntimeError: add FormatInvalidArgument() 2017-12-19 11:56:29 +01:00
Max Kellermann edee8a3446 Compiler.h: add gcc_returns_nonnull, gcc_returns_twice 2017-12-18 23:00:13 +01:00
Max Kellermann 6246d36fe6 Merge branch 'v0.20.x' 2017-12-16 20:56:06 +01:00
Max Kellermann dfaf08743c *: check defined(_WIN32) instead of defined(WIN32)
Only _WIN32 is defined by the compiler, and WIN32 is not standardized
and may be missing.

Closes #169
2017-12-12 10:22:20 +01:00
Max Kellermann 2670e13cbd util/{Const,Writable}Buffer: add static_assert to FromVoid() 2017-11-10 19:43:17 +01:00
Max Kellermann 49784513b1 util/{Const,Writable}Buffer, ...: rename IsEmpty() to empty(), imitating STL 2017-11-10 19:24:33 +01:00