mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
util: virxml: introduce virXMLFormatElementDirect
This can be used to format XML where the element has direct value instead of any subelement. For example: <maxMemory slots='16' unit='KiB'>1524288</maxMemory> Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
915b2bfcfe
commit
4cc562651f
@ -3781,6 +3781,7 @@ virXMLBufferCreate;
|
||||
virXMLCheckIllegalChars;
|
||||
virXMLExtractNamespaceXML;
|
||||
virXMLFormatElement;
|
||||
virXMLFormatElementDirect;
|
||||
virXMLFormatElementEmpty;
|
||||
virXMLFormatElementInternal;
|
||||
virXMLFormatMetadata;
|
||||
|
@ -1767,6 +1767,20 @@ virXMLFormatElementEmpty(virBuffer *buf,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Same as virXMLFormatElement but the child is direct value without
|
||||
* subelements.
|
||||
*/
|
||||
void
|
||||
virXMLFormatElementDirect(virBuffer *buf,
|
||||
const char *name,
|
||||
virBuffer *attrBuf,
|
||||
virBuffer *childBuf)
|
||||
{
|
||||
virXMLFormatElementInternal(buf, name, attrBuf, childBuf, false, false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* virXMLFormatElement
|
||||
* @buf: the parent buffer where the element will be placed
|
||||
|
@ -351,6 +351,12 @@ virXMLFormatElementEmpty(virBuffer *buf,
|
||||
virBuffer *attrBuf,
|
||||
virBuffer *childBuf);
|
||||
|
||||
void
|
||||
virXMLFormatElementDirect(virBuffer *buf,
|
||||
const char *name,
|
||||
virBuffer *attrBuf,
|
||||
virBuffer *childBuf);
|
||||
|
||||
int
|
||||
virXMLFormatMetadata(virBuffer *buf,
|
||||
xmlNodePtr metadata);
|
||||
|
Loading…
x
Reference in New Issue
Block a user