1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_METADATA_STORE_DEBUG_INFO_H 17 #define OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_METADATA_STORE_DEBUG_INFO_H 18 #include "serializable/serializable.h" 19 #include <map> 20 namespace OHOS::DistributedData { 21 struct API_EXPORT StoreDebugInfo final : public Serializable { 22 struct FileInfo final : public Serializable { 23 uint64_t inode = 0; 24 int64_t size = 0; 25 uint32_t dev = 0; 26 uint32_t mode = 0; 27 uint32_t uid = 0; 28 uint32_t gid = 0; 29 bool Marshal(Serializable::json &node) const override; 30 bool Unmarshal(const Serializable::json &node) override; 31 32 }; 33 std::map<std::string, FileInfo> fileInfos; 34 API_EXPORT static std::string GetPrefix(const std::initializer_list<std::string> &fields); 35 bool Marshal(Serializable::json &node) const override; 36 bool Unmarshal(const Serializable::json &node) override; 37 private: 38 static constexpr const char *KEY_PREFIX = "StoreDebugInfo"; 39 }; 40 } // namespace OHOS::DistributedData 41 #endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_METADATA_STORE_DEBUG_INFO_H 42