diff --git a/datamgr_service/services/distributeddataservice/framework/include/store/general_store.h b/datamgr_service/services/distributeddataservice/framework/include/store/general_store.h index 59d02b8c156feb6f4f753db667ee4cd368894154..72cb4f662d9970c8dfc62d68d4fb02dc78bd3b24 100644 --- a/datamgr_service/services/distributeddataservice/framework/include/store/general_store.h +++ b/datamgr_service/services/distributeddataservice/framework/include/store/general_store.h @@ -24,7 +24,7 @@ namespace OHOS::DistributedData { class CloudDB; class AssetLoader; -class Database; +struct Database; class GeneralStore { public: using Watcher = GeneralWatcher; diff --git a/datamgr_service/services/distributeddataservice/service/rdb/rdb_cloud.h b/datamgr_service/services/distributeddataservice/service/rdb/rdb_cloud.h index 4dcdca811de69c4d907003d29c0fef6428a9cfca..0579853f352e22ee032df0ba1e15806760a8021b 100644 --- a/datamgr_service/services/distributeddataservice/service/rdb/rdb_cloud.h +++ b/datamgr_service/services/distributeddataservice/service/rdb/rdb_cloud.h @@ -26,7 +26,7 @@ public: using DBStatus = DistributedDB::DBStatus; using DBVBucket = DistributedDB::VBucket; - RdbCloud(std::shared_ptr cloudDB); + explicit RdbCloud(std::shared_ptr cloudDB); ~RdbCloud() = default; DBStatus BatchInsert(const std::string &tableName, std::vector &&record, std::vector &extend) override; diff --git a/datamgr_service/services/distributeddataservice/service/rdb/rdb_cursor.h b/datamgr_service/services/distributeddataservice/service/rdb/rdb_cursor.h index a8e19bfba9a81b3792a5c9c22926a325df3c1e27..f51a44929b42dded4a2cc3d9eba62c0a9a18a8ea 100644 --- a/datamgr_service/services/distributeddataservice/service/rdb/rdb_cursor.h +++ b/datamgr_service/services/distributeddataservice/service/rdb/rdb_cursor.h @@ -20,7 +20,7 @@ namespace OHOS::DistributedRdb { class RdbCursor : public DistributedData::Cursor { public: - RdbCursor(std::shared_ptr resultSet); + explicit RdbCursor(std::shared_ptr resultSet); ~RdbCursor(); int32_t GetColumnNames(std::vector &names) const override; int32_t GetColumnName(int32_t col, std::string &name) const override; diff --git a/datamgr_service/services/distributeddataservice/service/rdb/value_proxy.cpp b/datamgr_service/services/distributeddataservice/service/rdb/value_proxy.cpp index 07fae8991b2cb7da70491696aee367cb1d1d1fb6..dbd318e8f414ba03858c583980678f7944cd48e4 100644 --- a/datamgr_service/services/distributeddataservice/service/rdb/value_proxy.cpp +++ b/datamgr_service/services/distributeddataservice/service/rdb/value_proxy.cpp @@ -123,7 +123,7 @@ ValueProxy::Asset::Asset(DistributedData::Asset asset) ValueProxy::Asset::Asset(NativeRdb::AssetValue asset) { - asset_ = DistributedData::Asset{ .version = asset.version, + asset_ = DistributedData::Asset { .version = asset.version, .name = std::move(asset.name), .uri = std::move(asset.uri), .createTime = std::move(asset.createTime), @@ -134,7 +134,7 @@ ValueProxy::Asset::Asset(NativeRdb::AssetValue asset) ValueProxy::Asset::Asset(DistributedDB::Asset asset) { - asset_ = DistributedData::Asset{ .version = asset.version, + asset_ = DistributedData::Asset { .version = asset.version, .name = std::move(asset.name), .uri = std::move(asset.uri), .createTime = std::move(asset.createTime), @@ -163,7 +163,7 @@ ValueProxy::Asset &ValueProxy::Asset::operator=(Asset &&proxy) noexcept ValueProxy::Asset::operator NativeRdb::AssetValue() { - return NativeRdb::AssetValue{ .version = asset_.version, + return NativeRdb::AssetValue { .version = asset_.version, .name = std::move(asset_.name), .uri = std::move(asset_.uri), .createTime = std::move(asset_.createTime), @@ -179,7 +179,7 @@ ValueProxy::Asset::operator DistributedData::Asset() ValueProxy::Asset::operator DistributedDB::Asset() { - return DistributedDB::Asset{ .version = asset_.version, + return DistributedDB::Asset { .version = asset_.version, .name = std::move(asset_.name), .uri = std::move(asset_.uri), .modifyTime = std::move(asset_.modifyTime), diff --git a/datamgr_service/services/distributeddataservice/service/rdb/value_proxy.h b/datamgr_service/services/distributeddataservice/service/rdb/value_proxy.h index 861ff27e259db079e87ee240c08c9eca6e563bac..f501a205af5ae1e7588f460f5d9800f980901b20 100644 --- a/datamgr_service/services/distributeddataservice/service/rdb/value_proxy.h +++ b/datamgr_service/services/distributeddataservice/service/rdb/value_proxy.h @@ -36,9 +36,9 @@ public: { *this = proxy; }; - Asset(DistributedData::Asset asset); - Asset(NativeRdb::AssetValue asset); - Asset(DistributedDB::Asset asset); + explicit Asset(DistributedData::Asset asset); + explicit Asset(NativeRdb::AssetValue asset); + explicit Asset(DistributedDB::Asset asset); Asset &operator=(const Asset &proxy); Asset &operator=(Asset &&proxy) noexcept; operator NativeRdb::AssetValue(); @@ -60,9 +60,9 @@ public: { *this = proxy; }; - Assets(DistributedData::Assets assets); - Assets(NativeRdb::ValueObject::Assets assets); - Assets(DistributedDB::Assets assets); + explicit Assets(DistributedData::Assets assets); + explicit Assets(NativeRdb::ValueObject::Assets assets); + explicit Assets(DistributedDB::Assets assets); Assets &operator=(const Assets &proxy); Assets &operator=(Assets &&proxy) noexcept; operator NativeRdb::ValueObject::Assets();