<commit_before>#ifdef _MSC_VER
#  pragma warning(disable:4786)
#endif

#include <SAX/XMLReader.h>
#include <SAX/helpers/FeatureNames.h>
#include <SAX/InputSource.h>
#include <iostream>
#include <SAX/filter/Writer.h>

////////////////////////////////////////////////
int main(int argc, char* argv[])
{
  if(argc < 2) 
  {
    std::cout << "Usage : " << argv[0] << " xmlfile ... " << std::endl;
    return 0;
  } // if(argc < 2)


  SAX::FeatureNames<std::string> fNames;
  SAX::XMLReader<std::string> parser;
  SAX::Writer writer(std::cout);
  writer.setParent(parser);

	for(int i = 1; i < argc; ++i)
  {
    std::string file(argv[i]);
    SAX::InputSource is;
    is.setSystemId(file);

    if(file != "-")
      writer.parse(is);
    else
    {
      is.setSystemId("stdin");
      is.setByteStream(std::cin);

      writer.parse(is);
    } // if(file != "-")
  } // for ...

  
  return 0;
} // main

// end of file<commit_msg>wide string fixes<commit_after>#ifdef _MSC_VER
#  pragma warning(disable:4786)
#endif

#include <SAX/XMLReader.h>
#include <SAX/helpers/FeatureNames.h>
#include <SAX/InputSource.h>
#include <iostream>
#include <SAX/filter/Writer.h>

////////////////////////////////////////////////
int main(int argc, char* argv[])
{
  if(argc < 2) 
  {
    std::cout << "Usage : " << argv[0] << " xmlfile ... " << std::endl;
    return 0;
  } // if(argc < 2)

/*
  { // narrow
    SAX::FeatureNames<std::string> fNames;
    SAX::XMLReader<std::string> parser;
    SAX::Writer writer(std::cout);
    writer.setParent(parser);

  	for(int i = 1; i < argc; ++i)
    {
      std::string file(argv[i]);
      SAX::InputSource is;
      is.setSystemId(file);

      if(file != "-")
        writer.parse(is);
      else
      { 
        is.setSystemId("stdin");
        is.setByteStream(std::cin);

        writer.parse(is);
      } // if(file != "-")
    } // for ...
  }
  */
  { // wide
    SAX::FeatureNames<std::wstring> fNames;
    SAX::XMLReader<std::wstring> parser;
    SAX::wWriter writer(std::wcout);
    writer.setParent(parser);

    SAX::wInputSource is;
    is.setSystemId(L"stdin");
    is.setByteStream(std::cin);

    writer.parse(is);
  }

  return 0;
} // main

// end of file
{'fraction_non_alphanumeric': 0.22605537902859738, 'fraction_numerical': 0.009078529278256923, 'mean_word_length': 2.3597560975609757, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, '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': '4500599', 'n_tokens_mistral': 835, 'n_tokens_neox': 806, 'n_words': 141}