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

Method insertType

include/cereal/archives/xml.hpp:297–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295
296 //! Causes the type to be appended as an attribute to the most recently made node if output type is set to true
297 template <class T> inline
298 void insertType()
299 {
300 if( !itsOutputType )
301 return;
302
303 // generate a name for this new node
304 const auto nameString = util::demangledName<T>();
305
306 // allocate strings for all of the data in the XML object
307 auto namePtr = itsXML.allocate_string( nameString.data(), nameString.length() + 1 );
308
309 itsNodes.top().node->append_attribute( itsXML.allocate_attribute( "type", namePtr ) );
310 }
311
312 //! Appends an attribute to the current top level node
313 void appendAttribute( const char * name, const char * value )

Callers

nothing calls this directly

Calls 4

allocate_stringMethod · 0.80
dataMethod · 0.80
append_attributeMethod · 0.80
allocate_attributeMethod · 0.80

Tested by

no test coverage detected