• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 #include "file.h"
17 
18 namespace OHOS {
19 namespace UDMF {
File()20 File::File() : UnifiedRecord(FILE)
21 {
22 }
23 
File(const std::string & uri)24 File::File(const std::string &uri) : UnifiedRecord(FILE)
25 {
26     this->oriUri_ = uri;
27 }
28 
GetSize()29 int64_t File::GetSize()
30 {
31     return this->oriUri_.size() + this->remoteUri_.size();
32 }
33 
GetUri() const34 std::string File::GetUri() const
35 {
36     return this->oriUri_;
37 }
38 
SetUri(const std::string & uri)39 void File::SetUri(const std::string &uri)
40 {
41     this->oriUri_ = uri;
42 }
43 
GetRemoteUri() const44 std::string File::GetRemoteUri() const
45 {
46     return this->remoteUri_;
47 }
48 
SetRemoteUri(const std::string & uri)49 void File::SetRemoteUri(const std::string &uri)
50 {
51     this->remoteUri_ = uri;
52 }
53 
SetDetails(UDDetails & variantMap)54 void File::SetDetails(UDDetails &variantMap)
55 {
56     this->details_ = variantMap;
57 }
58 
GetDetails() const59 UDDetails File::GetDetails() const
60 {
61     return this->details_;
62 }
63 } // namespace UDMF
64 } // namespace OHOS
65