Max Kellermann
ca726a0110
util/StringBuffer: make capacity() static
...
This allows using it in constant expressions.
2021-04-06 13:46:07 +02:00
Max Kellermann
e01710cbd1
util/DereferenceIterator: simplify operator->()
...
This makes it compatible with containers storing std::unique_ptr.
2021-04-06 13:45:32 +02:00
Max Kellermann
c87a4a7d08
util/DereferenceIterator: fix static_cast in operator->()
2021-04-06 13:45:10 +02:00
Max Kellermann
dc9103befe
util/AllocatedString: remove Null(), IsNull()
2021-03-04 18:05:29 +01:00
Max Kellermann
67760f5283
util/AllocatedString: support casting a nulled instance to string_view
2021-03-04 18:05:29 +01:00
Max Kellermann
99405a4c93
util/AllocatedString: add operator=()
2021-03-04 18:05:26 +01:00
Max Kellermann
b833c5d2c7
util/AllocatedString: replace Clone() with copy constructor
2021-03-04 18:04:21 +01:00
Max Kellermann
bca5d79f88
util/AllocatedString: add const_pointer constructor
2021-03-04 18:04:17 +01:00
Max Kellermann
6e1c8edf09
util/AllocatedString: add string_view constructor
...
Replaces the static Duplicate() method.
2021-03-04 18:04:11 +01:00
Max Kellermann
32b7b2e2fa
util/AllocatedString: add default constructor
2021-03-04 18:04:06 +01:00
Max Kellermann
cfb7f8ab84
util/AllocatedString: rename to BasicAllocatedString
...
To make things simpler, AllocatedString is now a non-template class.
2021-03-04 18:03:56 +01:00
Max Kellermann
a6eb264770
util/IntrusiveList: add type alias "Hook"
...
By casting to SafeLinkIntrusiveListHook if appropriate, this fixes a
bug in the erase() method, where erase() calls
IntrusiveListHook::unlink() instead of
SafeLinkIntrusiveListHook::unlink().
2021-03-02 17:51:50 +01:00
Max Kellermann
0091c4e12b
util/Exception: add FindNested()
2021-03-02 17:13:29 +01:00
Max Kellermann
80172e17ac
util/Exception: remove redundant std::exception catch clause
...
The "std::nested_exception" catch block already covers this perfectly.
2021-03-02 17:13:21 +01:00
Max Kellermann
ec0c1f0d02
util/Exception: fix comment typo
2021-03-02 17:12:20 +01:00
Max Kellermann
946b3c1f80
util/IntrusiveList: add method erase_and_dispose()
2021-02-25 14:12:47 +01:00
Max Kellermann
a0dc398f36
util/IntrusiveList: erase() returns an iterator
2021-02-25 14:12:39 +01:00
Max Kellermann
b54d2d984a
util/IntrusiveList: use ToHook() in erase()
2021-02-25 14:12:10 +01:00
Max Kellermann
4ab73f9de9
util/IntrusiveList: add missing ToNode() cast in iterator_to()
2021-02-25 14:10:55 +01:00
Max Kellermann
1048f23680
util/IntrusiveList: add hook class SafeLinkIntrusiveListHook
...
Similar to boost::intrusive::safe_link.
2021-02-24 20:29:16 +01:00
Max Kellermann
8fe8f09027
util/IntrusiveList: add `noexcept`
2021-02-24 20:17:28 +01:00
Max Kellermann
78670c0941
util/IntrusiveList: add `constexpr`
2021-02-24 20:16:54 +01:00
Max Kellermann
75e8795e3f
util/IntrusiveList: add method insert()
2021-02-22 23:32:51 +01:00
Max Kellermann
4912466d50
util/IntrusiveList: add method erase()
2021-02-22 23:32:47 +01:00
Max Kellermann
75c8d2235b
util/ByteOrder: add classes PackedBE16, PackedLE16, PackedLE32
2021-02-16 17:37:25 +01:00
Max Kellermann
3456b1e50d
use std::size_t
2021-02-12 18:39:28 +01:00
Max Kellermann
7fe0095fa7
util/IntrusiveList: add `noexcept` to defaulted constructor
2021-02-11 21:22:15 +01:00
Max Kellermann
f4a5d671fe
util/{Const,Writable}Buffer: include cleanup
2021-02-04 17:27:48 +01:00
Max Kellermann
04731fb7cc
util/StringPointer: add operator==(std::nullptr_t)
2021-01-21 21:08:52 +01:00
Max Kellermann
9b2eb74f95
util/AllocatedString: fix operator= parameter type
2021-01-21 20:44:07 +01:00
Max Kellermann
84084baa65
util/AllocatedString: remove wrong `std::` prefix
2021-01-21 20:16:32 +01:00
Max Kellermann
3bc45fbf68
util/AllocatedString: remove Null(), IsNull()
2021-01-21 20:12:05 +01:00
Max Kellermann
36168a24f5
util/AllocatedString: support casting a nulled instance to string_view
2021-01-21 20:06:01 +01:00
Max Kellermann
5e67443a1a
util/{Const,Writable}Buffer: always enable assertions
2021-01-21 20:04:00 +01:00
Max Kellermann
17858143b3
util/{Const,Writable}Buffer: enable `constexpr` on more methods
2021-01-21 20:03:53 +01:00
Max Kellermann
c44a7b2705
util/AllocatedArray: add operator=(nullptr)
2021-01-21 20:03:38 +01:00
Max Kellermann
0ded23591b
util/AllocatedString: add operator=()
2021-01-21 20:02:52 +01:00
Max Kellermann
c1a7aa652d
util/AllocatedString: replace Clone() with copy constructor
2021-01-21 20:02:41 +01:00
Max Kellermann
8d47f51399
util/AllocatedString: add const_pointer constructor
2021-01-21 18:06:10 +01:00
Max Kellermann
a81c9bfb81
util/AllocatedString: add string_view constructor
...
Replaces the static Duplicate() method.
2021-01-21 18:05:51 +01:00
Max Kellermann
1caf57644f
util/AllocatedString: add default constructor
2021-01-21 18:05:50 +01:00
Max Kellermann
c70b63c183
util/AllocatedString: rename to BasicAllocatedString
...
To make things simpler, AllocatedString is now a non-template class.
2021-01-21 18:04:03 +01:00
Max Kellermann
8279cafd6d
release v0.22.4
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAmAJqgAQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEg2QEACJLeN2mk2RU7Iqxbh/ekwm6aTM8D6bx8RH
Xys4l1YAFQ0cg7sKZwMqefedGJG2j8CORbihYIF6Z8EvFsAiI6I3LjElfXrmnAc0
Y9SnWHIR5vxlSQgyqPlJ0jl213uzoHHpel8PpEJbTtYONT+8f3fQEuLpO4/uWOIT
S6mlX16vI0/Ydp//8UIazUUvjar1pPvBnSEZ0JZsZl8RTYlS/4SOfqpHnhhWnWpO
9RXlLP9Zo68rJzNhUPwRj7NkyVEkg74xpjHOWoyeTMNQ6tKMQn8b4jb/LcBfj6hk
I7mof5oX0aS+GyYaehKi9c9Az7wUcBxnnaN02qlAaSutcuox7ce70fKMtiAXRN0o
T9mFSJm1JKqHZb1dFvxqSqFjVr7eO9XCxHqaEqTbXCT+CL/6AJQZi5SVcX4gCY1P
NSM3Jnydjr73WFLmEfjCkWLTdtiJhY/2Q/J6+vcILMb3W2y5FaSHZTOFbxVG4nMM
spoQ27b7PoB9MbxLR3QJkYLa0WE3FrTORYgsH8Po7ZcCU9+JvqDSBnGXxx+Yv+JJ
dKMI5bEAvPziodSHHQXgD4lhx744JuiLAJNtlSYJvev1s2Irf2TtMHdmGERHQZwH
5cr9sQLgyHCLvTBDGt1dVZq/Z0T/PCkweIa5cT6ZBAim1hs7g20g8ksyFK2ZPUbB
vEGBNcuMIg==
=CEEr
-----END PGP SIGNATURE-----
Merge tag 'v0.22.4'
release v0.22.4
2021-01-21 17:42:26 +01:00
Max Kellermann
056ab199ab
util/PeakBuffer: add method max_size()
2021-01-21 16:45:56 +01:00
Max Kellermann
eea0e084af
util/PeakBuffer: use std::byte instead of std::uint8_t
2021-01-21 16:45:31 +01:00
Max Kellermann
fa82f558be
util/PeakBuffer: add `noexcept`
2021-01-21 16:45:17 +01:00
Max Kellermann
6b555b7017
util/PeakBuffer: use std::size_t
2021-01-21 16:45:14 +01:00
Max Kellermann
dafba203e7
util/ForeignFifoBuffer: use `auto`
2021-01-21 16:38:32 +01:00
Max Kellermann
07d2bc6898
util/StringView: add method SplitLast()
2021-01-21 13:20:01 +01:00
Max Kellermann
81ea749248
Merge branch 'v0.22.x'
2021-01-05 13:11:29 +01:00
Vincent Petry
74b2fc7fdc
Use uri_has_scheme for Webdav response href
...
Use uri_has_scheme to find out if the href in Webdav responses is absolute
to use the matching base path extraction.
Signed-off-by: Vincent Petry <PVince81@yahoo.fr>
2021-01-05 12:04:08 +01:00
Max Kellermann
abbd980671
Merge branch 'v0.22.x'
2021-01-01 19:59:15 +01:00
Max Kellermann
5348f8c9c8
copyright year 2021
2021-01-01 19:54:28 +01:00
Max Kellermann
937da63ba6
util/StringView: add {Starts,Ends}With(char)
2020-12-15 17:04:39 +01:00
Max Kellermann
618f94f589
util/TemplateString: add StringView cast operator
2020-12-02 15:00:49 +01:00
Max Kellermann
ad2c22844c
util/TemplateString: add FromLiteral()
2020-12-02 15:00:39 +01:00
Max Kellermann
9420c74101
util/AllocatedArray: add nullptr constructor
2020-11-30 22:30:57 +01:00
Max Kellermann
b1bef9c21d
util/AllocatedArray: add method data()
2020-11-30 22:30:28 +01:00
Max Kellermann
5b0ef7ea98
util/AllocatedArray: add types pointer, const_pointer
2020-11-30 22:30:25 +01:00
Max Kellermann
ab53c414bc
util/StringView: add method SplitLast()
2020-11-30 22:29:38 +01:00
Max Kellermann
b47e0cffdd
util/TemplateString: rename CharAsString() to FromChar()
2020-11-30 22:23:28 +01:00
Max Kellermann
3af35aee9e
util/TemplateString: add cast operators
2020-11-30 22:22:24 +01:00
Max Kellermann
02314ac7dd
util/TemplateString: rewrite as constexpr functions
...
Hooray C++17!
2020-11-30 22:19:57 +01:00
Max Kellermann
e7c4e87ac4
util/TemplateString: remove unnecessary implementation for static variable
...
This is obsolete since C++17.
2020-11-30 22:13:13 +01:00
Max Kellermann
de58bfbb7f
util/TemplateString: use std::size_t
2020-11-30 22:13:08 +01:00
Max Kellermann
0dda4c06b1
util/TemplateString: no indent after `namespace`
2020-11-30 22:13:04 +01:00
Max Kellermann
ac4975cd7a
util/MimeType: relicense to BSD-2
2020-11-18 15:28:21 +01:00
Max Kellermann
afbcac9fb1
util/MimeType: use IterableSplitString() in ParseMimeTypeParameters()
2020-11-04 21:29:42 +01:00
Max Kellermann
bb07fd42ce
util/MimeType: migrate GetMimeTypeBase() to std::string_view
2020-11-04 21:20:03 +01:00
Max Kellermann
bab626c325
util/UriExtract: remove the query string at the beginning of uri_get_suffix()
2020-11-04 21:15:41 +01:00
Max Kellermann
2a9131498f
util/UriExtract: pass std::string_view to uri_get_suffix()
2020-11-04 21:13:57 +01:00
Max Kellermann
35a232105e
util/UriExtract: uri_get_suffix() returns std::string_view
...
No need to copy it to a buffer.
2020-11-04 21:08:26 +01:00
Max Kellermann
bb99cf37e3
release v0.22.2
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl+Zm30QHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEm0BD/0eeuI09j2LPCCQQdOUxl3ydWDLVVqDbT/b
wUYLFEIscr0Kr8k4Mcl3C5LBEeCJq4ZYQ/VqlgNVC11SXVhq7IHJALJ3rYQVIpx+
7MGfd1M0G39d9nlEFeKG2iNKx78aiBTqkMC9MtctacIOiKmntXP0cZZxpqGMMVZs
5t8l8i2CM35BWisu0PjSvPJMzGVf9lgEIqx1ejHBFrX6V6DEZ8d6KEbV9FulNo1Y
bH1UmKdsz71LC1ZE9EescmL5kVvaXyWyJmDDiu2/sqcMRjAHl2+RIAsunv6SqdGH
Sk4OZbtXB8M8EQHuSJESUS6SnQEyGdwCptBn4NHXkajzRJqKCq0FRDyQGT+qrmUr
H+91rZeWRYFbBMStP9l9MMQiTTjXgfCnHExDK9AmrMhiuYnuVxV1deEP7FXswCkd
yU3sPpcKgdzMEYzoTuzXJVyMIKr0WOmNGFMEUbxfBXZDCbT1i9SH+Bi0kQAYe9h9
JQTSWeS5NDRcI/b6nHS6ccUGFEp1scbXQNLw+17UvrUwfeZW9N9/t6jPS4kdUNEm
tnNmbM/3o7yT3B8BGKTl5qBVSjCcgqKfsBXvy9Qn2zE0TN4HQPiJSDXZEH9LuZR1
c6b8aI94gZkN4av1OAjmZgLyn+Pr2gyrei4FQNXyjNJkV5F3wiiLhhDTEMc2WLNm
Zf4qpZArww==
=eRNp
-----END PGP SIGNATURE-----
Merge tag 'v0.22.2' into master
release v0.22.2
2020-10-28 17:33:10 +01:00
Max Kellermann
6bc73a9ebe
util/FormatString: update API documentation
2020-10-28 15:48:42 +01:00
Max Kellermann
6f0ad2b6c5
util/IntrusiveList: replacement for boost::intrusive::list
2020-10-18 19:23:34 +02:00
Max Kellermann
643bf95366
util/OffsetPointer: use std::ptrdiff_t
2020-10-15 16:41:39 +02:00
Max Kellermann
36a187da39
util/Cast: include cleanup
2020-10-15 16:40:26 +02:00
Max Kellermann
fec80f2835
util/Cast: use std::ptrdiff_t
2020-10-15 16:40:18 +02:00
Max Kellermann
bb20af8f20
util/StringStrip: use std::strlen()
2020-10-15 12:54:47 +02:00
Max Kellermann
9355ec44e0
util/StringStrip: use std::size_t
2020-10-15 12:53:02 +02:00
Max Kellermann
c63bd323ce
util/StringCompare: use std::memcmp()
2020-10-15 12:48:33 +02:00
Max Kellermann
7c8427b0f7
Merge branch 'v0.21.x' into master
2020-09-21 11:37:50 +02:00
Max Kellermann
b72801abf3
util/ByteOrder: add FromLE16S()
2020-09-21 11:15:45 +02:00
Max Kellermann
540919f256
*: use nullptr instead of NULL
2020-09-07 20:08:27 +02:00
Max Kellermann
67c7116f05
Merge branch 'v0.21.x' into master
2020-09-04 18:35:21 +02:00
Max Kellermann
cbcdc73f9a
system/ByteOrder: add `noexcept`
2020-08-14 16:36:24 +02:00
Max Kellermann
155fc8fa5a
include cleanup
2020-07-23 16:26:18 +02:00
Max Kellermann
7daf80a0c0
util/RuntimeError: add IWYU pragma
2020-07-23 16:10:28 +02:00
Max Kellermann
eb87c28225
util/CharUtil: fix doc typo
2020-07-23 16:08:52 +02:00
Max Kellermann
df38e7565b
util/HugeAllocator: import std::swap()
2020-07-01 21:56:58 +02:00
Max Kellermann
cb49a03fd7
util/HugeAllocator: add `noexcept`
2020-07-01 21:56:54 +02:00
Max Kellermann
472881cb95
util/ByteOrder: remove redundant `inline` keywords from `constexpr` functions
2020-07-01 17:50:34 +02:00
Max Kellermann
c4efc37ad8
system/ByteOrder: move to util/
2020-07-01 17:49:57 +02:00
Max Kellermann
3d7147390f
Merge branch 'v0.21.x'
2020-07-01 16:56:17 +02:00
Max Kellermann
a43ee97746
util/UriUtil: strip credentials from smb:// URIs
...
Closes https://github.com/MusicPlayerDaemon/MPD/issues/910
2020-06-22 22:48:56 +02:00
Max Kellermann
43c32372e7
util/UriUtil: make `schemes` array static
2020-06-22 22:48:07 +02:00
Max Kellermann
c6a7f6dabc
release v0.21.24
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl7hRzQQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEp7dD/483fkBEyipufQyQT9nntP8R/vqKlUT+M9V
8LyoJBtNtbNkO4bdrgAQCzElYzkDnd8VR++ZDEcqSEF49y5wafsiuufJNW2/s02Y
ygAqgTCpcuS58F7aK92CW99bhZcKC6zoQovkenSMaZ39gorE1ZuO1JyrFR1LWOat
ELekougQe0JbX2YX0YOH0Qags5fv9joxYJYsx8ZC60sCRNc+h8CBQjpyhZqzk7wC
EPviLeMDw5lXkoSI3C045QmwJRFG8GMEyZ/4E/mnibxoTXBJmsm4ArKrfJznrUUs
r8Mkf4G7sVqbsRMyMFBpzw+lsRDpVWI26mhdah9Y1zuUYPaEMe7OVKuEsASJQ/oK
33wRSBVZc7EPhV3m8f7U8NAJI0/XaaPKGgP2OrtnOfxD+OyAze4vNLZ/GJCYSsh+
wN1grmJw1mTP52xBicN2AITqXSVVpuvznn+p0g9MBB9Nw8/vbeWaqGPQhMHGHW6a
JIL9yUTWwhkvkhav1bT7zKaeZv3qfgO7fjkgJqQFYt/q4FZwPFHJme55mVGq9d1y
FNR8BMh+0A8hRhhQVwVycLxr4+NJja3vaqx+uVG2kov1g3eQBSgnEYCiEV7uls4V
Pr4sIEeU/QQ+0jsMoJCaW65bNm4tOGKibpjSHrwJ+gxwKn3N7sJaAOo7PgGsUZyS
30cBC5zkjw==
=XHev
-----END PGP SIGNATURE-----
Merge tag 'v0.21.24'
release v0.21.24
2020-06-10 22:58:41 +02:00
Max Kellermann
14412c867f
add a few IWYU pragmas
2020-06-10 21:10:33 +02:00
Rosen Penev
e4dad42ca1
use std chr functions
...
The ones in std have overloads for const char/char.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-30 13:36:53 +02:00
Rosen Penev
1008d5f67c
use cwchar include
...
Needed for std::wmemchr under libcxx
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-30 13:22:04 +02:00
Max Kellermann
bdc861f058
util/TemplateString: remove extra semicolon
2020-05-27 15:46:55 +02:00
Max Kellermann
be94b4373a
util/OffsetPointer: add `noexcept`
2020-05-14 15:44:23 +02:00
Max Kellermann
60f957ed64
util/MimeType: use string_view::substr()
...
Fixes regression from commit db93bb996c
because
ParseMimeTypeParameters() assumed the items were null-terminated, but
after that commit, they were not anymore.
2020-05-06 20:33:13 +02:00
Max Kellermann
ba576ffa37
Merge branch 'v0.21.x'
2020-05-05 19:00:53 +02:00
Rosen Penev
47a7707df1
Math.hxx: fix wrong macro name
...
_GLIBCXX_USE_C99_MATH_TR1 is the correct one.
_GLIBCXX_USE_C99_MATH is always defined.
2020-04-29 23:20:04 +02:00
Max Kellermann
814b2a218d
util/CharUtil: add IsNonPrintableASCII()
...
Prepare to fix cc72ceb368
2020-04-27 14:01:54 +02:00
Max Kellermann
18ca734819
util/DereferenceIterator: new utility class
2020-04-24 16:02:31 +02:00
Rosen Penev
6080c3b4ba
Math.hxx: move cmath include out of define
...
The _GLIBCXX_USE_C99_MATH macro is defined in glibcxx by c++config.h, which
gets included by every header. Which means a header needs to be present.
(cherry picked from commit 79e9aff338
)
2020-04-09 14:24:06 -07:00
Max Kellermann
db93bb996c
util/SplitString: convert return value to std::string_view
...
Eliminates lots of overhead.
2020-04-08 23:14:25 +02:00
Rosen Penev
79e9aff338
Math.hxx: move cmath include out of define
...
The _GLIBCXX_USE_C99_MATH macro is defined in glibcxx by c++config.h, which
gets included by every header. Which means a header needs to be present.
2020-04-07 20:14:00 -07:00
Max Kellermann
3a51fe31df
util/ConstBuffer, ...: use `using` instead of `typedef`
2020-04-06 15:19:12 +02:00
Max Kellermann
cc3e71d8c7
util/CharUtil: add IsHexDigit()
2020-04-06 15:07:08 +02:00
Max Kellermann
870151214d
util/SplitString: convert parameter to std::string_view
2020-04-03 16:47:45 +02:00
Max Kellermann
915c48f748
util/AllocatedString: std::string_view support
2020-04-03 16:08:55 +02:00
Max Kellermann
f04a245769
util/AllocatedString: add `noexcept`
2020-04-03 15:26:47 +02:00
Max Kellermann
a8687fb7df
util/AllocatedString: use `using` instead of `typedef`
2020-04-03 15:25:37 +02:00
Max Kellermann
3b88bac07c
util/StringPointer: add `noexcept`
2020-04-03 15:25:33 +02:00
Max Kellermann
358f231391
util/StringPointer: use `using` instead of `typedef`
2020-04-03 15:25:16 +02:00
Max Kellermann
7d7bd51bc0
util/AllocatedArray: use `using` instead of `typedef`
2020-04-01 15:42:55 +02:00
Rosen Penev
3540cf26b1
replace exit and _exit with std variants
...
_exit and std::_Exit are identical, expect the latter is standard C++.
Added several functions to the std namespace as a result of headers.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-26 18:44:09 -07:00
Max Kellermann
e1c43ec65f
Merge branch 'ucl' of git://github.com/neheb/MPD into v0.21.x
2020-03-26 17:28:21 +01:00
Rosen Penev
608d7ec1e7
[clang-tidy] change integer prefixes to uppercase
...
Found with readability-uppercase-literal-suffix
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-26 17:25:20 +01:00
Rosen Penev
85c27840a3
treewide: use boost::lround when std::round is unavailable
...
This is the case with uClibc-ng currently.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 769cd0ee9f0cf8ceb026aa751b5d4a390bb5dbdc)
(changed define to match master)
2020-03-25 18:54:15 -07:00
Rosen Penev
cfa4524cb3
util/Math: change define
...
This has nothing to do with uClibc. It has everything to do with gcc's
libstdc++.
C99 math can be compile time disabled for it. Check for that and use boost
lround when std is not available.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-25 19:27:45 +01:00
Rosen Penev
4fd0c84f46
replace lrint with lround
...
lrint is a configurable version of lround that behaves either as round,
floor, ceil, or trunc based on setting the proper FE_ macro using
fset/getround. Given that it's not set at all and that it defaults to
round behavior, simply replace with round.
Also removed the util/Math defines.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-25 19:27:44 +01:00
Rosen Penev
9bad5ee3c5
remove boost pow stuff for uClibc-ng
...
It's available there.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-24 17:21:21 -07:00
Max Kellermann
637840264a
util/WStringCompare: reorder functions to relocate API docs
2020-03-22 19:20:29 +01:00
Max Kellermann
3888bafc1f
util/StringCompare: add API documentation
2020-03-22 19:15:55 +01:00
Max Kellermann
adad4c7298
util/StringCompare: add missing include
2020-03-22 19:12:02 +01:00
Max Kellermann
1ec283d213
util/Exception: include cleanup
2020-03-19 20:13:04 +01:00
Max Kellermann
fd71514068
Merge remote-tracking branch 'neheb/h'
2020-03-16 17:29:05 +01:00
Rosen Penev
97425d56e7
remove gcc_unused
...
[[maybe_unused]] (introduced in C++17) is standard C++.
https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused
says that this is equivalent to the GNU unused attribute.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:21 -07:00
Rosen Penev
0afb156a5b
remove gcc_warn_unused
...
[[nodiscard] (introduced in C++17) can be used instead.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:21 -07:00
Rosen Penev
a192e7b29b
remove gcc_deprecated
...
[[deprecated]] (introduced in C++14) may be used instead.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:21 -07:00
Rosen Penev
591f51f3d3
replace noreturn attribute with standard C++ version
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:18 -07:00
Rosen Penev
177371a003
treewide: get rid of C math function usage
...
Boost does not seem to offer an overload for lrint.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-15 20:22:07 -07:00
Rosen Penev
3ec9fcfc44
treewide: use boost::lround when std::round is unavailable
...
This is the case with uClibc-ng currently.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-15 20:17:31 -07:00
Max Kellermann
b5d1a09010
util/StringUtil: pass std::string_view to StringArrayContainsCase()
2020-03-13 20:38:40 +01:00
Max Kellermann
85b072b3d3
util/StringCompare: add StringIsEqual() with string_view
2020-03-13 20:36:48 +01:00
Max Kellermann
8a1f1fbe06
util/ASCII: migrate to std::string_view
2020-03-13 20:17:53 +01:00
Max Kellermann
3796247d6d
util/Stringview: use `const_pointer` instead of hard-coding `const char *`
...
Fixes Windows build failure.
2020-03-13 19:43:23 +01:00
Max Kellermann
332f480ec3
util/UriExtract: uri_get_path() returns std::string_view
2020-03-13 18:54:41 +01:00
Max Kellermann
9a164668f2
util/UriExtract: migrate uri_get_scheme() to std::string_view
2020-03-13 18:51:11 +01:00
Max Kellermann
6876d160cf
util/StringCompare: add more StringView overloads
2020-03-13 18:49:47 +01:00
Max Kellermann
a63d0ee8fc
util/StringView: add method substr()
2020-03-13 18:48:40 +01:00
Rosen Penev
a2f5a63bbc
replace stdint.h with cstdint
...
The former is deprecated by C++14. The standard says they are the same:
The header defines all types and macros the same as the C standard library
header<stdint.h>.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:39 -07:00
Rosen Penev
2db8bcc353
replace stddef.h with cstddef
...
The former is deprecated with C++14. The standard says both are the same:
The contents and meaning of the header<cstddef>are the same as the C
standard library header<stddef.h>,except that it does not declare the type
wchar_t, that it also declares the type byte and its associated
operations (21.2.5), and as noted in 21.2.3 and 21.2.4.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:38 -07:00
Rosen Penev
c846ee0d1b
replace stdarg.h with cstdarg
...
The former was deprecated in C++14. The Standard says they are the same:
The contents of the header<cstdarg>are the same as the C standard library
header<stdarg.h>, with the following changes: The restrictions that ISO C
places on the second parameter to the va_start macro in header<stdarg.h>
are different in this International Standard. The parameter parmN is the
rightmost parameter in the variable parameter list of the function
definition (the one just before the...).219If the parameter parmN is a
pack expansion (17.5.3) or an entity resulting from a lambda capture
(8.1.5), the program is ill-formed, no diagnostic required. If the
parameter parmN is of a reference type, or of a type that is not
compatible with the type that results when passing an argument for which
there is no parameter, the behavior is undefined.
Also changed va_list to the std:: namespace version, which is the same.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:03:12 -07:00
Rosen Penev
ab9f5d2067
replace assert.h with cassert
...
The former was deprecated with C++14.
According to the C++11 and C++17 standards, both files are identical.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:25:38 -07:00
Max Kellermann
2d3b51665e
util/BitReverse: generate table with constexpr function
...
Get rid of the macro hell.
2020-02-05 19:51:46 +01:00
Max Kellermann
7b03f55cb4
util/bit_reverse: convert to C++
2020-02-05 19:49:18 +01:00
Rosen Penev
a3963de668
[clang-tidy] change integer prefixes to uppercase
...
Found with readability-uppercase-literal-suffix
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-04 15:20:50 -08:00
Max Kellermann
4f22f4d357
*: use nullptr instead of NULL
2020-02-01 14:02:43 +01:00
Max Kellermann
0896f44455
util/Domain: add `noexcept`
2020-02-01 13:25:57 +01:00
Max Kellermann
620872390b
util/Exception: move the forwarded std::exception_ptr
2020-02-01 13:13:08 +01:00
Max Kellermann
36cad54ccd
util/TemplateString: remove stray semicolon
2020-02-01 11:46:06 +01:00
Max Kellermann
2817bf9e95
copyright year 2020
2020-01-18 19:23:49 +01:00
Max Kellermann
7e80c62c7c
util/GenerateArray: use double curly braces for compatibility
2020-01-14 23:16:46 +01:00
Max Kellermann
8aaf39efd6
util/GenerateArray: new utility library
2020-01-14 22:11:12 +01:00
Max Kellermann
b11c5f8d30
util/{Const,Writable}Buffer: drop more "_type" suffixes from type names
2020-01-12 14:39:54 +01:00
Max Kellermann
4937d77cb6
util/{Const,Writable}Buffer: drop "_type" from type names
...
Behave like STL.
2020-01-03 15:55:06 +01:00
Max Kellermann
53f8053188
util/StringView: use `using` instead of `typedef`
2020-01-03 15:55:05 +01:00
Max Kellermann
e654c6e005
util/{Const,Writable}Buffer: use std::size_t
2020-01-03 15:55:05 +01:00
Max Kellermann
4b0e288f00
util/{Const,Writable}Buffer: add `noexcept`
2020-01-03 15:55:05 +01:00
Max Kellermann
71ace2fbac
util/AllocatedString: use std::exchange()
2020-01-03 15:54:51 +01:00
Max Kellermann
84784badce
Merge branch 'v0.21.x'
2020-01-03 15:31:18 +01:00
Jacob Vosmaer
dca0519336
Clang: only use [[fallthrough]] in C++ files
...
It appears that [[fallthrough]] is valid in C++ but not in C. And
in some Clang versions (e.g. Clang 11 on macOS), Clang is pedantic
about this and considers it an error to use [[fallthrough]] in a
.c file such as src/util/format.c.
This changes makes gcc_fallthrough a no-op under Clang in C files.
2019-12-31 13:54:09 +01:00
Max Kellermann
803a48e96d
release v0.21.18
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl4CKwwQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEp46D/9q1pRkhYzCyZPQGX967UPoV+Bc1YMX4o2U
Uh/HqQrKKRAK9goaxu9yMKBIFCbzj6WEZou+/uMEf6ZwXuRcnJMobrUU4+G9Yu3r
FzlQPW870DyOhk2PWHF8CW3oMt/YH05b6nYNo2ocRnX69/oqL1G7ukbF2Pz3TPc0
0uNQYYERdMawNCEi1OarzziR6DKuiN+MtZRgUQVacAsoUirwWGNJuaGSDtc3MMM7
YhgKVmd9XsgVr7fykArj6PLsm2iyXJP5nDB/tIqmwMpQFyhuLUnGOMfhCq02em+r
47LGvmZiSS/9F2JzPU8EL2yzYdBe4QvU6Ol5SfXbom11MZc3Ty502g2jUXVHjCeo
1FljCPHbarTmKhvUc0xQXA9i6exZ0wwtxL+Zv7ZQKquRPAhq8E07qkQpdaTWa6vn
3RfilLE1B/GCgoT6D1+zABxdJ1HRLT7tzFob2kkCccxguK3j2JjCUIkSgM6IY0yv
a6sMEXbqa+Lh8jggs9ksoT6O+T2HHEr3tEfpFHY+t0NFRfwHd9aX9bNjK+Ji0n51
YBf2FCb2EBrMAWNZmEnq+TuKX0HASDtoAXTviRKqBXtEG5V8MdAt4PPICCb+bkDr
psIuYcGeK3vofvq1SwEC7h7gCvsBK5w17/oE2/jYcZLo12H1IdHe5gMP3OUhjel5
BRi6rLlkYw==
=XXXs
-----END PGP SIGNATURE-----
Merge tag 'v0.21.18'
release v0.21.18
2019-12-24 16:31:06 +01:00
Max Kellermann
7770298a65
util/Compiler.h: use `[[fallthrough]]` on clang
...
Older clang versions don't support the GCC __attribute__ syntax. For
those, don't use anything at all, and new clang versions shall use the
standard syntax.
2019-12-24 08:04:48 +01:00
Max Kellermann
a1afe9afc6
util/Compiler.h: add gcc_fallthrough
...
Works around build failures with ccache which may feed processed code
to GCC, which doesn't have the "fall through" code comments.
2019-12-23 17:53:57 +01:00
Max Kellermann
bd4df1ae5d
util/AllocatedArray: add WritableBuffer/ConstBuffer cast operators
2019-12-17 20:18:54 +01:00
Max Kellermann
a93b7172aa
util/AllocatedArray: add ConstBuffer copy constructor
2019-12-17 20:18:49 +01:00
Max Kellermann
908b6a1939
util/AllocatedArray: use WritableBuffer::operator[]
2019-12-17 20:18:45 +01:00
Max Kellermann
561ccf600f
util/AllocatedArray: remove bogus assertions
...
`new T[0]` must not be nullptr.
2019-12-17 20:18:39 +01:00
Max Kellermann
aee861c009
util/AllocatedArray: copy constructor copies "nulled" state
2019-12-17 20:18:34 +01:00
Max Kellermann
2cc1dd28cd
util/AllocatedArray: add capacity()
...
For STL completeness.
2019-12-17 20:18:24 +01:00
Max Kellermann
f8d7bc1c34
util/AllocatedArray: use std::exchange()
2019-12-17 20:18:14 +01:00
Max Kellermann
683d5848f4
release v0.21.17
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl34Bg0QHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEmOvD/4/gBb1kIOQduz+ZV79LHPGeqDoIJBm8VWg
t9R1Mpt0flqC8+RcXFK/P0kUifBO5fu+a1DbHHijUvDNLYpUsCiXyxTpES9gGh54
7djEeqi1suoLpMUt4zkUEHGTp2dGUTmyewE1TuF1sZi2xlPgOeWXEX7a0xWs4zdG
WI4CojUSkQGVAI2XZ7xIKP1v368B9F6AbqTK4zkzjNbTCv5VfESGlxdde0NXqU2e
/bjil1aT2kdcks3ddeT4llyGIUzn1PzOyA6LQvmVXLSAtz9Rr/hHA+qkR19a4CCt
PXxE0xClhhmZglzPuES0sRqBbwG99dPzA1ajTOtielwMrlFx+OceRfUnfdgqpPqd
HTkEzMGsQ2PMMbE8R9DF5GU8B9xAcnKMh2g3/9KGStbocGSFWahLRObkHEhC5uJu
g5ncQio3o/AtlBirywn/lkd6CYRDvMheMVOTHtv4/ZN0hIONMXCb6u1SQfqnX7qb
fRP2UP9VUpPI9MUfOn/0uqM8/zXb5SMRe78p9UIYCF+mEDST190VxsdMjiBp/Xug
Pktlec72iyiNHCavp04nXkt2kBrfSIFFaAQ0Qlp4huRV1k3Ur672NHtwuPLv8ORH
xLec8On6nWVuuu5kC0F+4KxTlu6u2CMwH+wVr7t/D4rrD1iVo39MtElTBawZZC6+
8EapnNHyGg==
=A+Dp
-----END PGP SIGNATURE-----
Merge tag 'v0.21.17'
release v0.21.17
2019-12-16 23:44:20 +01:00
Max Kellermann
e9af692973
util/Time*: move to time/
2019-12-16 23:02:14 +01:00
Max Kellermann
2e8f42c6ad
util/StringBuffer: use std::size_t instead of size_t
2019-12-16 22:51:23 +01:00
Max Kellermann
2c276770f0
util/PrintException, ...: update copyright
2019-12-04 12:33:36 +01:00
Max Kellermann
b2c4a5db14
util/UTF8: use `uint8_t` instead of `unsigned char`
2019-10-14 13:44:11 +02:00
Max Kellermann
cadfccfd0c
util/UTF8: add `noexcept`
2019-10-14 13:41:06 +02:00
Max Kellermann
c9590db188
util/StringView: enable string_view support only on C++17
2019-09-25 21:34:48 +02:00
Max Kellermann
9caf90f74f
util/UriRelative: add uri_apply_relative()
2019-09-08 00:07:37 +02:00
Max Kellermann
71448e645c
util/UriExtract: use uri_get_scheme() in uri_has_scheme()
2019-09-08 00:06:52 +02:00
Max Kellermann
0509472636
util/UriExtract: add uri_is_relative_path()
2019-09-08 00:04:49 +02:00
Max Kellermann
0b956cf968
util/StringAPI: add memrchr() wrapper
2019-09-07 23:59:59 +02:00
Max Kellermann
58363cf4dd
util/UriRelative: allow "parent" to end with slash
2019-09-07 23:27:24 +02:00
Max Kellermann
2574615fa3
util/UriRelative: use StringAfterPrefix() instead of memcmp()
...
memcmp() can overrun the buffer.
2019-09-07 23:24:41 +02:00
Max Kellermann
15fbd2b4ab
util/UriRelative: use StringIsEqual()
2019-09-07 23:22:16 +02:00
Max Kellermann
e7c5a59e39
util/Exception: support "const char *"
2019-08-26 20:24:22 +02:00
Max Kellermann
a478af6759
util/PrintException, ...: update copyright
2019-08-19 19:11:59 +02:00
Max Kellermann
e98ce710b8
util/WStringAPI: add wcsncmp() wrapper
2019-08-16 14:48:54 +02:00
Max Kellermann
79d1004544
util/StringView: add method Compare()
2019-08-16 13:32:00 +02:00
Max Kellermann
bb7f7bd3e5
util/StringAPI: add strncmp() wrapper
2019-08-16 13:31:58 +02:00
Max Kellermann
ad2b858933
util/ForeignFifoBuffer: add friend function swap()
2019-08-16 13:27:22 +02:00
Max Kellermann
d7aa4fa7d3
util/ForeignFifoBuffer: make Swap() lower case
2019-08-16 13:27:22 +02:00
Max Kellermann
57c5603122
util/ForeignFifoBuffer: import std::swap()
2019-08-16 13:27:22 +02:00
Max Kellermann
1550113506
util/DynamicFifoBuffer: add nullptr constructor overload
2019-08-16 13:21:28 +02:00
Max Kellermann
a82d61a5e4
util/DynamicFifoBuffer: add API documentation
2019-08-16 13:21:11 +02:00
Max Kellermann
0c4a7c8004
util/AllocatedString: update copyright
2019-08-16 13:20:23 +02:00
Max Kellermann
674ee9d19a
util/Exception: forward the exception in ThrowException()
...
Fixes -Wreturn-std-move (clang 8).
2019-08-16 13:19:34 +02:00
Max Kellermann
3344953db8
util/*FifoBuffer: use `using` instead of `typedef`
2019-08-16 13:16:45 +02:00
Max Kellermann
f909615b14
include cleanups (powered by iwyu)
2019-08-15 17:57:20 +02:00
Max Kellermann
0f1e13d9ff
util/StringView: add StartsWithIgnoreCase(), EndsWithIgnoreCase()
2019-08-14 11:36:21 +02:00
Max Kellermann
a189a9e478
util/TransformN: new library
2019-08-10 11:59:47 +02:00
Max Kellermann
7654038d65
util/UriQueryParser: new library
2019-08-09 20:39:34 +02:00
Max Kellermann
e4612ecb66
util/UriExtract: add uri_get_fragment()
2019-08-09 20:39:23 +02:00
Max Kellermann
9c6850210d
util/UriExtract: uri_get_scheme() returns StringView
...
Reduce overhead by not duplicating the string.
2019-08-09 20:21:37 +02:00
Max Kellermann
40a2880857
util/UriUtil: split
2019-08-09 20:21:12 +02:00
Max Kellermann
ade712d711
util/UriUtil: relicense as BSD-2
2019-08-09 20:16:02 +02:00
Max Kellermann
91fb91d89c
util/StringView: prepare the transition to std::string_view
...
Unfortunately, we need to disable this for GCC versions older than 7,
because it doesn't have <string_view> yet.
2019-08-05 10:23:05 +02:00
Max Kellermann
cde6c46d2f
util/Macros: replace with std::size() (C++17)
2019-08-03 13:10:49 +02:00
Max Kellermann
8f981845dc
switch to C++17
...
Time to move on, two years after 2017.
2019-08-03 12:57:56 +02:00
Max Kellermann
a90685d6cf
release v0.21.12
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl1FZnQQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEjrXD/0QChgJtx6sVPRpMK7KszwgpmxNkhDPA13l
puuYTg0eEZe9EJxNM82ouCNn2kOx9OjP5DKyeus0Dt4Pk5Cwj8HGeHqjTahtwHtD
jbVy5kiEZ57NjBoLFoQBI6vMuzcz/DKStq2HmPJ62NQCIqbiTQXPpWvDYAieTFV+
lbM7vc7VQ6A3bhms//vYMZYmQV7T4Eam3iEVxoQhX4Pd+wWXv+XcTfdI2UTUFWIY
mt7+AZlG2ynev+zszUtDLB4aFEbRcLUBlSKuPv3j5ox7BjleLJXltpVbisI+TDHL
nAyb2LtOTeVPpAaqiPeCju2ucWaUOsFkHmSCjPu8BHc8b4mLATiozv2BzY1qe5rX
G7DZxCLq3IBtY4u4FpR4kOuVcjTGFKCToHGl8N6GrPmfa3n+MqPLAqKx32tSq+r/
po2kbB9t0IXXT1njGWLb9W6y7z/7dsvy3YgjV6L7SfY/SA9MZELx+MBED2GSDYr9
eWLK7LDO5soBUZvnDVJZO/a1oP0n5WiSV9n2/YGgRJXcljW8tJ8C76yMNziPK7yn
Fjmc12o6kf5Afo3dNsLAdXH4p/8LeYK9IcJZmGfwBCccMHlnX+ySLfBOyuyUDD7g
nOV/o7av/HZzirQ9h2CGUZhBPbPARjvMI+mhDVGxUx3OYxW9UfokmMVEs4h21f0R
4XRbOUejVA==
=hzQJ
-----END PGP SIGNATURE-----
Merge tag 'v0.21.12'
release v0.21.12
2019-08-03 12:53:23 +02:00
Max Kellermann
52bee8f81f
util/StaticFifoBuffer: add GetAvailable()
2019-08-02 22:49:55 +02:00
Max Kellermann
adc25e648f
util/StaticFifoBuffer: add `constexpr`
2019-08-02 22:49:33 +02:00
Max Kellermann
31da8eac9b
util/StaticFifoBuffer: add `noexcept`
2019-08-02 22:49:05 +02:00
Max Kellermann
e00464435b
util/Compiler.h: move compiler version checks to meson.build
2019-08-02 15:53:16 +02:00
Max Kellermann
9d3d4fc734
util/CharUtil: add `noexcept`
2019-07-05 18:05:04 +02:00
Max Kellermann
d6660bad03
util/WCharUtil: remove redundant `inline` keywords from `constexpr` functions
2019-07-05 18:03:42 +02:00
Max Kellermann
d663f81420
include cleanups (powered by iwyu)
2019-07-05 09:59:58 +02:00
Max Kellermann
33f5e03e80
Merge branch 'v0.21.x'
2019-06-17 22:06:54 +02:00
Max Kellermann
a139279575
Copyright year 2019
2019-06-17 11:17:30 +02:00
Max Kellermann
1eae9339f2
db/Interface: CollectUniqueTags() allows multiple "groups"
...
Instead of passing tag and group, pass an array of tags. To support a
nested return value, return a nested std::map of std::maps. Each key
specifies the tag value, and each value may be another nesting level.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/408
2019-06-16 10:39:29 +02:00
Max Kellermann
1a7e3bb358
util/StringUtil: add StringArrayContainsCase() overload with StringView
2019-06-11 19:29:40 +02:00
Max Kellermann
72a0aeb265
util/NumberParser: add overload with StringView
2019-06-06 13:26:30 +02:00
Max Kellermann
e556cd20f7
util/NumberParser: add `noexcept`
2019-06-06 13:26:30 +02:00
Max Kellermann
76eb550011
util/StringView: add method Split()
2019-06-06 12:54:42 +02:00
Max Kellermann
d651d1abfd
util/SparseBuffer: move #endif to the bottom
2019-05-22 10:43:07 +02:00
Max Kellermann
a48604d2e3
util/SparseBuffer: remove bogus `noexcept` from constructor
...
The HugeArray constructor can throw std::bad_alloc, and so can
SparseBuffer's constructor.
2019-05-08 22:34:33 +02:00
Max Kellermann
98e6a861ca
util/HugeAllocator: import std::swap()
2019-05-08 22:33:41 +02:00
Max Kellermann
2c6dd04d19
util/HugeAllocator: add `noexcept`
2019-05-08 22:32:50 +02:00
Max Kellermann
214ddee2f5
util/Time*: move to time/
2019-05-08 15:47:58 +02:00
Max Kellermann
af9840daf7
util/Clamp: remove redundant `inline` keywords from `constexpr` functions
2019-03-12 11:54:51 +01:00
Max Kellermann
f6c0688684
util/ByteOrder: remove redundant `inline` keywords from `constexpr` functions
2019-03-08 10:23:14 +01:00
Max Kellermann
c176d94598
system/ByteOrder: move to util/
2019-03-08 10:21:10 +01:00
Max Kellermann
05aa9f72a9
util/StringView: add SkipPrefix(), RemoveSuffix()
2019-02-19 11:51:32 +01:00
Max Kellermann
5cf889b676
util/WStringView: add missing include
2019-01-22 08:38:03 +01:00
Max Kellermann
b02fee7309
util/PrintException: support "const char *"
2019-01-21 21:19:35 +01:00
Max Kellermann
424f75c9e1
util/OffsetPointer: remove redundant `inline` keywords from `constexpr` functions
2019-01-21 21:19:09 +01:00
Max Kellermann
f6e1176f97
util/CharUtil: remove redundant `inline` keywords from `constexpr` functions
2019-01-21 21:18:23 +01:00
Max Kellermann
e4700c0a27
util/Cast: remove redundant `inline` keywords from `constexpr` functions
2019-01-21 21:17:58 +01:00
Max Kellermann
7104ac963b
util/AllocatedArray: import std::swap
2018-12-28 17:18:41 +01:00
Max Kellermann
2cb36590b2
util/AllocatedArray: add `noexcept`
2018-12-28 17:17:28 +01:00
Max Kellermann
53a4de35c4
util/DynamicFifoBuffer: add `noexcept`
2018-12-28 17:06:01 +01:00
Max Kellermann
ce49d99c2f
check.h: remove obsolete header
...
Since we switched from autotools to Meson in commit
94592c1406
, we don't need to include
`config.h` early to properly enable large file support. Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.
This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann
f5c9071494
*: copyright year 2018
2018-10-31 17:54:59 +01:00
Max Kellermann
d0349880da
util/StringCompare: add StringAfterPrefixIgnoreCase()
2018-10-29 14:34:29 +01:00
Max Kellermann
94592c1406
build with Meson instead of autotools
...
So long, autotools! This is my last MPD related project to migrate
away from it. It has its strengths, but also very obvious weaknesses
and weirdnesses. Today, many of its quirks are not needed anymore,
and are cumbersome and slow. Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
Max Kellermann
608d232373
util/SliceBuffer: re-add line which got lost in the last commit
2018-09-23 19:33:34 +02:00
Max Kellermann
1702e98fdf
util/SliceBuffer: move code to DiscardMemory()
2018-09-23 19:15:28 +02:00
Max Kellermann
728e4e9a38
util/StringCompare: add StringEndsWithIgnoreCase(), StringStartsWithIgnoreCase()
2018-09-06 19:52:43 +02:00
Max Kellermann
2d6f9f9a9c
Util/WStringAPI: non-Windows implementation of _wcs*cmp()
2018-09-06 19:49:45 +02:00
Max Kellermann
c2e2e5543e
util/WStringAPI: add wcscoll() wrapper
2018-09-06 19:39:28 +02:00
Max Kellermann
349d8eb248
util/WStringCompare: add "noexcept"
2018-09-06 19:35:09 +02:00
Max Kellermann
94b96bde9b
util/WStringCompare: wcpcpy() and wcsdup() are available on Android
2018-09-06 19:33:50 +02:00
Max Kellermann
45ffc864c5
util/StringCompare: add more function attributes
2018-09-06 19:23:13 +02:00
Max Kellermann
eee91aa4ea
util/Exception: update copyright
2018-08-21 08:20:52 +02:00
Max Kellermann
855750c784
util/{Const,Writable}Buffer: add method SetEnd()
2018-08-21 08:20:17 +02:00
Max Kellermann
2156fc64f4
util/StringStrip: more API documentation
2018-08-20 16:30:46 +02:00
Max Kellermann
441440101d
util/StringStrip: add more "nonnull" attributes
2018-08-20 16:28:43 +02:00
Max Kellermann
ec54754e22
Compiler.h: move to util/
2018-08-20 16:19:17 +02:00
Max Kellermann
489e11072e
util/WritableBuffer: add ConstBuffer cast operator
2018-08-20 15:36:50 +02:00
Max Kellermann
5e2af15e94
util/Manual: add static method Cast()
2018-08-20 15:35:43 +02:00
Max Kellermann
3fbb54e0a4
util/IterableSplitString: use operator==(nullptr_t)
2018-08-20 15:35:09 +02:00
Max Kellermann
fe6de14faf
util/StringView: add ConstBuffer cast constructors
2018-08-20 15:34:07 +02:00
Max Kellermann
e85b9960f0
util/StringCompare: use StringAPI.hxx
2018-08-20 15:33:16 +02:00
Max Kellermann
75c836fbd9
util/StringAPI: use StringCompare() in StringIsEqual()
2018-08-20 15:31:09 +02:00
Max Kellermann
94b1025780
util/RuntimeError: fix typo
2018-08-20 15:22:24 +02:00
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
release v0.20.17
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlqAMO0QHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEg8eD/49NlFvlNdkamgYvh7MI1Sn67yKAwQt+N51
W0hVnmXwPoSg76gfWw8J9kVyQy/jEkaCxsPF/UuEbH5jzqAC0y8hwYVRkJaRc9wN
ZfwHvLHeaUxQweoguEwRSREy4ZC4ImQOK+eAxI1R43mqxxyhko1Akc1NmRVWzYfv
/FGmAjTi1U6FR/yDpdSFn1NdlPmIgZ4WDuRsDT2NrshX/Bb32FiyZBytvek2P8n/
QNgXv18E4yWXSb+zBYhPy/eaKhGasyjI3cbht1F0hNW9Yo/BsFxDuwXrX1vNBaOS
E3Dux4s/nfcJ4RMRjmrkFwXImCvxt7+AGfh8RYBXuwqMExXz2kZjIs4ZVvO7Nu9A
pFDJQwRIojXMfk73LU/MEpmNNEXhvfQLYkrM7poSqYaOr8SWMszqSgNnnfq6+flB
sJbstgAStI6lL0jy0HrtMTvPVEiAGh6wCvMy/r2G9XUAyw76ccOg7MaIldn0MHJv
A51+GfRTi4ILH0ReL1BGAg9nG97uFmRAWGkfkhtyD540xGRk7x5R8/ml4zFogHN6
SbrV0NPdwk+uFd0y2znQT2gWyjc0id4WEKEoHX+Gl6c5qtPIfrq+PQPyk9kR+u+i
AxwqMoKQer6Ji5qnsvCiKSkaGGiVNivrZ11jDWNCZaKjmvlKlvj/P5GxbPpORorq
v4ru/4vNXQ==
=v4t8
-----END PGP SIGNATURE-----
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
Max Kellermann
034bb13e1c
util/HugeAllocator: add missing "static inline"
...
Fixes the non-Linux build.
2017-10-26 09:01:06 +02:00
Max Kellermann
c8a2a557db
util/HugeAllocator: remove obsolete class HugeAllocation
2017-09-21 21:52:08 +02:00
Max Kellermann
7b2b965415
util/SliceBuffer: use class HugeArray
2017-09-21 21:48:08 +02:00
Max Kellermann
c3cfa18ebe
util/HugeAllocator: add template class HugeArray
2017-09-21 21:47:52 +02:00
Max Kellermann
b46835e15e
util/HugeAllocator: HugeAllocator() returns WritableBuffer<void>
2017-09-21 21:47:49 +02:00
Max Kellermann
3e5ce3c92c
util/{Const,Writable}Buffer: add static method FromVoidFloor()
2017-09-21 21:45:39 +02:00
Max Kellermann
e5c9b4cd75
util/{Const,Writable}Buffer: add operator==(nullptr_t)
2017-09-21 20:34:36 +02:00
Max Kellermann
8753e558f2
util/HugeAllocator: move MADV_DONTFORK setting to HugeForkCow()
...
Enforcing MADV_DONTFORK is a surprising limitation for this library
which aims to be generic.
2017-09-21 19:36:33 +02:00
Max Kellermann
56a9bf459d
util/SliceBuffer: use C++11 initializers
2017-09-19 19:48:04 +02:00
Max Kellermann
11dbba3503
util/HugeAllocator: document std::bad_alloc
2017-09-19 19:45:52 +02:00
Max Kellermann
8662427d48
util/HugeAllocator: use std::exchange()
2017-09-19 19:42:21 +02:00
Max Kellermann
821480d329
util/HugeAllocator: make constructor explicit
2017-09-19 19:42:19 +02:00
Max Kellermann
c196710fae
util/WStringCompare: relicense to BSD-2
2017-09-13 16:43:41 +02:00
Max Kellermann
e4f62483ff
util/StringView: add default constructors
...
It was implicitly deleted since commit
db23c2f27b
2017-09-13 12:59:31 +02:00
Max Kellermann
8d9347edc5
Util/WStringCompare: use struct WStringView
2017-09-13 11:47:48 +02:00
Max Kellermann
eff821c1ca
Util/StringView: move struct WStringView to separate header
2017-09-13 11:22:59 +02:00
Max Kellermann
3bcd6ecbad
util/Exception: update API documentation
2017-09-13 10:49:34 +02:00
Max Kellermann
e76f4c2ae9
util/DeleteDisposer: convert struct to class
2017-09-13 10:35:51 +02:00
Max Kellermann
f46ac45d69
util/*: update include guards
2017-09-13 10:35:11 +02:00
Max Kellermann
1d1259a86d
util/AllocatedString: add method data()
2017-09-13 10:34:12 +02:00
Max Kellermann
101f08ca75
util/Cast: make the "member" pointer const
2017-09-13 10:32:55 +02:00
Max Kellermann
3b7f9827ab
Util/IterableSplitString: add wchar_t specialization
2017-09-12 19:12:09 +02:00
Max Kellermann
f98bf39005
Util/IterableSplitString: add template class BasicIterableSplitString
2017-09-12 19:12:09 +02:00
Max Kellermann
9e7df54ccd
Util/StringView: add struct TStringView
2017-09-12 19:12:09 +02:00
Max Kellermann
db23c2f27b
util/StringView: allow casting from BasicStringView to StringView
2017-09-12 19:08:47 +02:00
Max Kellermann
9744f437d8
Util/CharUtil: add wchar_t overloads
...
Needed for WStringView.
2017-09-12 18:22:02 +02:00
Max Kellermann
01f84b0e53
util/StringView: add struct WStringView
2017-09-12 17:17:13 +02:00
Max Kellermann
5dbdd36263
util/StringView: add struct BasicStringView
2017-09-12 17:17:13 +02:00
Max Kellermann
96b557c1f0
util/StringView: remove methods SetEmpty(), Empty()
2017-09-12 17:17:13 +02:00