<commit_before><commit_msg>*** empty log message ***<commit_after>#include "string.hpp"

namespace pcommon {
  
  void String::write(char c)
  {
    *this += c;
  }

  void String::write(ParmString str)
  {
    append(str);
  }

  void String::write(const char * str, unsigned int size)
  {
    append(str, size);
  }

  bool StringIStream::getline(String & str, char delem)
  {
    if (in_str[0] == '\0') return false;
    const char * end = in_str;
    bool prev_slash = false;
    while ((prev_slash || *end != delem) && *end != '\0') {
      prev_slash = *end == '\\';
      ++end;
    }
    str.assign(in_str, end - in_str);
    in_str = end;
    if (*in_str == delem) ++in_str;
    return true;
  }

  bool StringIStream::read(char * str, unsigned int size)
  {
    while (*in_str != '\0' && size != 0) {
      *str = *in_str;
      ++in_str;
      ++str;
      ++size;
    }
    return size == 0;
  }
  
}
{'fraction_non_alphanumeric': 0.17324561403508773, 'fraction_numerical': 0.006578947368421052, 'mean_word_length': 2.4323308270676693, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2309476', 'n_tokens_mistral': 347, 'n_tokens_neox': 340, 'n_words': 82}