MCPcopy Create free account
hub / github.com/audacity/audacity / HandleXMLTag

Method HandleXMLTag

libraries/lib-menus/CommandManager.cpp:1122–1157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1120}
1121
1122bool CommandManager::HandleXMLTag(const std::string_view& tag, const AttributesList &attrs)
1123{
1124 if (tag == "audacitykeyboard") {
1125 mXMLKeysRead = 0;
1126 }
1127
1128 if (tag == "command") {
1129 wxString name;
1130 NormalizedKeyString key;
1131
1132 for (auto pair : attrs)
1133 {
1134 auto attr = pair.first;
1135 auto value = pair.second;
1136
1137 if (value.IsStringView())
1138 {
1139 const wxString strValue = value.ToWString();
1140
1141 if (attr == "name")
1142 name = strValue;
1143 else if (attr == "key")
1144 key = NormalizedKeyString{ strValue };
1145 }
1146 }
1147
1148 if (auto iter = mCommandNameHash.find(name);
1149 iter != mCommandNameHash.end()
1150 ) {
1151 iter->second->key = key;
1152 ++mXMLKeysRead;
1153 }
1154 }
1155
1156 return true;
1157}
1158
1159// This message is displayed now in KeyConfigPrefs::OnImport()
1160void CommandManager::HandleXMLEndTag(const std::string_view& tag)

Callers

nothing calls this directly

Calls 4

IsStringViewMethod · 0.80
ToWStringMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected