• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #define MLOG_TAG "Media_Client"
16 
17 #include "mdk_record_photos_data.h"
18 
19 #include <string>
20 
21 #include "media_log.h"
22 #include "media_column.h"
23 
24 namespace OHOS::Media::CloudSync {
MDKRecordPhotosData(const MDKRecord & record)25 MDKRecordPhotosData::MDKRecordPhotosData(const MDKRecord &record)
26 {
27     this->UnMarshalling(record);
28 }
UnMarshalling(const MDKRecord & record)29 void MDKRecordPhotosData::UnMarshalling(const MDKRecord &record)
30 {
31     this->record_ = record;
32     this->record_.GetRecordData(this->fields_);
33     if (this->fields_.find(this->KEY_PROPERTIES) != this->fields_.end()) {
34         this->fields_[this->KEY_PROPERTIES].GetRecordMap(this->properties_);
35     }
36     if (this->fields_.find(this->KEY_ATTRIBUTES) != this->fields_.end()) {
37         this->fields_[this->KEY_ATTRIBUTES].GetRecordMap(this->attributes_);
38     }
39 }
Marshalling()40 void MDKRecordPhotosData::Marshalling()
41 {
42     if (this->properties_.size() > 0) {
43         this->fields_[this->KEY_PROPERTIES] = MDKRecordField(this->properties_);
44     }
45     if (this->attributes_.size() > 0) {
46         this->fields_[this->KEY_ATTRIBUTES] = MDKRecordField(this->attributes_);
47     }
48     this->record_.SetRecordData(this->fields_);
49     this->record_.SetRecordType(this->VALUE_RECORD_TYPE);
50 }
51 
GetDKRecord()52 MDKRecord MDKRecordPhotosData::GetDKRecord()
53 {
54     this->Marshalling();
55     return this->record_;
56 }
SetDKRecord(MDKRecord & record)57 void MDKRecordPhotosData::SetDKRecord(MDKRecord &record)
58 {
59     this->record_ = record;
60     record.GetRecordData(this->fields_);
61 }
GetType() const62 std::optional<std::string> MDKRecordPhotosData::GetType() const
63 {
64     return this->recordReader_.GetStringValue(this->fields_, this->KEY_TYPE);
65 }
66 // type, "directory" or "file"
SetType(const std::string & type)67 void MDKRecordPhotosData::SetType(const std::string &type)
68 {
69     this->fields_[this->KEY_TYPE] = MDKRecordField(type);
70 }
71 
GetFileId() const72 std::optional<int32_t> MDKRecordPhotosData::GetFileId() const
73 {
74     return this->recordReader_.GetIntValue(this->attributes_, FILE_ID);
75 }
SetFileId(const int32_t fileId)76 MDKRecordPhotosData &MDKRecordPhotosData::SetFileId(const int32_t fileId)
77 {
78     this->attributes_[FILE_ID] = MDKRecordField(fileId);
79     return *this;
80 }
GetLocalId() const81 std::optional<int32_t> MDKRecordPhotosData::GetLocalId() const
82 {
83     return this->recordReader_.GetIntValue(this->fields_, FILE_LOCAL_ID);
84 }
SetLocalId(const int32_t localId)85 MDKRecordPhotosData &MDKRecordPhotosData::SetLocalId(const int32_t localId)
86 {
87     this->fields_[FILE_LOCAL_ID] = MDKRecordField(localId);
88     return *this;
89 }
GetFileType() const90 std::optional<int32_t> MDKRecordPhotosData::GetFileType() const
91 {
92     return this->recordReader_.GetIntValue(this->fields_, "fileType");
93 }
SetFileType(const int32_t & fileType)94 MDKRecordPhotosData &MDKRecordPhotosData::SetFileType(const int32_t &fileType)
95 {
96     this->fields_["fileType"] = MDKRecordField(fileType);
97     return *this;
98 }
GetFileName() const99 std::optional<std::string> MDKRecordPhotosData::GetFileName() const
100 {
101     return this->recordReader_.GetStringValue(this->fields_, "fileName");
102 }
SetFileName(const std::string & fileName)103 void MDKRecordPhotosData::SetFileName(const std::string &fileName)
104 {
105     this->fields_["fileName"] = MDKRecordField(fileName);
106 }
GetCreatedTime() const107 std::optional<int64_t> MDKRecordPhotosData::GetCreatedTime() const
108 {
109     return this->recordReader_.GetLongValue(this->fields_, "createdTime");
110 }
SetCreatedTime(const int64_t & createdTime)111 void MDKRecordPhotosData::SetCreatedTime(const int64_t &createdTime)
112 {
113     this->fields_["createdTime"] = MDKRecordField(createdTime);
114 }
GetHashId() const115 std::optional<std::string> MDKRecordPhotosData::GetHashId() const
116 {
117     return this->recordReader_.GetStringValue(this->fields_, "hashId");
118 }
SetHashId(const std::string & hashId)119 void MDKRecordPhotosData::SetHashId(const std::string &hashId)
120 {
121     this->fields_["hashId"] = MDKRecordField(hashId);
122 }
GetSize() const123 std::optional<int64_t> MDKRecordPhotosData::GetSize() const
124 {
125     return this->recordReader_.GetLongValue(this->fields_, "size");
126 }
SetSize(const int64_t & size)127 void MDKRecordPhotosData::SetSize(const int64_t &size)
128 {
129     this->fields_["size"] = MDKRecordField(size);
130 }
GetSource() const131 std::optional<std::string> MDKRecordPhotosData::GetSource() const
132 {
133     return this->recordReader_.GetStringValue(this->fields_, "source");
134 }
SetSource(const std::string & source)135 void MDKRecordPhotosData::SetSource(const std::string &source)
136 {
137     this->fields_["source"] = MDKRecordField(source);
138 }
GetRecycled() const139 std::optional<bool> MDKRecordPhotosData::GetRecycled() const
140 {
141     return this->recordReader_.GetBoolValue(this->fields_, "recycled");
142 }
SetRecycled(const bool & recycled)143 void MDKRecordPhotosData::SetRecycled(const bool &recycled)
144 {
145     this->fields_["recycled"] = MDKRecordField(recycled);
146 }
GetRecycledTime() const147 std::optional<int64_t> MDKRecordPhotosData::GetRecycledTime() const
148 {
149     return this->recordReader_.GetLongValue(this->fields_, "recycledTime");
150 }
SetRecycledTime(const int64_t & recycledTime)151 void MDKRecordPhotosData::SetRecycledTime(const int64_t &recycledTime)
152 {
153     this->fields_["recycledTime"] = MDKRecordField(recycledTime);
154 }
GetFavorite() const155 std::optional<bool> MDKRecordPhotosData::GetFavorite() const
156 {
157     return this->recordReader_.GetBoolValue(this->fields_, "favorite");
158 }
SetFavorite(const bool & favorite)159 void MDKRecordPhotosData::SetFavorite(const bool &favorite)
160 {
161     this->fields_["favorite"] = MDKRecordField(favorite);
162 }
GetDescription() const163 std::optional<std::string> MDKRecordPhotosData::GetDescription() const
164 {
165     return this->recordReader_.GetStringValue(this->fields_, "description");
166 }
SetDescription(const std::string & description)167 void MDKRecordPhotosData::SetDescription(const std::string &description)
168 {
169     this->fields_["description"] = MDKRecordField(description);
170 }
GetMimeType() const171 std::optional<std::string> MDKRecordPhotosData::GetMimeType() const
172 {
173     return this->recordReader_.GetStringValue(this->fields_, FILE_MIME_TYPE);
174 }
SetMimeType(const std::string & mimeType)175 void MDKRecordPhotosData::SetMimeType(const std::string &mimeType)
176 {
177     this->fields_[MediaColumn::MEDIA_MIME_TYPE] = MDKRecordField(mimeType);
178 }
GetFileContent() const179 std::optional<MDKAsset> MDKRecordPhotosData::GetFileContent() const
180 {
181     return this->recordReader_.GetAssetValue(this->fields_, FILE_CONTENT);
182 }
SetFileContent(const MDKAsset & asset)183 void MDKRecordPhotosData::SetFileContent(const MDKAsset &asset)
184 {
185     this->fields_[FILE_CONTENT] = MDKRecordField(asset);
186 }
GetFileRaw() const187 std::optional<MDKAsset> MDKRecordPhotosData::GetFileRaw() const
188 {
189     return this->recordReader_.GetAssetValue(this->fields_, FILE_RAW);
190 }
SetFileRaw(const MDKAsset & asset)191 void MDKRecordPhotosData::SetFileRaw(const MDKAsset &asset)
192 {
193     this->fields_[FILE_RAW] = MDKRecordField(asset);
194 }
GetFileEditData() const195 std::optional<MDKAsset> MDKRecordPhotosData::GetFileEditData() const
196 {
197     return this->recordReader_.GetAssetValue(this->fields_, FILE_EDIT_DATA);
198 }
SetFileEditData(const MDKAsset & asset)199 void MDKRecordPhotosData::SetFileEditData(const MDKAsset &asset)
200 {
201     this->fields_[FILE_EDIT_DATA] = MDKRecordField(asset);
202 }
203 
GetTitle() const204 std::optional<std::string> MDKRecordPhotosData::GetTitle() const
205 {
206     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::MEDIA_TITLE);
207 }
SetTitle(const std::string & title)208 MDKRecordPhotosData &MDKRecordPhotosData::SetTitle(const std::string &title)
209 {
210     this->attributes_[PhotoColumn::MEDIA_TITLE] = MDKRecordField(title);
211     return *this;
212 }
GetMediaType() const213 std::optional<int32_t> MDKRecordPhotosData::GetMediaType() const
214 {
215     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::MEDIA_TYPE);
216 }
SetMediaType(const int32_t mediaType)217 MDKRecordPhotosData &MDKRecordPhotosData::SetMediaType(const int32_t mediaType)
218 {
219     this->attributes_[PhotoColumn::MEDIA_TYPE] = MDKRecordField(mediaType);
220     return *this;
221 }
GetDuration() const222 std::optional<int32_t> MDKRecordPhotosData::GetDuration() const
223 {
224     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::MEDIA_DURATION);
225 }
SetDuration(const int32_t duration)226 MDKRecordPhotosData &MDKRecordPhotosData::SetDuration(const int32_t duration)
227 {
228     this->attributes_[PhotoColumn::MEDIA_DURATION] = MDKRecordField(duration);
229     return *this;
230 }
GetPropertiesDuration() const231 std::optional<int32_t> MDKRecordPhotosData::GetPropertiesDuration() const
232 {
233     return this->recordReader_.GetIntValue(this->properties_, PhotoColumn::MEDIA_DURATION);
234 }
SetPropertiesDuration(const int32_t duration)235 MDKRecordPhotosData &MDKRecordPhotosData::SetPropertiesDuration(const int32_t duration)
236 {
237     this->properties_[PhotoColumn::MEDIA_DURATION] = MDKRecordField(duration);
238     return *this;
239 }
GetHidden() const240 std::optional<int32_t> MDKRecordPhotosData::GetHidden() const
241 {
242     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::MEDIA_HIDDEN);
243 }
SetHidden(const int32_t hidden)244 MDKRecordPhotosData &MDKRecordPhotosData::SetHidden(const int32_t hidden)
245 {
246     this->attributes_[PhotoColumn::MEDIA_HIDDEN] = MDKRecordField(hidden);
247     return *this;
248 }
GetHiddenTime() const249 std::optional<int64_t> MDKRecordPhotosData::GetHiddenTime() const
250 {
251     return this->recordReader_.GetLongValue(this->attributes_, PhotoColumn::PHOTO_HIDDEN_TIME);
252 }
SetHiddenTime(const int64_t hiddenTime)253 MDKRecordPhotosData &MDKRecordPhotosData::SetHiddenTime(const int64_t hiddenTime)
254 {
255     this->attributes_[PhotoColumn::PHOTO_HIDDEN_TIME] = MDKRecordField(hiddenTime);
256     return *this;
257 }
GetRelativePath() const258 std::optional<std::string> MDKRecordPhotosData::GetRelativePath() const
259 {
260     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::MEDIA_RELATIVE_PATH);
261 }
SetRelativePath(const std::string & relativePath)262 MDKRecordPhotosData &MDKRecordPhotosData::SetRelativePath(const std::string &relativePath)
263 {
264     this->attributes_[PhotoColumn::MEDIA_RELATIVE_PATH] = MDKRecordField(relativePath);
265     return *this;
266 }
GetVirtualPath() const267 std::optional<std::string> MDKRecordPhotosData::GetVirtualPath() const
268 {
269     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::MEDIA_VIRTURL_PATH);
270 }
SetVirtualPath(const std::string & virtualPath)271 MDKRecordPhotosData &MDKRecordPhotosData::SetVirtualPath(const std::string &virtualPath)
272 {
273     this->attributes_[PhotoColumn::MEDIA_VIRTURL_PATH] = MDKRecordField(virtualPath);
274     return *this;
275 }
GetDateModified() const276 std::optional<int64_t> MDKRecordPhotosData::GetDateModified() const
277 {
278     return this->recordReader_.GetLongValue(this->attributes_, PhotoColumn::MEDIA_DATE_MODIFIED);
279 }
SetDateModified(const int64_t dateModified)280 MDKRecordPhotosData &MDKRecordPhotosData::SetDateModified(const int64_t dateModified)
281 {
282     this->attributes_[PhotoColumn::MEDIA_DATE_MODIFIED] = MDKRecordField(dateModified);
283     return *this;
284 }
GetPhotoMetaDateModified() const285 std::optional<int64_t> MDKRecordPhotosData::GetPhotoMetaDateModified() const
286 {
287     return this->recordReader_.GetLongValue(this->attributes_, PhotoColumn::PHOTO_META_DATE_MODIFIED);
288 }
SetPhotoMetaDateModified(const int64_t dateModified)289 MDKRecordPhotosData &MDKRecordPhotosData::SetPhotoMetaDateModified(const int64_t dateModified)
290 {
291     this->attributes_[PhotoColumn::PHOTO_META_DATE_MODIFIED] = MDKRecordField(dateModified);
292     return *this;
293 }
GetSubType() const294 std::optional<int32_t> MDKRecordPhotosData::GetSubType() const
295 {
296     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::PHOTO_SUBTYPE);
297 }
SetSubType(const int32_t subType)298 MDKRecordPhotosData &MDKRecordPhotosData::SetSubType(const int32_t subType)
299 {
300     this->attributes_[PhotoColumn::PHOTO_SUBTYPE] = MDKRecordField(subType);
301     return *this;
302 }
GetBurstCoverLevel() const303 std::optional<int32_t> MDKRecordPhotosData::GetBurstCoverLevel() const
304 {
305     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::PHOTO_BURST_COVER_LEVEL);
306 }
SetBurstCoverLevel(const int32_t burstCoverLevel)307 MDKRecordPhotosData &MDKRecordPhotosData::SetBurstCoverLevel(const int32_t burstCoverLevel)
308 {
309     this->attributes_[PhotoColumn::PHOTO_BURST_COVER_LEVEL] = MDKRecordField(burstCoverLevel);
310     return *this;
311 }
GetBurstKey() const312 std::optional<std::string> MDKRecordPhotosData::GetBurstKey() const
313 {
314     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::PHOTO_BURST_KEY);
315 }
SetBurstKey(const std::string & burstKey)316 MDKRecordPhotosData &MDKRecordPhotosData::SetBurstKey(const std::string &burstKey)
317 {
318     this->attributes_[PhotoColumn::PHOTO_BURST_KEY] = MDKRecordField(burstKey);
319     return *this;
320 }
GetDateYear() const321 std::optional<std::string> MDKRecordPhotosData::GetDateYear() const
322 {
323     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::PHOTO_DATE_YEAR);
324 }
SetDateYear(const std::string & dateYear)325 MDKRecordPhotosData &MDKRecordPhotosData::SetDateYear(const std::string &dateYear)
326 {
327     this->attributes_[PhotoColumn::PHOTO_DATE_YEAR] = MDKRecordField(dateYear);
328     return *this;
329 }
GetDateMonth() const330 std::optional<std::string> MDKRecordPhotosData::GetDateMonth() const
331 {
332     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::PHOTO_DATE_MONTH);
333 }
SetDateMonth(const std::string & dateMonth)334 MDKRecordPhotosData &MDKRecordPhotosData::SetDateMonth(const std::string &dateMonth)
335 {
336     this->attributes_[PhotoColumn::PHOTO_DATE_MONTH] = MDKRecordField(dateMonth);
337     return *this;
338 }
GetDateDay() const339 std::optional<std::string> MDKRecordPhotosData::GetDateDay() const
340 {
341     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::PHOTO_DATE_DAY);
342 }
SetDateDay(const std::string & dateDay)343 MDKRecordPhotosData &MDKRecordPhotosData::SetDateDay(const std::string &dateDay)
344 {
345     this->attributes_[PhotoColumn::PHOTO_DATE_DAY] = MDKRecordField(dateDay);
346     return *this;
347 }
GetShootingMode() const348 std::optional<std::string> MDKRecordPhotosData::GetShootingMode() const
349 {
350     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::PHOTO_SHOOTING_MODE);
351 }
SetShootingMode(const std::string & shootingMode)352 MDKRecordPhotosData &MDKRecordPhotosData::SetShootingMode(const std::string &shootingMode)
353 {
354     this->attributes_[PhotoColumn::PHOTO_SHOOTING_MODE] = MDKRecordField(shootingMode);
355     return *this;
356 }
GetShootingModeTag() const357 std::optional<std::string> MDKRecordPhotosData::GetShootingModeTag() const
358 {
359     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::PHOTO_SHOOTING_MODE_TAG);
360 }
SetShootingModeTag(const std::string & shootingModeTag)361 MDKRecordPhotosData &MDKRecordPhotosData::SetShootingModeTag(const std::string &shootingModeTag)
362 {
363     this->attributes_[PhotoColumn::PHOTO_SHOOTING_MODE_TAG] = MDKRecordField(shootingModeTag);
364     return *this;
365 }
GetDynamicRangeType() const366 std::optional<int32_t> MDKRecordPhotosData::GetDynamicRangeType() const
367 {
368     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::PHOTO_DYNAMIC_RANGE_TYPE);
369 }
SetDynamicRangeType(const int32_t dynamicRangeType)370 MDKRecordPhotosData &MDKRecordPhotosData::SetDynamicRangeType(const int32_t dynamicRangeType)
371 {
372     this->attributes_[PhotoColumn::PHOTO_DYNAMIC_RANGE_TYPE] = MDKRecordField(dynamicRangeType);
373     return *this;
374 }
GetFrontCamera() const375 std::optional<std::string> MDKRecordPhotosData::GetFrontCamera() const
376 {
377     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::PHOTO_FRONT_CAMERA);
378 }
SetFrontCamera(const std::string & frontCamera)379 MDKRecordPhotosData &MDKRecordPhotosData::SetFrontCamera(const std::string &frontCamera)
380 {
381     this->attributes_[PhotoColumn::PHOTO_FRONT_CAMERA] = MDKRecordField(frontCamera);
382     return *this;
383 }
GetEditTime() const384 std::optional<int64_t> MDKRecordPhotosData::GetEditTime() const
385 {
386     return this->recordReader_.GetLongValue(this->attributes_, PhotoColumn::PHOTO_EDIT_TIME);
387 }
SetEditTime(const int64_t editTime)388 MDKRecordPhotosData &MDKRecordPhotosData::SetEditTime(const int64_t editTime)
389 {
390     this->attributes_[PhotoColumn::PHOTO_EDIT_TIME] = MDKRecordField(editTime);
391     return *this;
392 }
GetOriginalSubType() const393 std::optional<int32_t> MDKRecordPhotosData::GetOriginalSubType() const
394 {
395     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::PHOTO_ORIGINAL_SUBTYPE);
396 }
SetOriginalSubType(const int32_t originalSubType)397 MDKRecordPhotosData &MDKRecordPhotosData::SetOriginalSubType(const int32_t originalSubType)
398 {
399     this->attributes_[PhotoColumn::PHOTO_ORIGINAL_SUBTYPE] = MDKRecordField(originalSubType);
400     return *this;
401 }
GetCoverPosition() const402 std::optional<int64_t> MDKRecordPhotosData::GetCoverPosition() const
403 {
404     return this->recordReader_.GetLongValue(this->attributes_, PhotoColumn::PHOTO_COVER_POSITION);
405 }
SetCoverPosition(const int64_t coverPosition)406 MDKRecordPhotosData &MDKRecordPhotosData::SetCoverPosition(const int64_t coverPosition)
407 {
408     this->attributes_[PhotoColumn::PHOTO_COVER_POSITION] = MDKRecordField(coverPosition);
409     return *this;
410 }
GetIsRectificationCover() const411 std::optional<int32_t> MDKRecordPhotosData::GetIsRectificationCover() const
412 {
413     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::PHOTO_IS_RECTIFICATION_COVER);
414 }
SetIsRectificationCover(const int32_t isRectificationCover)415 MDKRecordPhotosData &MDKRecordPhotosData::SetIsRectificationCover(const int32_t isRectificationCover)
416 {
417     this->attributes_[PhotoColumn::PHOTO_IS_RECTIFICATION_COVER] = MDKRecordField(isRectificationCover);
418     return *this;
419 }
GetExifRotate() const420 std::optional<int32_t> MDKRecordPhotosData::GetExifRotate() const
421 {
422     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::PHOTO_EXIF_ROTATE);
423 }
SetExifRotate(const int32_t exifRotate)424 MDKRecordPhotosData &MDKRecordPhotosData::SetExifRotate(const int32_t exifRotate)
425 {
426     this->attributes_[PhotoColumn::PHOTO_EXIF_ROTATE] = MDKRecordField(exifRotate);
427     return *this;
428 }
GetMovingPhotoEffectMode() const429 std::optional<int32_t> MDKRecordPhotosData::GetMovingPhotoEffectMode() const
430 {
431     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::MOVING_PHOTO_EFFECT_MODE);
432 }
SetMovingPhotoEffectMode(const int32_t movingPhotoEffectMode)433 MDKRecordPhotosData &MDKRecordPhotosData::SetMovingPhotoEffectMode(const int32_t movingPhotoEffectMode)
434 {
435     this->attributes_[PhotoColumn::MOVING_PHOTO_EFFECT_MODE] = MDKRecordField(movingPhotoEffectMode);
436     return *this;
437 }
GetSupportedWatermarkType() const438 std::optional<int32_t> MDKRecordPhotosData::GetSupportedWatermarkType() const
439 {
440     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::SUPPORTED_WATERMARK_TYPE);
441 }
SetSupportedWatermarkType(const int32_t supportedWatermarkType)442 MDKRecordPhotosData &MDKRecordPhotosData::SetSupportedWatermarkType(const int32_t supportedWatermarkType)
443 {
444     this->attributes_[PhotoColumn::SUPPORTED_WATERMARK_TYPE] = MDKRecordField(supportedWatermarkType);
445     return *this;
446 }
GetStrongAssociation() const447 std::optional<int32_t> MDKRecordPhotosData::GetStrongAssociation() const
448 {
449     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::PHOTO_STRONG_ASSOCIATION);
450 }
SetStrongAssociation(const int32_t strongAssociation)451 MDKRecordPhotosData &MDKRecordPhotosData::SetStrongAssociation(const int32_t strongAssociation)
452 {
453     this->attributes_[PhotoColumn::PHOTO_STRONG_ASSOCIATION] = MDKRecordField(strongAssociation);
454     return *this;
455 }
GetCloudFileId() const456 std::optional<int32_t> MDKRecordPhotosData::GetCloudFileId() const
457 {
458     return this->recordReader_.GetIntValue(this->attributes_, MediaColumn::MEDIA_ID);
459 }
SetCloudFileId(const int32_t fileId)460 MDKRecordPhotosData &MDKRecordPhotosData::SetCloudFileId(const int32_t fileId)
461 {
462     this->attributes_[MediaColumn::MEDIA_ID] = MDKRecordField(fileId);
463     return *this;
464 }
GetCloudId() const465 std::optional<std::string> MDKRecordPhotosData::GetCloudId() const
466 {
467     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::PHOTO_CLOUD_ID);
468 }
SetCloudId(const std::string & cloudId)469 MDKRecordPhotosData &MDKRecordPhotosData::SetCloudId(const std::string &cloudId)
470 {
471     this->attributes_[PhotoColumn::PHOTO_CLOUD_ID] = MDKRecordField(cloudId);
472     return *this;
473 }
GetOriginalAssetCloudId() const474 std::optional<std::string> MDKRecordPhotosData::GetOriginalAssetCloudId() const
475 {
476     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::PHOTO_ORIGINAL_ASSET_CLOUD_ID);
477 }
SetOriginalAssetCloudId(const std::string & originalAssetCloudId)478 MDKRecordPhotosData &MDKRecordPhotosData::SetOriginalAssetCloudId(const std::string &originalAssetCloudId)
479 {
480     this->attributes_[PhotoColumn::PHOTO_ORIGINAL_ASSET_CLOUD_ID] = MDKRecordField(originalAssetCloudId);
481     return *this;
482 }
GetFilePath() const483 std::optional<std::string> MDKRecordPhotosData::GetFilePath() const
484 {
485     return this->recordReader_.GetStringValue(this->attributes_, PhotoColumn::MEDIA_FILE_PATH);
486 }
SetFilePath(const std::string & filePath)487 MDKRecordPhotosData &MDKRecordPhotosData::SetFilePath(const std::string &filePath)
488 {
489     this->attributes_[PhotoColumn::MEDIA_FILE_PATH] = MDKRecordField(filePath);
490     return *this;
491 }
GetDateAdded() const492 std::optional<int64_t> MDKRecordPhotosData::GetDateAdded() const
493 {
494     return this->recordReader_.GetLongValue(this->attributes_, PhotoColumn::MEDIA_DATE_ADDED);
495 }
SetDateAdded(const int64_t dateAdded)496 MDKRecordPhotosData &MDKRecordPhotosData::SetDateAdded(const int64_t dateAdded)
497 {
498     this->attributes_[PhotoColumn::MEDIA_DATE_ADDED] = MDKRecordField(dateAdded);
499     return *this;
500 }
GetOwnerAlbumId() const501 std::optional<int32_t> MDKRecordPhotosData::GetOwnerAlbumId() const
502 {
503     return this->recordReader_.GetIntValue(this->attributes_, PhotoColumn::PHOTO_OWNER_ALBUM_ID);
504 }
SetOwnerAlbumId(const int32_t ownerAlbumId)505 MDKRecordPhotosData &MDKRecordPhotosData::SetOwnerAlbumId(const int32_t ownerAlbumId)
506 {
507     this->attributes_[PhotoColumn::PHOTO_OWNER_ALBUM_ID] = MDKRecordField(ownerAlbumId);
508     return *this;
509 }
GetFixVersion() const510 std::optional<int64_t> MDKRecordPhotosData::GetFixVersion() const
511 {
512     return this->recordReader_.GetLongValue(this->attributes_, FILE_FIX_VERSION);
513 }
SetFixVersion(const int64_t fixVersion)514 MDKRecordPhotosData &MDKRecordPhotosData::SetFixVersion(const int64_t fixVersion)
515 {
516     this->attributes_[FILE_FIX_VERSION] = MDKRecordField(fixVersion);
517     return *this;
518 }
GetLcdSize() const519 std::optional<int64_t> MDKRecordPhotosData::GetLcdSize() const
520 {
521     return this->recordReader_.GetLongValue(this->attributes_, "lcd_size");
522 }
SetLcdSize(const int64_t lcdSize)523 MDKRecordPhotosData &MDKRecordPhotosData::SetLcdSize(const int64_t lcdSize)
524 {
525     this->attributes_["lcd_size"] = MDKRecordField(lcdSize);
526     return *this;
527 }
GetThmSize() const528 std::optional<int64_t> MDKRecordPhotosData::GetThmSize() const
529 {
530     return this->recordReader_.GetLongValue(this->attributes_, "thumb_size");
531 }
SetThmSize(const int64_t thmSize)532 MDKRecordPhotosData &MDKRecordPhotosData::SetThmSize(const int64_t thmSize)
533 {
534     this->attributes_["thumb_size"] = MDKRecordField(thmSize);
535     return *this;
536 }
GetFileEditDataCamera() const537 std::optional<std::string> MDKRecordPhotosData::GetFileEditDataCamera() const
538 {
539     return this->recordReader_.GetStringValue(this->attributes_, FILE_EDIT_DATA_CAMERA);
540 }
SetFileEditDataCamera(const std::string & fileEditDataCamera)541 MDKRecordPhotosData &MDKRecordPhotosData::SetFileEditDataCamera(const std::string &fileEditDataCamera)
542 {
543     this->attributes_[FILE_EDIT_DATA_CAMERA] = MDKRecordField(fileEditDataCamera);
544     return *this;
545 }
GetEditTimeMs() const546 std::optional<int64_t> MDKRecordPhotosData::GetEditTimeMs() const
547 {
548     return this->recordReader_.GetLongValue(this->attributes_, "editedTime_ms");
549 }
SetEditTimeMs(int64_t editedTimeMs)550 void MDKRecordPhotosData::SetEditTimeMs(int64_t editedTimeMs)
551 {
552     this->attributes_["editedTime_ms"] = MDKRecordField(editedTimeMs);
553 }
GetEditDataCamera() const554 std::optional<std::string> MDKRecordPhotosData::GetEditDataCamera() const
555 {
556     return this->recordReader_.GetStringValue(this->attributes_, "editDataCamera");
557 }
SetEditDataCamera(const std::string & editDataCamera)558 MDKRecordPhotosData &MDKRecordPhotosData::SetEditDataCamera(const std::string &editDataCamera)
559 {
560     this->attributes_["editDataCamera"] = MDKRecordField(editDataCamera);
561     return *this;
562 }
563 
GetSourcePath() const564 std::optional<std::string> MDKRecordPhotosData::GetSourcePath() const
565 {
566     return this->recordReader_.GetStringValue(this->properties_, "sourcePath");
567 }
SetSourcePath(const std::string & sourcePath)568 void MDKRecordPhotosData::SetSourcePath(const std::string &sourcePath)
569 {
570     this->properties_["sourcePath"] = MDKRecordField(sourcePath);
571 }
GetSourceFileName() const572 std::optional<std::string> MDKRecordPhotosData::GetSourceFileName() const
573 {
574     return this->recordReader_.GetStringValue(this->properties_, "sourceFileName");
575 }
SetSourceFileName(const std::string & sourceFileName)576 void MDKRecordPhotosData::SetSourceFileName(const std::string &sourceFileName)
577 {
578     this->properties_["sourceFileName"] = MDKRecordField(sourceFileName);
579 }
GetFirstUpdateTime() const580 std::optional<std::string> MDKRecordPhotosData::GetFirstUpdateTime() const
581 {
582     return this->recordReader_.GetStringValue(this->properties_, "first_update_time");
583 }
SetFirstUpdateTime(const std::string firstUpdateTime)584 void MDKRecordPhotosData::SetFirstUpdateTime(const std::string firstUpdateTime)
585 {
586     this->properties_["first_update_time"] = MDKRecordField(firstUpdateTime);
587 }
GetFileCreateTime() const588 std::optional<std::string> MDKRecordPhotosData::GetFileCreateTime() const
589 {
590     return this->recordReader_.GetStringValue(this->properties_, "fileCreateTime");
591 }
SetFileCreateTime(const std::string & fileCreateTime)592 void MDKRecordPhotosData::SetFileCreateTime(const std::string &fileCreateTime)
593 {
594     this->properties_["fileCreateTime"] = MDKRecordField(fileCreateTime);
595 }
GetDetailTime() const596 std::optional<std::string> MDKRecordPhotosData::GetDetailTime() const
597 {
598     return this->recordReader_.GetStringValue(this->properties_, "detail_time");
599 }
SetDetailTime(const std::string & detailTime)600 void MDKRecordPhotosData::SetDetailTime(const std::string &detailTime)
601 {
602     this->properties_["detail_time"] = MDKRecordField(detailTime);
603 }
GetHeight() const604 std::optional<int32_t> MDKRecordPhotosData::GetHeight() const
605 {
606     return this->recordReader_.GetIntValue(this->properties_, "height");
607 }
SetHeight(const int32_t & height)608 void MDKRecordPhotosData::SetHeight(const int32_t &height)
609 {
610     this->properties_["height"] = MDKRecordField(height);
611 }
GetWidth() const612 std::optional<int32_t> MDKRecordPhotosData::GetWidth() const
613 {
614     return this->recordReader_.GetIntValue(this->properties_, "width");
615 }
SetWidth(const int32_t & width)616 void MDKRecordPhotosData::SetWidth(const int32_t &width)
617 {
618     this->properties_["width"] = MDKRecordField(width);
619 }
GetFilePosition() const620 std::optional<std::string> MDKRecordPhotosData::GetFilePosition() const
621 {
622     return this->recordReader_.GetStringValue(this->properties_, "file_position");
623 }
SetFilePosition(const std::string & position)624 void MDKRecordPhotosData::SetFilePosition(const std::string &position)
625 {
626     this->properties_["file_position"] = MDKRecordField(position);
627 }
628 
GetPosition() const629 std::optional<std::string> MDKRecordPhotosData::GetPosition() const
630 {
631     return this->recordReader_.GetStringValue(this->properties_, "position");
632 }
633 
SetPosition(const std::string & position)634 void MDKRecordPhotosData::SetPosition(const std::string &position)
635 {
636     this->properties_["position"] = MDKRecordField(position);
637 }
638 
GetRotate() const639 std::optional<int32_t> MDKRecordPhotosData::GetRotate() const
640 {
641     return this->recordReader_.GetIntValue(this->properties_, "rotate");
642 }
SetRotate(const int32_t & rotate)643 void MDKRecordPhotosData::SetRotate(const int32_t &rotate)
644 {
645     this->properties_["rotate"] = MDKRecordField(rotate);
646 }
647 
hasAttributes()648 bool MDKRecordPhotosData::hasAttributes()
649 {
650     return !this->attributes_.empty();
651 }
652 
hasProperties()653 bool MDKRecordPhotosData::hasProperties()
654 {
655     return !this->properties_.empty();
656 }
657 }  // namespace OHOS::Media::CloudSync