Commit Graph

365 Commits

Author SHA1 Message Date
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
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