• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 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 #ifndef ANDROID_VINTF_XML_FILE_H
18 #define ANDROID_VINTF_XML_FILE_H
19 
20 #include <string>
21 
22 #include "Version.h"
23 #include "VersionRange.h"
24 #include "XmlSchemaFormat.h"
25 
26 namespace android {
27 namespace vintf {
28 
29 struct XmlFile {
30    public:
nameXmlFile31     inline const std::string& name() const { return mName; }
overriddenPathXmlFile32     inline const std::string& overriddenPath() const { return mOverriddenPath; }
33 
34    protected:
35     std::string mName;
36     std::string mOverriddenPath;
37 };
38 
39 // An <xmlfile> entry in matrix
40 struct MatrixXmlFile : public XmlFile {
formatMatrixXmlFile41     inline XmlSchemaFormat format() const { return mFormat; }
versionRangeMatrixXmlFile42     inline const VersionRange& versionRange() const { return mVersionRange; }
43     bool operator==(const MatrixXmlFile& other) const;
44 
45    private:
46     friend struct CompatibilityMatrix;
47     friend struct MatrixXmlFileConverter;
48     friend struct LibVintfTest;
49     XmlSchemaFormat mFormat;
50     VersionRange mVersionRange;
51 };
52 
53 // An <xmlfile> entry in manifest
54 struct ManifestXmlFile : public XmlFile {
versionManifestXmlFile55     inline const Version& version() const { return mVersion; }
56     bool operator==(const ManifestXmlFile& other) const;
57 
58    private:
59     friend struct ManifestXmlFileConverter;
60     friend struct LibVintfTest;
61     Version mVersion;
62 };
63 
64 }  // namespace vintf
65 }  // namespace android
66 #endif  // ANDROID_VINTF_XML_FILE_H
67