MCPcopy Create free account
hub / github.com/USCiLab/cereal / insert_attribute

Method insert_attribute

include/cereal/external/rapidxml/rapidxml.hpp:1252–1268  ·  view source on GitHub ↗

Inserts a new attribute at specified place inside the node. All attributes after and including the specified attribute are moved one position back. \param where Place where to insert the attribute, or 0 to insert at the back. \param attribute Attribute to insert.

Source from the content-addressed store, hash-verified

1250 //! \param where Place where to insert the attribute, or 0 to insert at the back.
1251 //! \param attribute Attribute to insert.
1252 void insert_attribute(xml_attribute<Ch> *where, xml_attribute<Ch> *attribute)
1253 {
1254 assert(!where || where->parent() == this);
1255 assert(attribute && !attribute->parent());
1256 if (where == m_first_attribute)
1257 prepend_attribute(attribute);
1258 else if (where == 0)
1259 append_attribute(attribute);
1260 else
1261 {
1262 attribute->m_prev_attribute = where->m_prev_attribute;
1263 attribute->m_next_attribute = where;
1264 where->m_prev_attribute->m_next_attribute = attribute;
1265 where->m_prev_attribute = attribute;
1266 attribute->m_parent = this;
1267 }
1268 }
1269
1270 //! Removes first attribute of the node.
1271 //! If node has no attributes, behaviour is undefined.

Callers

nothing calls this directly

Calls 1

parentMethod · 0.80

Tested by

no test coverage detected