DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | List of all members
shaka::xml::XmlNode Class Reference

#include <xml_node.h>

Inheritance diagram for shaka::xml::XmlNode:
shaka::xml::RepresentationBaseXmlNode shaka::xml::AdaptationSetXmlNode shaka::xml::RepresentationXmlNode

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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

shaka::xml::XmlNode::XmlNode ( const char *  name)
explicit

Make an XML element.

Parameters
nameis the name of the element, which should not be NULL.

Definition at line 55 of file xml_node.cc.

Member Function Documentation

bool shaka::xml::XmlNode::AddChild ( scoped_xml_ptr< xmlNode >  child)

Add a child element to this element.

Parameters
childis a xmlNode to add as a child for this element. Ownership of the child node is transferred.
Returns
true on success, false otherwise.

Definition at line 62 of file xml_node.cc.

xmlNodePtr shaka::xml::XmlNode::GetRawPtr ( )
Returns
Raw pointer to the element.

Definition at line 148 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.

Returns
The resource of this object.

Definition at line 136 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 142 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.

Parameters
contentis a string containing the text-encoded child elements to be added to the element.

Definition at line 131 of file xml_node.cc.

void shaka::xml::XmlNode::SetFloatingPointAttribute ( const char *  attribute_name,
double  number 
)

Set a floating point number attribute.

Parameters
attribute_nameis the name of the attribute to set.
numberis the value (rhs) of the attribute.

Definition at line 119 of file xml_node.cc.

void shaka::xml::XmlNode::SetId ( uint32_t  id)

Sets 'id=id' attribute.

Parameters
idis the ID for this element.

Definition at line 127 of file xml_node.cc.

void shaka::xml::XmlNode::SetIntegerAttribute ( const char *  attribute_name,
uint64_t  number 
)

Sets an integer attribute.

Parameters
attribute_nameThe name (lhs) of the attribute.
numberThe value (rhs) of the attribute.

Definition at line 111 of file xml_node.cc.

void shaka::xml::XmlNode::SetStringAttribute ( const char *  attribute_name,
const std::string &  attribute 
)

Set a string attribute.

Parameters
attribute_nameThe name (lhs) of the attribute.
attributeThe value (rhs) of the attribute.

Definition at line 104 of file xml_node.cc.


The documentation for this class was generated from the following files: