1 /*
2  * Copyright (C) 2022 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 package com.android.trusty.device_tree;
18 
19 import com.android.trusty.device_tree.INodeIterator;
20 import com.android.trusty.device_tree.IPropIterator;
21 import com.android.trusty.device_tree.Property;
22 
23 interface INode {
24      /**
25       * get_name() - Get a node's name.
26       *
27       * Return: The node's name.
28       */
get_name()29      @utf8InCpp String get_name();
30 
31      /**
32       * get_subnode() - Get a subnode of the given parent node.
33       * @node_name: A single null-terminated string with the subnode's name.
34       *
35       * Return: A subnode.
36       */
get_subnode(in @tf8InCpp String node_name)37      INode get_subnode(in @utf8InCpp String node_name);
38 
39      /**
40       * get_subnodes() - Get an iterator over the subnodes of the given parent node.
41       *
42       * Return: An iterator over the subnodes.
43       */
get_subnodes()44      INodeIterator get_subnodes();
45 
46      /**
47       * get_props() - Get an iterator over a node's properties.
48       *
49       * Return: An iterator over the properties.
50       */
get_props()51      IPropIterator get_props();
52 
53      /**
54       * get_prop() - Get a node's property.
55       * @prop_name: A single null-terminated string with the property's name.
56       *
57       * Return: The property in big-endian
58       */
get_prop(in @tf8InCpp String prop_name)59      Property get_prop(in @utf8InCpp String prop_name);
60 }
61