<commit_before>/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkXMLReader.cxx

  Copyright (c) <NAME>, <NAME>, <NAME>
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#include "vtkXMLReader.h"

#include "vtkCallbackCommand.h"
#include "vtkDataArraySelection.h"
#include "vtkDataCompressor.h"
#include "vtkDataSet.h"
#include "vtkDataSetAttributes.h"
#include "vtkInstantiator.h"
#include "vtkObjectFactory.h"
#include "vtkXMLDataElement.h"
#include "vtkXMLDataParser.h"
#include "vtkXMLFileReadTester.h"
#include "vtkZLibDataCompressor.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkStreamingDemandDrivenPipeline.h"

#include <vtksys/ios/sstream>
#include <sys/stat.h>
#include <assert.h>

vtkCxxRevisionMacro(vtkXMLReader, "1.49");
//-----------------------------------------------------------------------------
static void ReadStringVersion(const char* version, int& major, int& minor)
{
  if (!version)
    {
    major = -1;
    minor = -1;
    return;
    }
  // Extract the major and minor version numbers.
  size_t length = strlen(version);
  const char* begin = version;
  const char* end = version + length;
  const char* s;

  for(s=begin; (s != end) && (*s != '.'); ++s);

  if(s > begin)
    {
    vtksys_ios::stringstream str;
    str.write(begin, s-begin);
    str >> major;
    if(!str)
      {
      major = 0;
      }
    }
  if(++s < end)
    {
    vtksys_ios::stringstream str;
    str.write(s, end-s);
    str >> minor;
    if(!str)
      {
      minor = 0;
      }
    }
}
//----------------------------------------------------------------------------
vtkXMLReader::vtkXMLReader()<commit_msg>ENH: Merge changes from main tree into VTK-5-2 branch. (cvs -q up -j1.51 -j1.52 IO/vtkXMLReader.cxx)<commit_after>/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkXMLReader.cxx

  Copyright (c) <NAME>, <NAME>, <NAME>
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#include "vtkXMLReader.h"

#include "vtkCallbackCommand.h"
#include "vtkDataArraySelection.h"
#include "vtkDataCompressor.h"
#include "vtkDataSet.h"
#include "vtkDataSetAttributes.h"
#include "vtkInstantiator.h"
#include "vtkObjectFactory.h"
#include "vtkXMLDataElement.h"
#include "vtkXMLDataParser.h"
#include "vtkXMLFileReadTester.h"
#include "vtkZLibDataCompressor.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkStreamingDemandDrivenPipeline.h"

#include <vtksys/ios/sstream>
#include <sys/stat.h>
#include <assert.h>

vtkCxxRevisionMacro(vtkXMLReader, "1.49.2.1");
//-----------------------------------------------------------------------------
static void ReadStringVersion(const char* version, int& major, int& minor)
{
  if (!version)
    {
    major = -1;
    minor = -1;
    return;
    }
  // Extract the major and minor version numbers.
  size_t length = strlen(version);
  const char* begin = version;
  const char* end = version + length;
  const char* s;

  for(s=begin; (s != end) && (*s != '.'); ++s)
    {
    ;
    }

  if(s > begin)
    {
    vtksys_ios::stringstream str;
    str.write(begin, s-begin);
    str >> major;
    if(!str)
      {
      major = 0;
      }
    }
  if(++s < end)
    {
    vtksys_ios::stringstream str;
    str.write(s, end-s);
    str >> minor;
    if(!str)
      {
      minor = 0;
      }
    }
}
//----------------------------------------------------------------------------
vtkXMLReader::vtkXMLReader()
{'fraction_non_alphanumeric': 0.2550923732828044, 'fraction_numerical': 0.005684509711037423, 'mean_word_length': 2.7174295774647885, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3904834', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1301, 'n_words': 317}