1 /* 2 * Copyright (C) 2025 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 #define MLOG_TAG "MEDIA_CLOUD_DTO" 17 18 #include "check_file_data_dto.h" 19 20 #include <sstream> 21 22 namespace OHOS::Media::CloudSync { ToString() const23std::string CheckFileDataDto::FileData::ToString() const 24 { 25 std::stringstream ss; 26 ss << "{" 27 << "\"recordId\": \"" << this->recordId << "\", " 28 << "\"isDelete\": " << this->isDelete << ", " 29 << "\"version\": " << this->version << "\"" 30 << "}"; 31 return ss.str(); 32 } 33 ToString() const34std::string CheckFileDataDto::ToString() const 35 { 36 std::stringstream ss; 37 ss << "{" 38 << "\"fileDataList\": ["; 39 for (size_t i = 0; i < this->fileDataList.size(); i++) { 40 ss << this->fileDataList[i].ToString(); 41 if (i != this->fileDataList.size() - 1) { 42 ss << ", "; 43 } 44 } 45 ss << "]" 46 << "}"; 47 return ss.str(); 48 } 49 } // namespace OHOS::Media::CloudSync