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 #include "utd_client.h"
16 namespace OHOS {
17 namespace UDMF {
UtdClient()18 UtdClient::UtdClient()
19 {
20 Init();
21 }
22
~UtdClient()23 UtdClient::~UtdClient()
24 {
25 }
26
GetInstance()27 UtdClient &UtdClient::GetInstance()
28 {
29 static auto instance = new UtdClient();
30 return *instance;
31 }
32
Init()33 void UtdClient::Init()
34 {
35 }
36
GetTypeDescriptor(const std::string & typeId,std::shared_ptr<TypeDescriptor> & descriptor)37 Status UtdClient::GetTypeDescriptor(const std::string &typeId, std::shared_ptr<TypeDescriptor> &descriptor)
38 {
39 return Status::E_OK;
40 }
41
IsValidFileExtension(const std::string & fileExtension)42 bool UtdClient::IsValidFileExtension(const std::string &fileExtension)
43 {
44 return true;
45 }
46
IsValidMimeType(const std::string & mimeType)47 bool UtdClient::IsValidMimeType(const std::string &mimeType)
48 {
49 return true;
50 }
51
GetFlexibleTypeDescriptor(const std::string & typeId,std::shared_ptr<TypeDescriptor> & descriptor)52 Status UtdClient::GetFlexibleTypeDescriptor(const std::string &typeId, std::shared_ptr<TypeDescriptor> &descriptor)
53 {
54 return Status::E_OK;
55 }
56
GetUniformDataTypeByFilenameExtension(const std::string & fileExtension,std::string & typeId,std::string belongsTo)57 Status UtdClient::GetUniformDataTypeByFilenameExtension(const std::string &fileExtension, std::string &typeId,
58 std::string belongsTo)
59 {
60 return Status::E_OK;
61 }
62
GetUniformDataTypeByMIMEType(const std::string & mimeType,std::string & typeId,std::string belongsTo)63 Status UtdClient::GetUniformDataTypeByMIMEType(const std::string &mimeType, std::string &typeId,
64 std::string belongsTo)
65 {
66 return Status::E_OK;
67 }
68
IsUtd(std::string typeId,bool & result)69 Status UtdClient::IsUtd(std::string typeId, bool &result)
70 {
71 return Status::E_OK;
72 }
73
GetUniformDataTypesByFilenameExtension(const std::string & fileExtension,std::vector<std::string> & typeIds,const std::string & belongsTo)74 Status UtdClient::GetUniformDataTypesByFilenameExtension(const std::string &fileExtension,
75 std::vector<std::string> &typeIds, const std::string &belongsTo)
76 {
77 return Status::E_OK;
78 }
79
GetTypeIdFromCfg(const std::string & mimeType)80 std::string UtdClient::GetTypeIdFromCfg(const std::string &mimeType)
81 {
82 return "";
83 }
84
GetTypeIdsFromCfg(const std::string & mimeType)85 std::vector<std::string> UtdClient::GetTypeIdsFromCfg(const std::string &mimeType)
86 {
87 std::vector<std::string> typeIdsInCfg;
88 return typeIdsInCfg;
89 }
90
SubscribeUtdChange()91 void UtdClient::SubscribeUtdChange()
92 {
93 }
94
GetUniformDataTypesByMIMEType(const std::string & mimeType,std::vector<std::string> & typeIds,const std::string & belongsTo)95 Status UtdClient::GetUniformDataTypesByMIMEType(const std::string &mimeType, std::vector<std::string> &typeIds,
96 const std::string &belongsTo)
97 {
98 return Status::E_OK;
99 }
100 } // namespace UDMF
101 } // namespace OHOS
102