MCPcopy Create free account
hub / github.com/Kitware/VTK / CheckPrimaryAttributes

Method CheckPrimaryAttributes

IO/XMLParser/vtkXMLDataParser.cxx:227–263  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

225
226//------------------------------------------------------------------------------
227int vtkXMLDataParser::CheckPrimaryAttributes()
228{
229 const char* byte_order = this->RootElement->GetAttribute("byte_order");
230 if (byte_order)
231 {
232 if (strcmp(byte_order, "BigEndian") == 0)
233 {
234 this->ByteOrder = vtkXMLDataParser::BigEndian;
235 }
236 else if (strcmp(byte_order, "LittleEndian") == 0)
237 {
238 this->ByteOrder = vtkXMLDataParser::LittleEndian;
239 }
240 else
241 {
242 vtkErrorMacro("Unsupported byte_order=\"" << byte_order << "\"");
243 return 0;
244 }
245 }
246 if (const char* header_type = this->RootElement->GetAttribute("header_type"))
247 {
248 if (strcmp(header_type, "UInt32") == 0)
249 {
250 this->HeaderType = 32;
251 }
252 else if (strcmp(header_type, "UInt64") == 0)
253 {
254 this->HeaderType = 64;
255 }
256 else
257 {
258 vtkErrorMacro("Unsupported header_type=\"" << header_type << "\"");
259 return 0;
260 }
261 }
262 return 1;
263}
264
265//------------------------------------------------------------------------------
266void vtkXMLDataParser::FindAppendedDataPosition()

Callers 1

ParseMethod · 0.95

Calls 1

GetAttributeMethod · 0.45

Tested by

no test coverage detected