MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / WriteMetaDataXML

Method WriteMetaDataXML

cpp/src/Node.cpp:4158–4196  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Write the MetaData to the Cache File -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

4156// Write the MetaData to the Cache File
4157//-----------------------------------------------------------------------------
4158void Node::WriteMetaDataXML(TiXmlElement *mdElement) {
4159 // Write out the MetaDataItems
4160 for( map<MetaDataFields, string>::iterator it = m_metadata.begin(); it != m_metadata.end(); ++ it )
4161 {
4162 /* only write if its a valid MetaData */
4163 if (it->first < Node::MetaData_Invalid) {
4164 TiXmlElement* mdiElement = new TiXmlElement( "MetaDataItem" );
4165 mdiElement->SetAttribute( "name", GetMetaDataString(it->first).c_str() );
4166 switch (it->first) {
4167 case MetaData_ZWProductPage_URL:
4168 case MetaData_Identifier:
4169 case MetaData_Frequency:
4170 mdiElement->SetAttribute("type", GetProductType());
4171 mdiElement->SetAttribute("id", GetProductId());
4172 break;
4173 /* for the rest, just take the standard entry */
4174 default:
4175 break;
4176 }
4177 TiXmlText* textElement = new TiXmlText( it->second.c_str() );
4178 mdiElement->LinkEndChild( textElement );
4179 mdElement->LinkEndChild( mdiElement );
4180
4181 }
4182 }
4183 if (m_changeLog.size() > 0) {
4184 TiXmlElement* cl = new TiXmlElement( "ChangeLog" );
4185 for (map<uint32_t, ChangeLogEntry>::iterator it = m_changeLog.begin(); it != m_changeLog.end(); ++ it )
4186 {
4187 TiXmlElement* cle = new TiXmlElement( "Entry" );
4188 cle->SetAttribute( "author", it->second.author.c_str() );
4189 cle->SetAttribute( "date", it->second.date.c_str() );
4190 cle->SetAttribute( "revision", it->second.revision );
4191 TiXmlText* textElement = new TiXmlText( it->second.description.c_str() );
4192 cle->LinkEndChild(textElement);
4193 }
4194 mdElement->LinkEndChild(cl);
4195 }
4196}

Callers

nothing calls this directly

Calls 8

GetProductTypeFunction · 0.85
GetProductIdFunction · 0.85
SetAttributeMethod · 0.80
LinkEndChildMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected