mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2026-02-01 15:59:39 +00:00
Implement XmlNodePrepend
This commit is contained in:
parent
fecc396a46
commit
c7ca70a9cc
@ -235,6 +235,18 @@ XmlNodeAppend (
|
||||
CONST CHAR8 *Content
|
||||
);
|
||||
|
||||
//
|
||||
// Prepend new node to current node.
|
||||
// Otherwise equivalent to XmlNodeAppend.
|
||||
//
|
||||
XML_NODE *
|
||||
XmlNodePrepend (
|
||||
XML_NODE *Node,
|
||||
CONST CHAR8 *Name,
|
||||
CONST CHAR8 *Attributes,
|
||||
CONST CHAR8 *Content
|
||||
);
|
||||
|
||||
//
|
||||
// @return XML_NODE representing plist root or NULL.
|
||||
// @warning Only a subset of plist is supported.
|
||||
|
||||
@ -1310,6 +1310,27 @@ XmlNodeAppend (
|
||||
return NewNode;
|
||||
}
|
||||
|
||||
XML_NODE *
|
||||
XmlNodePrepend (
|
||||
XML_NODE *Node,
|
||||
CONST CHAR8 *Name,
|
||||
CONST CHAR8 *Attributes,
|
||||
CONST CHAR8 *Content
|
||||
)
|
||||
{
|
||||
XML_NODE *NewNode;
|
||||
|
||||
NewNode = XmlNodeAppend (Node, Name, Attributes, Content);
|
||||
if (NewNode == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CopyMem (&Node->Children->NodeList[1], &Node->Children->NodeList[0], (Node->Children->NodeCount - 1) * sizeof (Node->Children->NodeList[0]));
|
||||
Node->Children->NodeList[0] = NewNode;
|
||||
|
||||
return NewNode;
|
||||
}
|
||||
|
||||
XML_NODE *
|
||||
PlistDocumentRoot (
|
||||
XML_DOCUMENT *Document
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user