summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-09-25 16:19:03 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-09-25 16:19:03 +0100
commitcf4caeffe5e18dfa0c0078974664679b896d76e4 (patch)
treec7096fb8eadd9fc08bbb26100d15773cecbef879
parentAdd utils for trimming string_views ltrim,rtrim,trim (diff)
downloadlibadhocutil-cf4caeffe5e18dfa0c0078974664679b896d76e4.tar.bz2
libadhocutil-cf4caeffe5e18dfa0c0078974664679b896d76e4.tar.xz
libadhocutil-cf4caeffe5e18dfa0c0078974664679b896d76e4.zip
Add stub header for all header only fileslibadhocutil-0.8.6
-rw-r--r--Jamroot.jam1
-rw-r--r--iwyu.json24
-rw-r--r--libadhocutil/boost-test-extra.cpp1
-rw-r--r--libadhocutil/c++11Helpers.cpp1
-rw-r--r--libadhocutil/cache.cpp1
-rw-r--r--libadhocutil/cache.h2
-rw-r--r--libadhocutil/cache.impl.cpp1
-rw-r--r--libadhocutil/cache.impl.h6
-rw-r--r--libadhocutil/case_less.cpp4
-rw-r--r--libadhocutil/compileTimeFormatter.cpp1
-rw-r--r--libadhocutil/compileTimeFormatter.h22
-rw-r--r--libadhocutil/ctf-impl/printf-compat.cpp1
-rw-r--r--libadhocutil/ctf-impl/printf-compat.h1
-rw-r--r--libadhocutil/exception.cpp1
-rw-r--r--libadhocutil/factory.cpp1
-rw-r--r--libadhocutil/factory.h2
-rw-r--r--libadhocutil/factory.impl.cpp1
-rw-r--r--libadhocutil/factory.impl.h2
-rw-r--r--libadhocutil/globalStatic.cpp1
-rw-r--r--libadhocutil/globalStatic.h2
-rw-r--r--libadhocutil/globalStatic.impl.cpp1
-rw-r--r--libadhocutil/handle.cpp1
-rw-r--r--libadhocutil/lazyPointer.cpp1
-rw-r--r--libadhocutil/lazyPointer.h1
-rw-r--r--libadhocutil/lockHelpers.cpp1
-rw-r--r--libadhocutil/optionalUtils.cpp1
-rw-r--r--libadhocutil/plugins.impl.cpp1
-rw-r--r--libadhocutil/plugins.impl.h6
-rw-r--r--libadhocutil/resourcePool.impl.cpp1
-rw-r--r--libadhocutil/resourcePool.impl.h6
-rw-r--r--libadhocutil/safeMapFind.cpp5
-rw-r--r--libadhocutil/safeMapFind.h2
-rw-r--r--libadhocutil/strUtil.cpp1
-rw-r--r--libadhocutil/unique.cpp1
-rw-r--r--libadhocutil/unittests/testCache.cpp1
-rw-r--r--libadhocutil/unittests/testCompileTimeFormatter.cpp2
-rw-r--r--libadhocutil/unittests/testPluginsRuntime.cpp1
-rw-r--r--libadhocutil/unittests/testResourcePool.cpp27
-rw-r--r--libadhocutil/unittests/testStrUtil.cpp1
-rw-r--r--libadhocutil/visibility.cpp1
40 files changed, 106 insertions, 32 deletions
diff --git a/Jamroot.jam b/Jamroot.jam
index c1f55f0..bca9e3e 100644
--- a/Jamroot.jam
+++ b/Jamroot.jam
@@ -51,6 +51,7 @@ project
<toolset>tidy:<xcheckxx>hicpp-no-array-decay
<toolset>tidy:<checkxx>performance-*
<toolset>tidy:<define>ICE_IGNORE_VERSION
+ <toolset>tidy:<define>ICE_MEMBER_IMPORT_EXPORT
<toolset>tidy:<mapping>iwyu.json
<toolset>tidy:<librarydef>boost
<toolset>tidy:<librarydef>std
diff --git a/iwyu.json b/iwyu.json
index b12677a..e4af14b 100644
--- a/iwyu.json
+++ b/iwyu.json
@@ -8,6 +8,14 @@
]
},
{
+ "symbol": [
+ "strncasecmp",
+ "private",
+ "<cstring>",
+ "public"
+ ]
+ },
+ {
"include": [
"<bits/types/stack_t.h>",
"private",
@@ -97,6 +105,22 @@
},
{
"include": [
+ "<boost/lambda/core.hpp>",
+ "private",
+ "<boost/lambda/lambda.hpp>",
+ "public"
+ ]
+ },
+ {
+ "include": [
+ "@<boost/lambda/detail/.*>",
+ "private",
+ "<boost/lambda/lambda.hpp>",
+ "public"
+ ]
+ },
+ {
+ "include": [
"@<boost/preprocessor/.*>",
"private",
"<boost/test/unit_test.hpp>",
diff --git a/libadhocutil/boost-test-extra.cpp b/libadhocutil/boost-test-extra.cpp
new file mode 100644
index 0000000..940e182
--- /dev/null
+++ b/libadhocutil/boost-test-extra.cpp
@@ -0,0 +1 @@
+#include "boost-test-extra.h"
diff --git a/libadhocutil/c++11Helpers.cpp b/libadhocutil/c++11Helpers.cpp
new file mode 100644
index 0000000..5fb07dd
--- /dev/null
+++ b/libadhocutil/c++11Helpers.cpp
@@ -0,0 +1 @@
+#include "c++11Helpers.h"
diff --git a/libadhocutil/cache.cpp b/libadhocutil/cache.cpp
new file mode 100644
index 0000000..05b26b0
--- /dev/null
+++ b/libadhocutil/cache.cpp
@@ -0,0 +1 @@
+#include "cache.h"
diff --git a/libadhocutil/cache.h b/libadhocutil/cache.h
index 5f606c2..56fb5ac 100644
--- a/libadhocutil/cache.h
+++ b/libadhocutil/cache.h
@@ -3,8 +3,10 @@
#include "c++11Helpers.h"
#include "visibility.h"
+#include <boost/multi_index/indexed_by.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/ordered_index.hpp>
+#include <boost/multi_index/tag.hpp>
#include <boost/multi_index_container.hpp>
#include <ctime>
#include <functional>
diff --git a/libadhocutil/cache.impl.cpp b/libadhocutil/cache.impl.cpp
new file mode 100644
index 0000000..13cd32a
--- /dev/null
+++ b/libadhocutil/cache.impl.cpp
@@ -0,0 +1 @@
+#include "cache.impl.h"
diff --git a/libadhocutil/cache.impl.h b/libadhocutil/cache.impl.h
index 7ba5853..6b72e29 100644
--- a/libadhocutil/cache.impl.h
+++ b/libadhocutil/cache.impl.h
@@ -4,8 +4,10 @@
#include "cache.h" // IWYU pragma: export
#include "lockHelpers.h"
#include <boost/lambda/lambda.hpp>
-#include <mutex>
-#include <shared_mutex>
+#include <ctime>
+#include <memory>
+#include <variant>
+// IWYU pragma: no_include <boost/multi_index/detail/unbounded.hpp>
namespace AdHoc {
diff --git a/libadhocutil/case_less.cpp b/libadhocutil/case_less.cpp
new file mode 100644
index 0000000..5e83f68
--- /dev/null
+++ b/libadhocutil/case_less.cpp
@@ -0,0 +1,4 @@
+#include "case_less.h"
+#include <string_view>
+
+static_assert(&AdHoc::case_less::operator()<std::string_view, std::string_view>);
diff --git a/libadhocutil/compileTimeFormatter.cpp b/libadhocutil/compileTimeFormatter.cpp
new file mode 100644
index 0000000..d367071
--- /dev/null
+++ b/libadhocutil/compileTimeFormatter.cpp
@@ -0,0 +1 @@
+#include "compileTimeFormatter.h"
diff --git a/libadhocutil/compileTimeFormatter.h b/libadhocutil/compileTimeFormatter.h
index 2524043..33fe677 100644
--- a/libadhocutil/compileTimeFormatter.h
+++ b/libadhocutil/compileTimeFormatter.h
@@ -1,23 +1,26 @@
#ifndef ADHOCUTIL_COMPILE_TIME_FORMATTER_H
#define ADHOCUTIL_COMPILE_TIME_FORMATTER_H
-#include <array>
-#include <boost/preprocessor/variadic/size.hpp>
-#include <cstring>
-#include <iostream>
+#include <boost/preprocessor/control/iif.hpp> // IWYU pragma: keep
+#include <boost/preprocessor/variadic/size.hpp> // IWYU pragma: keep
#include <optional>
#include <sstream> // IWYU pragma: export
+#include <type_traits>
+// Mapped for for BOOST_PP_VARIADIC_SIZE, BOOST_PP... in tests
+// IWYU pragma: no_include <boost/test/unit_test.hpp>
-namespace AdHoc {
#ifdef __cpp_nontype_template_parameter_class
# define USE_FIXED_STRING
#endif
#ifdef USE_FIXED_STRING
# define CtfString const auto
+# include <array>
+# include <iostream>
#else
# define CtfString const auto &
#endif
+namespace AdHoc {
// Template char utils
template<typename char_type>
constexpr bool
@@ -248,6 +251,7 @@ namespace AdHoc {
namespace support {
template<typename CharT, std::size_t N> class basic_fixed_string : public std::array<CharT, N> {
public:
+ // cppcheck-suppress noExplicitConstructor
constexpr basic_fixed_string(const CharT (&str)[N + 1])
{
for (decltype(N) x = 0; x < N; x++) {
@@ -333,11 +337,11 @@ namespace AdHoc {
{
return AdHoc::FormatterDetail<FMT<T, t...>::fmtstr, sizeof...(t)>();
}
+# ifdef __clang__
+# pragma clang diagnostic pop
+# endif
+# pragma GCC diagnostic pop
#endif
-#ifdef __clang__
-# pragma clang diagnostic pop
-#endif
-#pragma GCC diagnostic pop
}
}
diff --git a/libadhocutil/ctf-impl/printf-compat.cpp b/libadhocutil/ctf-impl/printf-compat.cpp
new file mode 100644
index 0000000..b3edf9c
--- /dev/null
+++ b/libadhocutil/ctf-impl/printf-compat.cpp
@@ -0,0 +1 @@
+#include "printf-compat.h"
diff --git a/libadhocutil/ctf-impl/printf-compat.h b/libadhocutil/ctf-impl/printf-compat.h
index aa0ead9..1ca30c3 100644
--- a/libadhocutil/ctf-impl/printf-compat.h
+++ b/libadhocutil/ctf-impl/printf-compat.h
@@ -8,6 +8,7 @@
#include <boost/preprocessor/comma_if.hpp>
#include <boost/preprocessor/if.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
+#include <cstring>
#include <iomanip>
#include <type_traits>
diff --git a/libadhocutil/exception.cpp b/libadhocutil/exception.cpp
new file mode 100644
index 0000000..5a8d53c
--- /dev/null
+++ b/libadhocutil/exception.cpp
@@ -0,0 +1 @@
+#include "exception.h"
diff --git a/libadhocutil/factory.cpp b/libadhocutil/factory.cpp
new file mode 100644
index 0000000..4ea88f8
--- /dev/null
+++ b/libadhocutil/factory.cpp
@@ -0,0 +1 @@
+#include "factory.h"
diff --git a/libadhocutil/factory.h b/libadhocutil/factory.h
index a2a49ed..1d614fd 100644
--- a/libadhocutil/factory.h
+++ b/libadhocutil/factory.h
@@ -3,6 +3,8 @@
#include "plugins.h"
#include "visibility.h"
+#include <memory>
+#include <string_view>
namespace AdHoc {
/**
diff --git a/libadhocutil/factory.impl.cpp b/libadhocutil/factory.impl.cpp
new file mode 100644
index 0000000..b5abe96
--- /dev/null
+++ b/libadhocutil/factory.impl.cpp
@@ -0,0 +1 @@
+#include "factory.impl.h"
diff --git a/libadhocutil/factory.impl.h b/libadhocutil/factory.impl.h
index a630592..905b7c4 100644
--- a/libadhocutil/factory.impl.h
+++ b/libadhocutil/factory.impl.h
@@ -3,6 +3,8 @@
#include "factory.h" // IWYU pragma: export
#include "plugins.impl.h" // IWYU pragma: export
+#include <memory>
+#include <string_view>
namespace AdHoc {
template<typename Base, typename... Params>
diff --git a/libadhocutil/globalStatic.cpp b/libadhocutil/globalStatic.cpp
new file mode 100644
index 0000000..6dd773e
--- /dev/null
+++ b/libadhocutil/globalStatic.cpp
@@ -0,0 +1 @@
+#include "globalStatic.h"
diff --git a/libadhocutil/globalStatic.h b/libadhocutil/globalStatic.h
index a3847eb..4bc16ef 100644
--- a/libadhocutil/globalStatic.h
+++ b/libadhocutil/globalStatic.h
@@ -1,8 +1,6 @@
#ifndef ADHOCUTIL_GLOBALSTATIC_H
#define ADHOCUTIL_GLOBALSTATIC_H
-#include <memory>
-
namespace AdHoc {
/**
* Wrapper class for initialising/destroying a global static object via
diff --git a/libadhocutil/globalStatic.impl.cpp b/libadhocutil/globalStatic.impl.cpp
new file mode 100644
index 0000000..94a9b89
--- /dev/null
+++ b/libadhocutil/globalStatic.impl.cpp
@@ -0,0 +1 @@
+#include "globalStatic.impl.h"
diff --git a/libadhocutil/handle.cpp b/libadhocutil/handle.cpp
new file mode 100644
index 0000000..8a3cede
--- /dev/null
+++ b/libadhocutil/handle.cpp
@@ -0,0 +1 @@
+#include "handle.h"
diff --git a/libadhocutil/lazyPointer.cpp b/libadhocutil/lazyPointer.cpp
new file mode 100644
index 0000000..910e04a
--- /dev/null
+++ b/libadhocutil/lazyPointer.cpp
@@ -0,0 +1 @@
+#include "lazyPointer.h"
diff --git a/libadhocutil/lazyPointer.h b/libadhocutil/lazyPointer.h
index 8b523d3..c412f03 100644
--- a/libadhocutil/lazyPointer.h
+++ b/libadhocutil/lazyPointer.h
@@ -3,7 +3,6 @@
#include <functional>
#include <memory>
-#include <ostream>
#include <variant>
namespace AdHoc {
diff --git a/libadhocutil/lockHelpers.cpp b/libadhocutil/lockHelpers.cpp
new file mode 100644
index 0000000..436f153
--- /dev/null
+++ b/libadhocutil/lockHelpers.cpp
@@ -0,0 +1 @@
+#include "lockHelpers.h"
diff --git a/libadhocutil/optionalUtils.cpp b/libadhocutil/optionalUtils.cpp
new file mode 100644
index 0000000..56311d5
--- /dev/null
+++ b/libadhocutil/optionalUtils.cpp
@@ -0,0 +1 @@
+#include "optionalUtils.h"
diff --git a/libadhocutil/plugins.impl.cpp b/libadhocutil/plugins.impl.cpp
new file mode 100644
index 0000000..cb141f9
--- /dev/null
+++ b/libadhocutil/plugins.impl.cpp
@@ -0,0 +1 @@
+#include "plugins.impl.h"
diff --git a/libadhocutil/plugins.impl.h b/libadhocutil/plugins.impl.h
index d3ce7a2..d10976b 100644
--- a/libadhocutil/plugins.impl.h
+++ b/libadhocutil/plugins.impl.h
@@ -2,6 +2,12 @@
#define ADHOCUTIL_PLUGINS_IMPL_H
#include "plugins.h" // IWYU pragma: export
+#include "unique.h"
+#include "visibility.h"
+#include <memory>
+#include <set>
+#include <string_view>
+#include <typeinfo>
namespace AdHoc {
template<typename T>
diff --git a/libadhocutil/resourcePool.impl.cpp b/libadhocutil/resourcePool.impl.cpp
new file mode 100644
index 0000000..7554472
--- /dev/null
+++ b/libadhocutil/resourcePool.impl.cpp
@@ -0,0 +1 @@
+#include "resourcePool.impl.h"
diff --git a/libadhocutil/resourcePool.impl.h b/libadhocutil/resourcePool.impl.h
index 31f0dbf..eb34b22 100644
--- a/libadhocutil/resourcePool.impl.h
+++ b/libadhocutil/resourcePool.impl.h
@@ -4,7 +4,13 @@
#include "lockHelpers.h"
#include "resourcePool.h" // IWYU pragma: export
#include "safeMapFind.h"
+#include "semaphore.h"
#include <boost/assert.hpp>
+#include <cstddef>
+#include <exception>
+#include <memory>
+#include <thread>
+#include <typeinfo>
namespace AdHoc {
//
diff --git a/libadhocutil/safeMapFind.cpp b/libadhocutil/safeMapFind.cpp
new file mode 100644
index 0000000..d2e62f6
--- /dev/null
+++ b/libadhocutil/safeMapFind.cpp
@@ -0,0 +1,5 @@
+#include "safeMapFind.h"
+#include <array>
+
+constexpr std::array<int, 3> testData {0, 1, 2};
+static_assert(AdHoc::containerContains(testData, 0));
diff --git a/libadhocutil/safeMapFind.h b/libadhocutil/safeMapFind.h
index 3a11f0c..0f5c24d 100644
--- a/libadhocutil/safeMapFind.h
+++ b/libadhocutil/safeMapFind.h
@@ -52,7 +52,7 @@ namespace AdHoc {
* Simple search, true if found, false otherwise
*/
template<class Cont>
- bool
+ constexpr bool
containerContains(const Cont & c, const typename Cont::value_type & v)
{
return (std::find(c.begin(), c.end(), v) != c.end());
diff --git a/libadhocutil/strUtil.cpp b/libadhocutil/strUtil.cpp
new file mode 100644
index 0000000..7b40fb2
--- /dev/null
+++ b/libadhocutil/strUtil.cpp
@@ -0,0 +1 @@
+#include "strUtil.h"
diff --git a/libadhocutil/unique.cpp b/libadhocutil/unique.cpp
new file mode 100644
index 0000000..4b6f34a
--- /dev/null
+++ b/libadhocutil/unique.cpp
@@ -0,0 +1 @@
+#include "unique.h"
diff --git a/libadhocutil/unittests/testCache.cpp b/libadhocutil/unittests/testCache.cpp
index 2b7f89a..c6ab6b4 100644
--- a/libadhocutil/unittests/testCache.cpp
+++ b/libadhocutil/unittests/testCache.cpp
@@ -7,7 +7,6 @@
#include <ostream>
#include <string>
#include <unistd.h>
-#include <variant>
// NOLINTNEXTLINE(hicpp-special-member-functions)
class Obj {
diff --git a/libadhocutil/unittests/testCompileTimeFormatter.cpp b/libadhocutil/unittests/testCompileTimeFormatter.cpp
index 877f3e8..fc45dba 100644
--- a/libadhocutil/unittests/testCompileTimeFormatter.cpp
+++ b/libadhocutil/unittests/testCompileTimeFormatter.cpp
@@ -1,9 +1,9 @@
#define BOOST_TEST_MODULE CompileTimeFormatter
#include <boost/test/unit_test.hpp>
+#include "compileTimeFormatter.h"
#include "memstream.h"
#include <boost/assert.hpp>
-#include <compileTimeFormatter.h>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
diff --git a/libadhocutil/unittests/testPluginsRuntime.cpp b/libadhocutil/unittests/testPluginsRuntime.cpp
index a558910..9b3279d 100644
--- a/libadhocutil/unittests/testPluginsRuntime.cpp
+++ b/libadhocutil/unittests/testPluginsRuntime.cpp
@@ -5,7 +5,6 @@
#include "utilTestClasses.h"
#include <dlfcn.h>
#include <filesystem>
-#include <memory>
#include <optional>
#include <set>
#include <string>
diff --git a/libadhocutil/unittests/testResourcePool.cpp b/libadhocutil/unittests/testResourcePool.cpp
index 08f6caf..baa965a 100644
--- a/libadhocutil/unittests/testResourcePool.cpp
+++ b/libadhocutil/unittests/testResourcePool.cpp
@@ -1,20 +1,19 @@
#define BOOST_TEST_MODULE ResourcePool
#include <boost/test/unit_test.hpp>
-#include "c++11Helpers.h" // for SPECIAL_MEMBERS_DELETE
-#include "lockHelpers.h" // for ScopeLock
-#include "semaphore.h" // for Semaphore
-#include <atomic> // for atomic, __atomic_base
-#include <list> // for list, operator==, _List_iterator
-#include <map> // for operator==
-#include <memory> // for make_shared, shared_ptr
-#include <mutex> // for unique_lock, mutex
-#include <resourcePool.impl.h>
-#include <stdexcept> // for exception
-#include <thread> // for thread, get_id
-#include <tuple> // for get
-#include <unistd.h> // for usleep, sleep
-#include <utility> // for move
+#include "c++11Helpers.h"
+#include "lockHelpers.h"
+#include "resourcePool.impl.h"
+#include "semaphore.h"
+#include <atomic>
+#include <list>
+#include <map>
+#include <memory>
+#include <mutex>
+#include <stdexcept>
+#include <thread>
+#include <unistd.h>
+#include <utility>
class MockResource {
public:
diff --git a/libadhocutil/unittests/testStrUtil.cpp b/libadhocutil/unittests/testStrUtil.cpp
index fa642a7..f29bb07 100644
--- a/libadhocutil/unittests/testStrUtil.cpp
+++ b/libadhocutil/unittests/testStrUtil.cpp
@@ -1,4 +1,5 @@
#include <strUtil.h>
+#include <string_view>
constexpr auto
ltrim(std::string_view s, const auto c)
diff --git a/libadhocutil/visibility.cpp b/libadhocutil/visibility.cpp
new file mode 100644
index 0000000..b0a6ba9
--- /dev/null
+++ b/libadhocutil/visibility.cpp
@@ -0,0 +1 @@
+#include "visibility.h"