<commit_before>#ifndef SETTI_MSG_H
#define SETTI_MSG_H

#include <string>
#include <memory>
#include <vector>
#include <boost/format.hpp>

namespace setti {
namespace internal {

class Message {
 public:
  enum class Severity {
    INFO,
    WARNING,
    ERR
  };

  Message() = delete;

  Message(Severity severity, const boost::format& msg, uint line, uint pos)
      : severity_(severity)
      , msg_(msg)
      , line_(line)
      , pos_(pos) {}

 private:
  uint line_;
  uint pos_;
  boost::format msg_;
  Severity severity_;
};

class Messages {
 public:
  Messages() = default;

  void Push(Message&& msg) {
    msg_vec_.push_back(std::move(msg));
  }

 private:
  std::vector<Message> msg_vec_;
};

}
}

#endif  // SETTI_MSG_H

<commit_msg>Implements stream for messages<commit_after>#ifndef SETTI_MSG_H
#define SETTI_MSG_H

#include <string>
#include <memory>
#include <vector>
#include <boost/format.hpp>

namespace setti {
namespace internal {

class Message {
 public:
  enum class Severity {
    INFO,
    WARNING,
    ERR
  };

  Message() = delete;

  Message(Severity severity, const boost::format& msg, uint line, uint pos)
      : severity_(severity)
      , msg_(msg)
      , line_(line)
      , pos_(pos) {}

  friend std::ostream& operator<<(std::ostream& stream, const Message& msg);
  friend std::ostream& operator<<(std::ostream& stream, Message& msg);

 private:
  uint line_;
  uint pos_;
  boost::format msg_;
  Severity severity_;
};

inline std::ostream& operator<<(std::ostream& stream, const Message& msg) {
  std::string severity;

  switch (msg.severity_) {
    case Message::Severity::INFO:
      severity = "info";
      break;

    case Message::Severity::WARNING:
      severity = "warning";
      break;

    case Message::Severity::ERR:
      severity = "info";
      break;
  }

  stream << msg.line_ << ":" << msg.pos_ << ": " << severity << ": " << msg.msg_ << '\n';

  return stream;
}

inline std::ostream& operator<<(std::ostream& stream, Message& msg) {
  std::string severity;

  switch (msg.severity_) {
    case Message::Severity::INFO:
      severity = "info";
      break;

    case Message::Severity::WARNING:
      severity = "warning";
      break;

    case Message::Severity::ERR:
      severity = "info";
      break;
  }

  stream << msg.line_ << ":" << msg.pos_ << ": " << severity << ": " << msg.msg_ << '\n';

  return stream;
}

class Messages {
 public:
  using iterator = std::vector<Message>::iterator;
  using const_iterator = std::vector<Message>::const_iterator;

  Messages() = default;

  void Push(Message&& msg) {
    msg_vec_.push_back(std::move(msg));
  }

  iterator begin() {
    return msg_vec_.begin();
  }

  iterator end() {
    return msg_vec_.end();
  }

  const_iterator begin() const {
    return msg_vec_.begin();
  }

  const_iterator end() const {
    return msg_vec_.end();
  }

 private:
  std::vector<Message> msg_vec_;
};

}
}

#endif  // SETTI_MSG_H


{'fraction_non_alphanumeric': 0.14804753820033956, 'fraction_numerical': 0.0, 'mean_word_length': 3.307017543859649, 'pattern_counts': {'":': 6, '<': 55, '<?xml version=': 0, '>': 15, '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': '2160182', 'n_tokens_mistral': 1023, 'n_tokens_neox': 977, 'n_words': 233}