summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-08-01 20:40:05 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-08-01 20:40:05 +0100
commitf5c690633d50df30f806560fdaa403b2fe55519c (patch)
tree9635871abd2788774992223e61a0cb304860c163
parentSimplified Ice::ByteSeq interfaces (diff)
downloadslicer-f5c690633d50df30f806560fdaa403b2fe55519c.tar.bz2
slicer-f5c690633d50df30f806560fdaa403b2fe55519c.tar.xz
slicer-f5c690633d50df30f806560fdaa403b2fe55519c.zip
Reformat with new clang-format
-rw-r--r--slicer/db/sqlBinder.h2
-rw-r--r--slicer/db/sqlCommon.cpp1
-rw-r--r--slicer/db/sqlInsertSerializer.cpp1
-rw-r--r--slicer/db/sqlInsertSerializer.h1
-rw-r--r--slicer/db/sqlSelectDeserializer.h1
-rw-r--r--slicer/db/sqlSource.h3
-rw-r--r--slicer/db/sqlTablePatchSerializer.cpp3
-rw-r--r--slicer/db/sqlTablePatchSerializer.h1
-rw-r--r--slicer/db/sqlUpdateSerializer.h1
-rw-r--r--slicer/db/testInsert.cpp1
-rw-r--r--slicer/db/testMockCommon.h1
-rw-r--r--slicer/db/testPatch.cpp2
-rw-r--r--slicer/ice/testSpecifics.cpp1
-rw-r--r--slicer/json/serializer.cpp4
-rw-r--r--slicer/slicer/enumMap.h1
-rw-r--r--slicer/slicer/hook-test.cpp1
-rw-r--r--slicer/slicer/hookMap.h1
-rw-r--r--slicer/slicer/metadata.h1
-rw-r--r--slicer/slicer/modelParts.h7
-rw-r--r--slicer/slicer/modelPartsTypes.cpp35
-rw-r--r--slicer/slicer/modelPartsTypes.h1
-rw-r--r--slicer/slicer/modelPartsTypes.impl.h2
-rw-r--r--slicer/slicer/serializer.h3
-rw-r--r--slicer/slicer/slicer.cpp8
-rw-r--r--slicer/test/conversions.cpp18
-rw-r--r--slicer/test/conversions.h1
-rw-r--r--slicer/test/serializers.cpp2
-rw-r--r--slicer/tool/icemetadata.cpp1
-rw-r--r--slicer/tool/parser.cpp5
-rw-r--r--slicer/tool/parser.h2
-rw-r--r--slicer/xml/serializer.cpp2
-rw-r--r--slicer/xml/serializer.h1
-rw-r--r--slicer/xml/testSpecifics.cpp1
33 files changed, 106 insertions, 10 deletions
diff --git a/slicer/db/sqlBinder.h b/slicer/db/sqlBinder.h
index 4f5437c..71f23ea 100644
--- a/slicer/db/sqlBinder.h
+++ b/slicer/db/sqlBinder.h
@@ -6,6 +6,7 @@
#include <memory>
#include <slicer/modelParts.h>
#include <string>
+
namespace DB {
class Command;
}
@@ -33,6 +34,7 @@ namespace Slicer {
DB::Command & command;
const unsigned int idx;
};
+
typedef std::shared_ptr<SqlBinder> SqlBinderPtr;
}
diff --git a/slicer/db/sqlCommon.cpp b/slicer/db/sqlCommon.cpp
index 40e43f7..21fb9e5 100644
--- a/slicer/db/sqlCommon.cpp
+++ b/slicer/db/sqlCommon.cpp
@@ -59,6 +59,7 @@ namespace Slicer {
}
AdHocFormatter(UnsuitableIdFieldTypeMsg, "Unsuitable id field type [%?]");
+
void
UnsuitableIdFieldType::ice_print(std::ostream & s) const
{
diff --git a/slicer/db/sqlInsertSerializer.cpp b/slicer/db/sqlInsertSerializer.cpp
index 58e30e2..b4d46e6 100644
--- a/slicer/db/sqlInsertSerializer.cpp
+++ b/slicer/db/sqlInsertSerializer.cpp
@@ -88,6 +88,7 @@ namespace Slicer {
private:
DB::Connection * const connection;
+
template<typename T>
inline void
doSet([[maybe_unused]] T & v, [[maybe_unused]] const char * Tname) const
diff --git a/slicer/db/sqlInsertSerializer.h b/slicer/db/sqlInsertSerializer.h
index b6a0d27..4a6a423 100644
--- a/slicer/db/sqlInsertSerializer.h
+++ b/slicer/db/sqlInsertSerializer.h
@@ -7,6 +7,7 @@
#include <slicer/serializer.h>
#include <string>
#include <visibility.h>
+
namespace DB {
class Connection;
class ModifyCommand;
diff --git a/slicer/db/sqlSelectDeserializer.h b/slicer/db/sqlSelectDeserializer.h
index bf2b351..9e9d499 100644
--- a/slicer/db/sqlSelectDeserializer.h
+++ b/slicer/db/sqlSelectDeserializer.h
@@ -6,6 +6,7 @@
#include <slicer/serializer.h>
#include <string>
#include <visibility.h>
+
namespace DB {
class SelectCommand;
}
diff --git a/slicer/db/sqlSource.h b/slicer/db/sqlSource.h
index 4b76974..70a0122 100644
--- a/slicer/db/sqlSource.h
+++ b/slicer/db/sqlSource.h
@@ -5,9 +5,11 @@
#include <Ice/Config.h>
#include <memory>
#include <string>
+
namespace DB {
class Column;
}
+
namespace boost::posix_time {
class ptime;
class time_duration;
@@ -36,6 +38,7 @@ namespace Slicer {
private:
const DB::Column & column;
};
+
typedef std::shared_ptr<SqlSource> SqlSourcePtr;
}
diff --git a/slicer/db/sqlTablePatchSerializer.cpp b/slicer/db/sqlTablePatchSerializer.cpp
index 3b73f05..a22f15a 100644
--- a/slicer/db/sqlTablePatchSerializer.cpp
+++ b/slicer/db/sqlTablePatchSerializer.cpp
@@ -11,6 +11,7 @@
namespace Slicer {
AdHocFormatter(ttname, "slicer_tmp_%?");
+
SqlTablePatchSerializer::SqlTablePatchSerializer(DB::Connection * const d, DB::TablePatch & tp) :
db(d), tablePatch(tp)
{
@@ -47,6 +48,7 @@ namespace Slicer {
}
AdHocFormatter(createTmpTable, "CREATE TEMPORARY TABLE %? AS SELECT * FROM %? WHERE 1 = 0");
+
void
SqlTablePatchSerializer::createTemporaryTable()
{
@@ -54,6 +56,7 @@ namespace Slicer {
}
AdHocFormatter(dropTmpTable, "DROP TABLE %?");
+
void
SqlTablePatchSerializer::dropTemporaryTable()
{
diff --git a/slicer/db/sqlTablePatchSerializer.h b/slicer/db/sqlTablePatchSerializer.h
index 21c8b3d..73e084d 100644
--- a/slicer/db/sqlTablePatchSerializer.h
+++ b/slicer/db/sqlTablePatchSerializer.h
@@ -4,6 +4,7 @@
#include <slicer/modelParts.h>
#include <slicer/serializer.h>
#include <visibility.h>
+
namespace DB {
class Connection;
class TablePatch;
diff --git a/slicer/db/sqlUpdateSerializer.h b/slicer/db/sqlUpdateSerializer.h
index 8707988..54a5f82 100644
--- a/slicer/db/sqlUpdateSerializer.h
+++ b/slicer/db/sqlUpdateSerializer.h
@@ -6,6 +6,7 @@
#include <slicer/serializer.h>
#include <string>
#include <visibility.h>
+
namespace DB {
class Connection;
class ModifyCommand;
diff --git a/slicer/db/testInsert.cpp b/slicer/db/testInsert.cpp
index a9e42f1..24cae7e 100644
--- a/slicer/db/testInsert.cpp
+++ b/slicer/db/testInsert.cpp
@@ -25,6 +25,7 @@ using namespace std::literals;
BOOST_TEST_DONT_PRINT_LOG_VALUE(TestModule::DateTime)
BOOST_TEST_DONT_PRINT_LOG_VALUE(TestModule::IsoDate)
BOOST_TEST_DONT_PRINT_LOG_VALUE(TestDatabase::Timespan)
+
// LCOV_EXCL_STOP
namespace std {
diff --git a/slicer/db/testMockCommon.h b/slicer/db/testMockCommon.h
index e12d2c6..891fb74 100644
--- a/slicer/db/testMockCommon.h
+++ b/slicer/db/testMockCommon.h
@@ -5,6 +5,7 @@
#include <mockDatabase.h>
#include <pq-mock.h>
#include <visibility.h>
+
// IWYU pragma: no_forward_declare PQ::Mock
namespace DB {
class Connection;
diff --git a/slicer/db/testPatch.cpp b/slicer/db/testPatch.cpp
index 6db440a..3e8b1e4 100644
--- a/slicer/db/testPatch.cpp
+++ b/slicer/db/testPatch.cpp
@@ -11,9 +11,11 @@
#include <memory>
#include <string>
#include <tablepatch.h>
+
namespace TestDatabase {
class Timespan;
}
+
namespace TestModule {
struct DateTime;
struct IsoDate;
diff --git a/slicer/ice/testSpecifics.cpp b/slicer/ice/testSpecifics.cpp
index 2080993..6b6c0f0 100644
--- a/slicer/ice/testSpecifics.cpp
+++ b/slicer/ice/testSpecifics.cpp
@@ -18,6 +18,7 @@
// LCOV_EXCL_START
// cppcheck-suppress unknownMacro
BOOST_TEST_DONT_PRINT_LOG_VALUE(TestModule::IsoDate)
+
// LCOV_EXCL_STOP
template<typename X>
diff --git a/slicer/json/serializer.cpp b/slicer/json/serializer.cpp
index e2db939..227f3c9 100644
--- a/slicer/json/serializer.cpp
+++ b/slicer/json/serializer.cpp
@@ -150,6 +150,7 @@ namespace Slicer {
class DocumentTreeIterate {
public:
explicit DocumentTreeIterate(ModelPartPtr & mp) : modelPart(mp) { }
+
template<typename SimpleT>
void
operator()(const SimpleT & v) const
@@ -158,11 +159,13 @@ namespace Slicer {
modelPart->SetValue(JsonValueSource(v));
modelPart->Complete();
}
+
void
operator()(const json::Null &) const
{
modelPart->Complete();
}
+
void
operator()(const json::Object & o) const
{
@@ -197,6 +200,7 @@ namespace Slicer {
modelPart->Complete();
}
}
+
void
operator()(const json::Array & a) const
{
diff --git a/slicer/slicer/enumMap.h b/slicer/slicer/enumMap.h
index 4c50bd8..e076a0c 100644
--- a/slicer/slicer/enumMap.h
+++ b/slicer/slicer/enumMap.h
@@ -52,6 +52,7 @@ namespace Slicer {
EnumMap<E>::begin = arr.begin();
EnumMap<E>::end = arr.end();
}
+
const Arr<N> arr;
};
}
diff --git a/slicer/slicer/hook-test.cpp b/slicer/slicer/hook-test.cpp
index 3af28b4..2fa1b8b 100644
--- a/slicer/slicer/hook-test.cpp
+++ b/slicer/slicer/hook-test.cpp
@@ -15,6 +15,7 @@ namespace test {
int AA;
std::string b;
};
+
const std::string aa {"aa"}, aA {"aA"}, Aa {"Aa"}, AA {"AA"}, b {"b"};
using C = Slicer::ModelPartForComplex<S>;
diff --git a/slicer/slicer/hookMap.h b/slicer/slicer/hookMap.h
index 92035de..5f71e17 100644
--- a/slicer/slicer/hookMap.h
+++ b/slicer/slicer/hookMap.h
@@ -13,6 +13,7 @@ namespace Slicer {
void DLL_PUBLIC to_lower(std::string s);
template<typename T> class ModelPartForComplex; // IWYU pragma: keep
+
template<typename T> class Hooks {
public:
using HookPtr = const typename ModelPartForComplex<T>::HookBase *;
diff --git a/slicer/slicer/metadata.h b/slicer/slicer/metadata.h
index 6b209ae..8f24edb 100644
--- a/slicer/slicer/metadata.h
+++ b/slicer/slicer/metadata.h
@@ -109,6 +109,7 @@ namespace Slicer {
template<std::size_t N> class DLL_PUBLIC MetaDataImpl : public MetaData<> {
public:
using Arr = ContainerBase<N>;
+
constexpr inline explicit MetaDataImpl(const std::array<std::string_view, N> & a) :
arr {[&a]() {
Arr rtn;
diff --git a/slicer/slicer/modelParts.h b/slicer/slicer/modelParts.h
index 1986a95..e5e323f 100644
--- a/slicer/slicer/modelParts.h
+++ b/slicer/slicer/modelParts.h
@@ -24,6 +24,7 @@ namespace Slicer {
virtual void get(const T &) const = 0;
SPECIAL_MEMBERS_DEFAULT(TValueTarget);
};
+
class ValueTarget :
public TValueTarget<bool>,
public TValueTarget<Ice::Byte>,
@@ -51,6 +52,7 @@ namespace Slicer {
virtual void set(T &) const = 0;
SPECIAL_MEMBERS_DEFAULT(TValueSource);
};
+
class ValueSource :
public TValueSource<bool>,
public TValueSource<Ice::Byte>,
@@ -119,6 +121,7 @@ namespace Slicer {
name(n), nameLower(nl), nameStr(ns)
{
}
+
virtual ~HookCommon() = default;
SPECIAL_MEMBERS_DEFAULT(HookCommon);
@@ -132,8 +135,7 @@ namespace Slicer {
const std::string * nameStr;
};
- template<typename T> struct DLL_PUBLIC Default {
- };
+ template<typename T> struct DLL_PUBLIC Default { };
class DLL_PUBLIC ModelPart : public std::enable_shared_from_this<ModelPart> {
public:
@@ -175,6 +177,7 @@ namespace Slicer {
template<typename T> class DLL_PUBLIC ModelPartModel {
public:
explicit ModelPartModel(T * m = nullptr) : Model(m) { }
+
T * Model;
};
diff --git a/slicer/slicer/modelPartsTypes.cpp b/slicer/slicer/modelPartsTypes.cpp
index 47543a6..aabbf57 100644
--- a/slicer/slicer/modelPartsTypes.cpp
+++ b/slicer/slicer/modelPartsTypes.cpp
@@ -17,6 +17,7 @@
#include <string>
#include <string_view>
#include <utility>
+
// IWYU pragma: no_forward_declare boost::multi_index::member
// IWYU pragma: no_include <boost/operators.hpp>
@@ -172,57 +173,68 @@ namespace Slicer {
ModelPartForSimpleBase::OnEachChild(const ChildHandler &)
{
}
+
ChildRef
ModelPartForSimpleBase::GetAnonChildRef(const HookFilter &)
{
return ChildRef();
}
+
ChildRef
ModelPartForSimpleBase::GetChildRef(std::string_view, const HookFilter &, bool)
{
return ChildRef();
}
+
bool
ModelPartForSimpleBase::HasValue() const
{
return true;
}
+
ModelPartType
ModelPartForSimpleBase::GetType() const
{
return type;
}
+
const ModelPartType ModelPartForSimpleBase::type = ModelPartType::Simple;
void
ModelPartForConvertedBase::OnEachChild(const ChildHandler &)
{
}
+
ChildRef
ModelPartForConvertedBase::GetAnonChildRef(const HookFilter &)
{
return ChildRef();
}
+
ChildRef
ModelPartForConvertedBase::GetChildRef(std::string_view, const HookFilter &, bool)
{
return ChildRef();
}
+
bool
ModelPartForConvertedBase::HasValue() const
{
return true;
}
+
ModelPartType
ModelPartForConvertedBase::GetType() const
{
return type;
}
+
void
ModelPartForConvertedBase::conversion_fail(std::string_view typeName)
{
throw NoConversionFound(std::string {typeName});
}
+
const ModelPartType ModelPartForConvertedBase::type = ModelPartType::Simple;
ModelPartType
@@ -230,7 +242,9 @@ namespace Slicer {
{
return type;
}
+
const ModelPartType ModelPartForComplexBase::type = ModelPartType::Complex;
+
void
ModelPartForComplexBase::registerClass(
const std::string & className, const std::string * typeName, const ClassRef & cr)
@@ -240,6 +254,7 @@ namespace Slicer {
Slicer::classNameMap()->insert({className, *typeName});
}
}
+
void
ModelPartForComplexBase::unregisterClass(const std::string & className, const std::string * typeName)
{
@@ -248,6 +263,7 @@ namespace Slicer {
classNameMap()->get<0>().erase(className);
}
}
+
ModelPartPtr
ModelPartForComplexBase::getSubclassModelPart(const std::string & name, void * m)
{
@@ -257,6 +273,7 @@ namespace Slicer {
}
return ref->second(m);
}
+
TypeId
ModelPartForComplexBase::getTypeId(const std::string & id, const std::string & className)
{
@@ -335,26 +352,31 @@ namespace Slicer {
ModelPartForEnumBase::OnEachChild(const ChildHandler &)
{
}
+
ChildRef
ModelPartForEnumBase::GetAnonChildRef(const HookFilter &)
{
return ChildRef();
}
+
ChildRef
ModelPartForEnumBase::GetChildRef(std::string_view, const HookFilter &, bool)
{
return ChildRef();
}
+
bool
ModelPartForEnumBase::HasValue() const
{
return true;
}
+
ModelPartType
ModelPartForEnumBase::GetType() const
{
return type;
}
+
const ModelPartType ModelPartForEnumBase::type = ModelPartType::Simple;
bool
@@ -362,11 +384,13 @@ namespace Slicer {
{
return true;
}
+
ModelPartType
ModelPartForSequenceBase::GetType() const
{
return type;
}
+
ChildRef
ModelPartForSequenceBase::GetChildRef(std::string_view name, const HookFilter & flt, bool matchCase)
{
@@ -375,6 +399,7 @@ namespace Slicer {
}
return GetAnonChildRef(flt);
}
+
const ModelPartType ModelPartForSequenceBase::type = ModelPartType::Sequence;
bool
@@ -382,11 +407,13 @@ namespace Slicer {
{
return true;
}
+
ModelPartType
ModelPartForDictionaryBase::GetType() const
{
return type;
}
+
const ModelPartType ModelPartForDictionaryBase::type = ModelPartType::Dictionary;
// Streams
@@ -396,41 +423,49 @@ namespace Slicer {
{
throw InvalidStreamOperation(__FUNCTION__);
}
+
// NOLINTNEXTLINE(hicpp-no-array-decay)
ChildRef
ModelPartForStreamBase::GetChildRef(std::string_view, const Slicer::HookFilter &, bool)
{
throw InvalidStreamOperation(__FUNCTION__);
}
+
ModelPartType
ModelPartForStreamBase::GetType() const
{
return ModelPartType::Sequence;
}
+
bool
ModelPartForStreamBase::HasValue() const
{
return true;
}
+
// Stream Roots
ModelPartForStreamRootBase::ModelPartForStreamRootBase(const ModelPartPtr & m) : ModelPartForRootBase(m) { }
+
// NOLINTNEXTLINE(hicpp-no-array-decay)
void
ModelPartForStreamRootBase::Write(Ice::OutputStream &) const
{
throw InvalidStreamOperation(__FUNCTION__);
}
+
// NOLINTNEXTLINE(hicpp-no-array-decay)
void
ModelPartForStreamRootBase::Read(Ice::InputStream &)
{
throw InvalidStreamOperation(__FUNCTION__);
}
+
bool
ModelPartForStreamRootBase::HasValue() const
{
return mp->HasValue();
}
+
void
ModelPartForStreamRootBase::OnEachChild(const ChildHandler & ch)
{
diff --git a/slicer/slicer/modelPartsTypes.h b/slicer/slicer/modelPartsTypes.h
index 0355c62..7e84794 100644
--- a/slicer/slicer/modelPartsTypes.h
+++ b/slicer/slicer/modelPartsTypes.h
@@ -154,6 +154,7 @@ namespace Slicer {
};
template<typename T> class Hooks;
+
template<typename T> class ModelPartForComplex : public ModelPartForComplexBase {
public:
class HookBase;
diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h
index 5423152..95d0a37 100644
--- a/slicer/slicer/modelPartsTypes.impl.h
+++ b/slicer/slicer/modelPartsTypes.impl.h
@@ -26,6 +26,7 @@
#include <utility>
#include <vector>
#include <visibility.h>
+
// IWYU pragma: no_forward_declare Slicer::EnumMap
namespace Ice {
class Object;
@@ -405,6 +406,7 @@ namespace Slicer {
{
static_assert(sizeof...(MD) == N, "Wrong amount of metadata");
}
+
~Hook() override = default;
SPECIAL_MEMBERS_DEFAULT(Hook);
diff --git a/slicer/slicer/serializer.h b/slicer/slicer/serializer.h
index 27d70a6..f26a914 100644
--- a/slicer/slicer/serializer.h
+++ b/slicer/slicer/serializer.h
@@ -8,6 +8,7 @@
#include <memory>
#include <slicer/modelParts.h>
#include <visibility.h>
+
// IWYU pragma: no_include "factory.impl.h"
namespace Slicer {
@@ -20,6 +21,7 @@ namespace Slicer {
virtual void Serialize(ModelPartForRootPtr) = 0;
};
+
using SerializerPtr = std::shared_ptr<Serializer>;
class DLL_PUBLIC Deserializer {
@@ -31,6 +33,7 @@ namespace Slicer {
virtual void Deserialize(ModelPartForRootPtr) = 0;
};
+
using DeserializerPtr = std::shared_ptr<Deserializer>;
using StreamSerializerFactory = AdHoc::Factory<Serializer, std::ostream &>;
diff --git a/slicer/slicer/slicer.cpp b/slicer/slicer/slicer.cpp
index b36d6c6..6f890c3 100644
--- a/slicer/slicer/slicer.cpp
+++ b/slicer/slicer/slicer.cpp
@@ -29,6 +29,7 @@ namespace Slicer {
}
AdHocFormatter(InvalidEnumerationSymbolMsg, "Invalid enumeration symbol [%?] for type [%?]");
+
void
InvalidEnumerationSymbol::ice_print(std::ostream & s) const
{
@@ -36,6 +37,7 @@ namespace Slicer {
}
AdHocFormatter(InvalidEnumerationValueMsg, "Invalid enumeration symbol [%?] for type [%?]");
+
void
InvalidEnumerationValue::ice_print(std::ostream & s) const
{
@@ -43,6 +45,7 @@ namespace Slicer {
}
AdHocFormatter(UnknownTypeMsg, "Unknown type [%?]");
+
void
UnknownType::ice_print(std::ostream & s) const
{
@@ -50,6 +53,7 @@ namespace Slicer {
}
AdHocFormatter(NoConversionFoundMsg, "No conversion found for type [%?]");
+
void
NoConversionFound::ice_print(std::ostream & s) const
{
@@ -69,6 +73,7 @@ namespace Slicer {
}
AdHocFormatter(IncorrectElementNameMsg, "Incorrect element name [%?]");
+
void
IncorrectElementName::ice_print(std::ostream & s) const
{
@@ -94,6 +99,7 @@ namespace Slicer {
}
AdHocFormatter(CompilerErrorMsg, "Slicer compiler: %?");
+
void
CompilerError::ice_print(std::ostream & s) const
{
@@ -101,6 +107,7 @@ namespace Slicer {
}
AdHocFormatter(InvalidStreamOperationMsg, "%? is not valid on streams");
+
void
InvalidStreamOperation::ice_print(std::ostream & s) const
{
@@ -108,6 +115,7 @@ namespace Slicer {
}
AdHocFormatter(AbstractClassExceptionMsg, "%? is an abstract class");
+
void
AbstractClassException::ice_print(std::ostream & s) const
{
diff --git a/slicer/test/conversions.cpp b/slicer/test/conversions.cpp
index 6e74e26..a296197 100644
--- a/slicer/test/conversions.cpp
+++ b/slicer/test/conversions.cpp
@@ -13,6 +13,7 @@
#include <visibility.h>
#define SHORT(x) boost::numeric_cast<::Ice::Short, int64_t>(x)
+
inline auto
USHORT(std::integral auto x)
{
@@ -40,8 +41,8 @@ namespace Slicer {
std::string
isoDateToString(const ::TestModule::IsoDate & in)
{
- struct tm tm {
- };
+ struct tm tm { };
+
tm.tm_mday = in.day;
tm.tm_mon = in.month - 1;
tm.tm_year = in.year - 1900;
@@ -56,8 +57,8 @@ namespace Slicer {
::TestModule::IsoDate
stringToIsoDate(const std::string & in)
{
- struct tm tm {
- };
+ struct tm tm { };
+
auto end = strptime(in.c_str(), "%Y-%m-%d", &tm);
if (!end || *end) {
// LCOV_EXCL_START
@@ -71,8 +72,8 @@ namespace Slicer {
std::string
dateTimeToString(const ::TestModule::DateTime & in)
{
- struct tm tm {
- };
+ struct tm tm { };
+
tm.tm_sec = in.second;
tm.tm_min = in.minute;
tm.tm_hour = in.hour;
@@ -91,8 +92,8 @@ namespace Slicer {
::TestModule::DateTime
stringToDateTime(const std::string & in)
{
- struct tm tm {
- };
+ struct tm tm { };
+
auto end = strptime(in.c_str(), "%Y-%b-%d %H:%M:%S", &tm);
if (!end || *end) {
// LCOV_EXCL_START
@@ -171,6 +172,7 @@ namespace TestModule {
completions += 1;
}
}
+
namespace Slicer {
template<>
DLL_PUBLIC ModelPartPtr
diff --git a/slicer/test/conversions.h b/slicer/test/conversions.h
index cb46b93..bfa1c4b 100644
--- a/slicer/test/conversions.h
+++ b/slicer/test/conversions.h
@@ -28,6 +28,7 @@ namespace TestModule {
void Complete() override;
};
}
+
namespace Slicer {
DLL_PUBLIC
::TestModule::DateTime stringToDateTime(const std::string & in);
diff --git a/slicer/test/serializers.cpp b/slicer/test/serializers.cpp
index 6efc02b..379551b 100644
--- a/slicer/test/serializers.cpp
+++ b/slicer/test/serializers.cpp
@@ -50,6 +50,7 @@ namespace fs = std::filesystem;
// LCOV_EXCL_START
BOOST_TEST_DONT_PRINT_LOG_VALUE(TestModule::ClassMap::iterator)
BOOST_TEST_DONT_PRINT_LOG_VALUE(TestModule::SomeNumbers)
+
namespace std {
template<typename T>
ostream &
@@ -58,6 +59,7 @@ namespace std {
return s;
}
}
+
// LCOV_EXCL_STOP
class FileBased {
diff --git a/slicer/tool/icemetadata.cpp b/slicer/tool/icemetadata.cpp
index cecf703..4804542 100644
--- a/slicer/tool/icemetadata.cpp
+++ b/slicer/tool/icemetadata.cpp
@@ -1,6 +1,7 @@
#include "icemetadata.h"
#include <algorithm>
#include <slicer/metadata.h>
+
// IWYU pragma: no_include <list>
namespace Slicer {
diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp
index ec94a43..28252b5 100644
--- a/slicer/tool/parser.cpp
+++ b/slicer/tool/parser.cpp
@@ -53,26 +53,31 @@ namespace Slicer {
{
return countIfUsed(c, classes, !c->isInterface());
}
+
[[nodiscard]] bool
visitStructStart(const Slice::StructPtr & s) override
{
return countIfUsed(s, structs);
}
+
void
visitSequence(const Slice::SequencePtr & s) override
{
countIfUsed(s, sequences);
}
+
void
visitDictionary(const Slice::DictionaryPtr & d) override
{
countIfUsed(d, dictionaries);
}
+
void
visitEnum(const Slice::EnumPtr & e) override
{
countIfUsed(e, enums);
}
+
[[nodiscard]] auto
complexes() const
{
diff --git a/slicer/tool/parser.h b/slicer/tool/parser.h
index a784d7a..e56c90a 100644
--- a/slicer/tool/parser.h
+++ b/slicer/tool/parser.h
@@ -10,6 +10,7 @@
#include <string_view>
#include <vector>
#include <visibility.h>
+
// IWYU pragma: no_include <boost/iterator/transform_iterator.hpp>
namespace Slicer {
@@ -27,6 +28,7 @@ namespace Slicer {
public:
struct Args : public SplitString {
explicit inline Args(std::string_view in) : SplitString {in, ","} { }
+
using SplitString::SplitString;
};
diff --git a/slicer/xml/serializer.cpp b/slicer/xml/serializer.cpp
index 96c1a9f..1ffa897 100644
--- a/slicer/xml/serializer.cpp
+++ b/slicer/xml/serializer.cpp
@@ -119,6 +119,7 @@ namespace Slicer {
class XmlContentValueSource : public XmlValueSource {
public:
explicit XmlContentValueSource() : XmlValueSource(Glib::ustring()) { }
+
explicit XmlContentValueSource(const xmlpp::ContentNode * c) : XmlValueSource(c->get_content()) { }
};
@@ -474,6 +475,7 @@ namespace Slicer {
}
AdHocFormatter(BadBooleanValueMsg, "Bad boolean value [%?]");
+
void
BadBooleanValue::ice_print(std::ostream & s) const
{
diff --git a/slicer/xml/serializer.h b/slicer/xml/serializer.h
index d07a77e..23a6140 100644
--- a/slicer/xml/serializer.h
+++ b/slicer/xml/serializer.h
@@ -19,6 +19,7 @@
#include <slicer/serializer.h>
#include <string>
#include <visibility.h>
+
namespace Glib {
class ustring;
}
diff --git a/slicer/xml/testSpecifics.cpp b/slicer/xml/testSpecifics.cpp
index e2d7691..ec9fe11 100644
--- a/slicer/xml/testSpecifics.cpp
+++ b/slicer/xml/testSpecifics.cpp
@@ -16,6 +16,7 @@
#include <slicer/slicer.h>
#include <typeinfo>
#include <xmlExceptions.h>
+
// IWYU pragma: no_forward_declare Slicer::BadBooleanValue
// IWYU pragma: no_forward_declare Slicer::XmlDocumentDeserializer