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

  Program: DICOM for VTK

  Copyright (c) 2012-2017 <NAME>
  All rights reserved.
  See Copyright.txt or http://dgobbi.github.io/bsd3.txt 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 "vtkDICOMTagPath.h"

//----------------------------------------------------------------------------
ostream& operator<<(ostream& o, const vtkDICOMTagPath& a)
{
  o << "[";
  o << a.GetHead();
  if (a.HasTail())
  {
    vtkDICOMTagPath b = a;
    while (b.HasTail())
    {
      o << ",";
      o << b.GetIndex();
      o << ",";
      o << b.GetHead();
      b = b.GetTail();
    }
  }
  o << "]";

  return o;
}

//----------------------------------------------------------------------------
bool vtkDICOMTagPath::operator==(const vtkDICOMTagPath& b) const
{
  return (this->Head == b.Head &&
          this->Index == b.Index &&
          this->Tail == b.Tail &&
          this->Index2 == b.Index2 &&
          this->Tail2 == b.Tail2);
}

//----------------------------------------------------------------------------
bool vtkDICOMTagPath::operator!=(const vtkDICOMTagPath& b) const
{
  return !(*this == b);
}

//----------------------------------------------------------------------------
bool vtkDICOMTagPath::operator<(const vtkDICOMTagPath& b) const
{
  return (this->Head < b.Head ||<commit_msg>Fix stream operator for tag paths.<commit_after>/*=========================================================================

  Program: DICOM for VTK

  Copyright (c) 2012-2017 <NAME>
  All rights reserved.
  See Copyright.txt or http://dgobbi.github.io/bsd3.txt 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 "vtkDICOMTagPath.h"

//----------------------------------------------------------------------------
ostream& operator<<(ostream& o, const vtkDICOMTagPath& a)
{
  o << "[";
  o << a.GetHead();
  if (a.HasTail())
  {
    unsigned int i = a.GetIndex();
    vtkDICOMTagPath b = a.GetTail();
    for (;;)
    {
      o << ",";
      o << i;
      o << ",";
      o << b.GetHead();
      if (!b.HasTail())
      {
        break;
      }
      i = b.GetIndex();
      b = b.GetTail();
    }
  }
  o << "]";

  return o;
}

//----------------------------------------------------------------------------
bool vtkDICOMTagPath::operator==(const vtkDICOMTagPath& b) const
{
  return (this->Head == b.Head &&
          this->Index == b.Index &&
          this->Tail == b.Tail &&
          this->Index2 == b.Index2 &&
          this->Tail2 == b.Tail2);
}

//----------------------------------------------------------------------------
bool vtkDICOMTagPath::operator!=(const vtkDICOMTagPath& b) const
{
  return !(*this == b);
}

//----------------------------------------------------------------------------
bool vtkDICOMTagPath::operator<(const vtkDICOMTagPath& b) const
{
  return (this->Head < b.Head ||
{'fraction_non_alphanumeric': 0.3795127678309363, 'fraction_numerical': 0.007631347226298797, 'mean_word_length': 1.5818181818181818, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5417900', 'n_tokens_mistral': 961, 'n_tokens_neox': 924, 'n_words': 227}