Shaka Packager SDK
|
#include <xml_node.h>
Public Member Functions | |
XmlNode (const char *name) | |
bool | AddChild (scoped_xml_ptr< xmlNode > child) |
bool | AddElements (const std::vector< Element > &elements) |
Adds Elements to this node using the Element struct. | |
void | SetStringAttribute (const char *attribute_name, const std::string &attribute) |
void | SetIntegerAttribute (const char *attribute_name, uint64_t number) |
void | SetFloatingPointAttribute (const char *attribute_name, double number) |
void | SetId (uint32_t id) |
void | SetContent (const std::string &content) |
scoped_xml_ptr< xmlNode > | PassScopedPtr () |
xmlNodePtr | Release () |
xmlNodePtr | GetRawPtr () |
These classes are wrapper classes for XML elements for generating MPD. None of the pointer parameters should be NULL. None of the methods are meant to be overridden.
Definition at line 32 of file xml_node.h.
|
explicit |
Make an XML element.
name | is the name of the element, which should not be NULL. |
Definition at line 88 of file xml_node.cc.
bool shaka::xml::XmlNode::AddChild | ( | scoped_xml_ptr< xmlNode > | child | ) |
Add a child element to this element.
child | is a xmlNode to add as a child for this element. Ownership of the child node is transferred. |
Definition at line 95 of file xml_node.cc.
xmlNodePtr shaka::xml::XmlNode::GetRawPtr | ( | ) |
Definition at line 181 of file xml_node.cc.
scoped_xml_ptr< xmlNode > shaka::xml::XmlNode::PassScopedPtr | ( | ) |
Transfer the ownership of the xmlNodePtr. After calling this method, the behavior of any methods, except the destructor, is undefined.
Definition at line 169 of file xml_node.cc.
xmlNodePtr shaka::xml::XmlNode::Release | ( | ) |
Release the xmlNodePtr of this object. After calling this method, the behavior of any methods, except the destructor, is undefined.
Definition at line 175 of file xml_node.cc.
void shaka::xml::XmlNode::SetContent | ( | const std::string & | content | ) |
Set the contents of an XML element using a string. This cannot set child elements because <> will become < and This should be used to set the text for the element, e.g. setting a URL for <BaseURL> element.
content | is a string containing the text-encoded child elements to be added to the element. |
Definition at line 164 of file xml_node.cc.
void shaka::xml::XmlNode::SetFloatingPointAttribute | ( | const char * | attribute_name, |
double | number | ||
) |
Set a floating point number attribute.
attribute_name | is the name of the attribute to set. |
number | is the value (rhs) of the attribute. |
Definition at line 152 of file xml_node.cc.
void shaka::xml::XmlNode::SetId | ( | uint32_t | id | ) |
Sets 'id=id' attribute.
id | is the ID for this element. |
Definition at line 160 of file xml_node.cc.
void shaka::xml::XmlNode::SetIntegerAttribute | ( | const char * | attribute_name, |
uint64_t | number | ||
) |
Sets an integer attribute.
attribute_name | The name (lhs) of the attribute. |
number | The value (rhs) of the attribute. |
Definition at line 144 of file xml_node.cc.
void shaka::xml::XmlNode::SetStringAttribute | ( | const char * | attribute_name, |
const std::string & | attribute | ||
) |
Set a string attribute.
attribute_name | The name (lhs) of the attribute. |
attribute | The value (rhs) of the attribute. |
Definition at line 137 of file xml_node.cc.