BSDL Device Tree Compiler
|
Public Types | |
typedef std::vector< node * > ::iterator | child_iterator |
typedef std::vector< property * > ::iterator | property_iterator |
Public Member Functions | |
void | sort () |
child_iterator | child_begin () |
child_iterator | child_end () |
property_iterator | property_begin () |
property_iterator | property_end () |
~node () | |
property * | get_property (string key) |
void | add_property (property *p) |
void | merge_node (node *other) |
void | write (dtb::output_writer &writer, string_table &strings) |
void | write_dts (FILE *file, int indent) |
Static Public Member Functions | |
static node * | parse (input_buffer &input, string name, string label=string(), string address=string()) |
static node * | parse_dtb (input_buffer &structs, input_buffer &strings) |
Public Attributes | |
string | label |
string | name |
string | unit_address |
Class encapsulating a device tree node. Nodes may contain properties and other nodes.
typedef std::vector<node*>::iterator dtc::fdt::node::child_iterator |
Iterator type for child nodes.
typedef std::vector<property*>::iterator dtc::fdt::node::property_iterator |
Iterator type for properties of a node.
|
inline |
Destroys the node, recursively deleting all of its properties and children.
|
inline |
Adds a new property to this node.
|
inline |
Returns an iterator for the first child of this node.
|
inline |
Returns an iterator after the last child of this node.
Returns a property corresponding to the specified key, or 0 if this node does not contain a property of that name.
|
inline |
Merges a node into this one. Any properties present in both are overridden, any properties present in only one are preserved.
|
inlinestatic |
Factory method for constructing a new node. Attempts to parse a node in DTS format from the input, and returns it on success. On any parse error, this will return 0. This should be called with the cursor on the open brace of the property, after the name and so on have been parsed.
|
inlinestatic |
Factory method for constructing a new node. Attempts to parse a node in DTB format from the input, and returns it on success. On any parse error, this will return 0. This should be called with the cursor on the open brace of the property, after the name and so on have been parsed.
|
inline |
Returns an iterator after the last property of this node.
|
inline |
Returns an iterator for the first property of this node.
|
inline |
Sorts the node's properties and children into alphabetical order and recursively sorts the children.
|
inline |
Write this node to the specified output. Although nodes do not refer to a string table directly, their properties do. The string table passed as the second argument is used for the names of properties within this node and its children.
|
inline |
Writes the current node as DTS to the specified file. The second parameter is the indent level. This function will start every line with this number of tabs.
string dtc::fdt::node::label |
The label for this node, if any. Node labels are used as the targets for cross references.
string dtc::fdt::node::name |
The name of the node.
string dtc::fdt::node::unit_address |
The unit address of the node, which is optionally written after the name followed by an at symbol.