<commit_before>// This file is part of the "x0" project, http://github.com/christianparpart/x0>
//   (c) 2009-2017 <NAME> <<EMAIL>>
//
// Licensed under the MIT License (the "License"); you may not use this
// file except in compliance with the License. You may obtain a copy of
// the License at: http://opensource.org/licenses/MIT

#include <string>
#include <sstream>
#include <iomanip>
#include <system_error>
#include <xzero/RuntimeError.h>
#include <xzero/BufferUtil.h>
#include <xzero/StringUtil.h>
#include <xzero/UTF8.h>

namespace xzero {

void StringUtil::toStringVImpl(std::vector<std::string>* target) {}

template <>
std::string StringUtil::toString(std::string value) {
  return value;
}

template <>
std::string StringUtil::toString(const char* value) {
  return value;
}

template <>
std::string StringUtil::toString(char value) {
  std::string result;
  result.push_back(value);
  return result;
}

template <>
std::string StringUtil::toString(char* value) {
  return value;
}

template <>
std::string StringUtil::toString(int value) {<commit_msg>[xzero] StringUtil: adds support to stringify `std::errc`<commit_after>// This file is part of the "x0" project, http://github.com/christianparpart/x0>
//   (c) 2009-2017 <NAME> <<EMAIL>>
//
// Licensed under the MIT License (the "License"); you may not use this
// file except in compliance with the License. You may obtain a copy of
// the License at: http://opensource.org/licenses/MIT

#include <string>
#include <sstream>
#include <iomanip>
#include <system_error>
#include <xzero/RuntimeError.h>
#include <xzero/BufferUtil.h>
#include <xzero/StringUtil.h>
#include <xzero/UTF8.h>

namespace xzero {

void StringUtil::toStringVImpl(std::vector<std::string>* target) {}

template <>
std::string StringUtil::toString(std::string value) {
  return value;
}

template <>
std::string StringUtil::toString(std::errc value) {
  return std::make_error_code(value).message();
}

template <>
std::string StringUtil::toString(const char* value) {
  return value;
}

template <>
std::string StringUtil::toString(char value) {
  std::string result;
  result.push_back(value);
  return result;
}

template <>
std::string StringUtil::toString(char* value) {
  return value;
}

template <>
std::string StringUtil::toString(int value) {
{'fraction_non_alphanumeric': 0.1489733508082132, 'fraction_numerical': 0.009611183923110528, 'mean_word_length': 5.3259668508287294, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 40, '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': '2715848', 'n_tokens_mistral': 768, 'n_tokens_neox': 739, 'n_words': 204}