MCPcopy Create free account
hub / github.com/WinMerge/winmerge / startElement

Method startElement

Src/InternalPlugins.cpp:109–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107 void startDocument() {}
108 void endDocument() {}
109 void startElement(const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attributes)
110 {
111 if (!m_stack.empty())
112 {
113 if (m_stack.top() == PluginsElement)
114 {
115 if (localName == PluginElement)
116 {
117 String name;
118 int index = attributes.getIndex(Empty, NameAttribute);
119 if (index >= 0)
120 name = ucr::toTString(attributes.getValue(index));
121 m_pPlugins->emplace_back(name);
122 m_pMethod = nullptr;
123 }
124 }
125 else if (m_stack.top() == PluginElement)
126 {
127 Info& plugin = m_pPlugins->back();
128 String value;
129 int index = attributes.getIndex(Empty, ValueAttribute);
130 if (index >= 0)
131 {
132 value = ucr::toTString(attributes.getValue(index));
133 if (localName == EventElement)
134 plugin.m_event = value;
135 else if (localName == DescriptionElement)
136 plugin.m_description = value;
137 else if (localName == FileFiltersElement)
138 plugin.m_fileFilters = value;
139 else if (localName == IsAutomaticElement)
140 {
141 tchar_t ch = value.c_str()[0];
142 plugin.m_isAutomatic = (ch == 't' || ch == 'T');
143 }
144 else if (localName == UnpackedFileExtensionElement)
145 plugin.m_unpackedFileExtension = value;
146 else if (localName == ExtendedPropertiesElement)
147 plugin.m_extendedProperties = value;
148 else if (localName == ArgumentsElement)
149 plugin.m_arguments = std::move(value);
150 else if (localName == PipelineElement)
151 plugin.m_pipeline = std::move(value);
152 }
153 else if (localName == PrediffFileElement)
154 {
155 plugin.m_prediffFile.reset(new Method());
156 m_pMethod = plugin.m_prediffFile.get();
157 }
158 else if (localName == UnpackFileElement)
159 {
160 plugin.m_unpackFile.reset(new Method());
161 m_pMethod = plugin.m_unpackFile.get();
162 }
163 else if (localName == PackFileElement)
164 {
165 plugin.m_packFile.reset(new Method());
166 m_pMethod = plugin.m_packFile.get();

Callers 2

writeMethodElementFunction · 0.45
SaveToXMLFunction · 0.45

Calls 7

toTStringFunction · 0.85
getIndexMethod · 0.80
emptyMethod · 0.45
backMethod · 0.45
resetMethod · 0.45
getMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected