MCPcopy Create free account
hub / github.com/Kitware/ParaView / ReadXMLAttributes

Method ReadXMLAttributes

Remoting/ServerManager/vtkSMStringListDomain.cxx:144–183  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

142
143//---------------------------------------------------------------------------
144int vtkSMStringListDomain::ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element)
145{
146 int retVal = this->Superclass::ReadXMLAttributes(prop, element);
147 if (!retVal)
148 {
149 return 0;
150 }
151
152 std::vector<std::string> values;
153
154 // Search for attribute type with matching name.
155 const char* none_string = element->GetAttribute("none_string");
156 if (none_string)
157 {
158 this->SetNoneString(none_string);
159 values.emplace_back(none_string);
160 }
161
162 // Loop over the top-level elements.
163 unsigned int i;
164 for (i = 0; i < element->GetNumberOfNestedElements(); ++i)
165 {
166 vtkPVXMLElement* selement = element->GetNestedElement(i);
167 if (strcmp("String", selement->GetName()) != 0)
168 {
169 continue;
170 }
171 const char* value = selement->GetAttribute("value");
172 if (!value)
173 {
174 vtkErrorMacro(<< "Can not find required attribute: value. "
175 << "Can not parse domain xml.");
176 return 0;
177 }
178
179 values.emplace_back(value);
180 }
181 this->SetStrings(values);
182 return 1;
183}
184
185//---------------------------------------------------------------------------
186void vtkSMStringListDomain::ChildSaveState(vtkPVXMLElement* domainElement)

Callers

nothing calls this directly

Calls 4

SetStringsMethod · 0.95
GetNestedElementMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected