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 "application_defined_record.h" 17 18 namespace OHOS { 19 namespace UDMF { ApplicationDefinedRecord()20ApplicationDefinedRecord::ApplicationDefinedRecord() : UnifiedRecord(APPLICATION_DEFINED_RECORD) 21 { 22 } 23 ApplicationDefinedRecord(std::string type)24ApplicationDefinedRecord::ApplicationDefinedRecord(std::string type) : UnifiedRecord(APPLICATION_DEFINED_RECORD) 25 { 26 this->applicationDefinedType = std::move(type); 27 } 28 ApplicationDefinedRecord(std::string type,std::vector<uint8_t> & data)29ApplicationDefinedRecord::ApplicationDefinedRecord(std::string type, std::vector<uint8_t> &data) 30 : UnifiedRecord(APPLICATION_DEFINED_RECORD) 31 { 32 this->applicationDefinedType = std::move(type); 33 this->rawData_ = std::move(data); 34 } 35 GetSize()36int64_t ApplicationDefinedRecord::GetSize() 37 { 38 return rawData_.size(); 39 } 40 GetApplicationDefinedType() const41std::string ApplicationDefinedRecord::GetApplicationDefinedType() const 42 { 43 return this->applicationDefinedType; 44 } 45 SetApplicationDefinedType(const std::string & type)46void ApplicationDefinedRecord::SetApplicationDefinedType(const std::string &type) 47 { 48 this->applicationDefinedType = type; 49 } 50 GetRawData() const51std::vector<uint8_t> ApplicationDefinedRecord::GetRawData() const 52 { 53 return this->rawData_; 54 } 55 SetRawData(const std::vector<uint8_t> & rawData)56void ApplicationDefinedRecord::SetRawData(const std::vector<uint8_t> &rawData) 57 { 58 this->rawData_ = rawData; 59 } 60 } // namespace UDMF 61 } // namespace OHOS 62