• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <vintf/Version.h>
20 
21 namespace android::vintf {
22 
23 std::string toXml(const Version& o, SerializeFlags::Type flags = SerializeFlags::EVERYTHING);
24 std::string toXml(const SepolicyVersion& o,
25                   SerializeFlags::Type flags = SerializeFlags::EVERYTHING);
26 std::string toXml(const KernelConfigTypedValue& o,
27                   SerializeFlags::Type flags = SerializeFlags::EVERYTHING);
28 std::string toXml(const ManifestHal& o, SerializeFlags::Type flags = SerializeFlags::EVERYTHING);
29 std::string toXml(const MatrixHal& o, SerializeFlags::Type flags = SerializeFlags::EVERYTHING);
30 
31 [[nodiscard]] bool fromXml(Version* o, const std::string& xml, std::string* error = nullptr);
32 [[nodiscard]] bool fromXml(SepolicyVersion* o, const std::string& xml,
33                            std::string* error = nullptr);
34 [[nodiscard]] bool fromXml(KernelConfigTypedValue* o, const std::string& xml,
35                            std::string* error = nullptr);
36 [[nodiscard]] bool fromXml(MatrixHal* o, const std::string& xml, std::string* error = nullptr);
37 [[nodiscard]] bool fromXml(ManifestHal* o, const std::string& xml, std::string* error = nullptr);
38 
39 }  // namespace android::vintf
40