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

Method ReadXMLVIDHelp

cpp/src/Localization.cpp:497–526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497void Localization::ReadXMLVIDHelp(uint8 ccID, uint16 indexId, uint32 pos, const TiXmlElement *labelElement) {
498
499 string Language;
500 if (labelElement->Attribute( "lang" ))
501 Language = labelElement->Attribute( "lang" );
502 if (!labelElement->GetText()) {
503 if (ccID != 112) {
504 /* Dont Log About the Configuration CC */
505 Log::Write( LogLevel_Warning, "Localization::ReadXMLVIDHelp: Error in %s at line %d - No Help Entry for CommandClass %d, ValueID: %d (%d): %s (Lang: %s)", labelElement->GetDocument()->GetUserData(), labelElement->Row(), ccID, indexId, pos, labelElement->GetText(), Language.c_str() );
506 }
507 return;
508
509 }
510
511 uint64 key = GetValueKey(ccID, indexId, pos);
512 if (m_valueLocalizationMap.find(key) == m_valueLocalizationMap.end()) {
513 m_valueLocalizationMap[key] = new ValueLocalizationEntry(ccID, indexId, pos);
514 } else if (m_valueLocalizationMap[key]->HasLabel(Language)) {
515 Log::Write( LogLevel_Warning, "Localization::ReadXMLVIDHelp: Error in %s at line %d - Duplicate Entry for CommandClass %d, ValueID: %d (%d): %s (Lang: %s)", labelElement->GetDocument()->GetUserData(), labelElement->Row(), ccID, indexId, pos, labelElement->GetText(), Language.c_str() );
516 return;
517 }
518 if( Language.empty() )
519 {
520 m_valueLocalizationMap[key]->AddHelp(labelElement->GetText());
521 }
522 else
523 {
524 m_valueLocalizationMap[key]->AddHelp(labelElement->GetText(), Language);
525 }
526}
527
528void Localization::ReadXMLVIDItemLabel(uint8 ccID, uint16 indexId, uint32 pos, const TiXmlElement *labelElement) {
529

Callers 1

ReadXMLMethod · 0.80

Calls 12

WriteFunction · 0.85
AttributeMethod · 0.80
GetTextMethod · 0.80
GetUserDataMethod · 0.80
RowMethod · 0.80
findMethod · 0.80
HasLabelMethod · 0.80
AddHelpMethod · 0.80
GetDocumentMethod · 0.45
c_strMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected