<commit_before>/*
 * Copyright 2015 - 2021 <EMAIL>
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#pragma once

#include <ox/std/types.hpp>

namespace ox {

enum class FileType: uint8_t {
	None = 0,
	NormalFile = 1,
	Directory  = 2
};

constexpr const char *toString(FileType t) {
	switch (t) {
		case FileType::NormalFile:
			return "Normal File";
		case FileType::Directory:
			return "Directory";
		default:
			return "";
	}
}

struct FileStat {
	uint64_t inode = 0;
	uint64_t links = 0;
	uint64_t size = 0;
	FileType fileType = FileType::None;
};

}<commit_msg>[ox/fs] Make toString(FileType) noexcept<commit_after>/*
 * Copyright 2015 - 2021 <EMAIL>
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#pragma once

#include <ox/std/types.hpp>

namespace ox {

enum class FileType: uint8_t {
	None = 0,
	NormalFile = 1,
	Directory  = 2
};

constexpr const char *toString(FileType t) noexcept {
	switch (t) {
		case FileType::NormalFile:
			return "Normal File";
		case FileType::Directory:
			return "Directory";
		default:
			return "";
	}
}

struct FileStat {
	uint64_t inode = 0;
	uint64_t links = 0;
	uint64_t size = 0;
	FileType fileType = FileType::None;
};

}
{'fraction_non_alphanumeric': 0.11729222520107238, 'fraction_numerical': 0.03351206434316354, 'mean_word_length': 3.4171597633136095, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5380478', 'n_tokens_mistral': 583, 'n_tokens_neox': 516, 'n_words': 178}