<commit_before>#include "Document.h"

#include <direct.h>


std::string build_path(const char *dirname, const char *filename, const char *format);


Document::Document(const char *name, int width, int height):
  LayerGroup(name),
  width_(width),
  height_(height)
{}


void Document::save_layers(const std::string& dir, LayerGroup *group)
{
	Record *child = group->first_child();
	if (!child) return;

	_mkdir(dir.c_str());

	do {
		std::string path_prefix(dir);<commit_msg>Fix mkdir portability issue<commit_after>#include "Document.h"

#if !defined(_MSC_VER)
#  include <sys/stat.h>
#else
#  include <direct.h>
#  define mkdir(x, y) _mkdir(x)
#endif

std::string build_path(const char *dirname, const char *filename, const char *format);


Document::Document(const char *name, int width, int height):
  LayerGroup(name),
  width_(width),
  height_(height)
{}


void Document::save_layers(const std::string& dir, LayerGroup *group)
{
	Record *child = group->first_child();
	if (!child) return;

	mkdir(dir.c_str(), 0755);

	do {
		std::string path_prefix(dir);
{'fraction_non_alphanumeric': 0.15254237288135594, 'fraction_numerical': 0.003766478342749529, 'mean_word_length': 5.727848101265823, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, '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': '5773420', 'n_tokens_mistral': 384, 'n_tokens_neox': 361, 'n_words': 93}