<commit_before>#ifndef __ciri_errorcodes__
#define __ciri_errorcodes__

#include <unordered_map>

namespace ciri {
	namespace err {
		enum ErrorCode : int {
			CIRI_OK = 0,
			CIRI_UNKNOWN_ERROR					= -1,
			CIRI_FILE_NOT_FOUND					= -2,
			CIRI_PATH_NOT_FOUND					= -3,
			CIRI_SHADER_COMPILE_FAILED	=	-4,
			CIRI_SHADER_LINK_FAILED			=	-5,
			CIRI_SHADER_INCOMPLETE			=	-6,
			CIRI_SHADER_INVALID					=	-7,
			CIRI_INVALID_ARGUMENT				= -8,
			CIRI_NOT_IMPLEMENTED				=	-9
		};

		static std::unordered_map<ErrorCode, const char*> errorStrings = {
			{ CIRI_OK, "No error" },
			{ CIRI_UNKNOWN_ERROR, "Unknown error" },
			{ CIRI_FILE_NOT_FOUND, "File not found" },
			{ CIRI_PATH_NOT_FOUND, "Path not found" },
			{ CIRI_SHADER_COMPILE_FAILED, "Shader compile failed" },
			{ CIRI_SHADER_LINK_FAILED, "Shader link failed" },
			{ CIRI_SHADER_INCOMPLETE, "Shader data incomplete" },
			{ CIRI_SHADER_INVALID, "Shader is invalid" },
			{ CIRI_INVALID_ARGUMENT, "Invalid argument" },
			{ CIRI_NOT_IMPLEMENTED, "Not yet implemented" }
		};

		static bool success( const ErrorCode& code ) {
			return CIRI_OK == code;
		}

		static bool failed( const ErrorCode& code ) {
			return code != CIRI_OK;
		}

		static const char* getString( const ErrorCode& code ) {<commit_msg>Added two new error codes: CIRI_STATIC_BUFFER_AS_DYNAMIC for when attempting to remap a static buffer, and CIRI_BUFFER_MAP_FAILED for when mapping of an existing buffer fails (this currently does not happen in GL because subresource data is updated rather than using the DX-like mapping method, which I may switch to in the future, unsure right now).<commit_after>#ifndef __ciri_errorcodes__
#define __ciri_errorcodes__

#include <unordered_map>

namespace ciri {
	namespace err {
		enum ErrorCode : int {
			CIRI_OK = 0,
			CIRI_UNKNOWN_ERROR						= -1,
			CIRI_FILE_NOT_FOUND						= -2,
			CIRI_PATH_NOT_FOUND						= -3,
			CIRI_SHADER_COMPILE_FAILED		=	-4,
			CIRI_SHADER_LINK_FAILED				=	-5,
			CIRI_SHADER_INCOMPLETE				=	-6,
			CIRI_SHADER_INVALID						=	-7,
			CIRI_INVALID_ARGUMENT					= -8,
			CIRI_STATIC_BUFFER_AS_DYNAMIC = -9,
			CIRI_BUFFER_MAP_FAILED				= -10,
			CIRI_NOT_IMPLEMENTED					=	-11
		};

		static std::unordered_map<ErrorCode, const char*> errorStrings = {
			{ CIRI_OK, "No error" },
			{ CIRI_UNKNOWN_ERROR, "Unknown error" },
			{ CIRI_FILE_NOT_FOUND, "File not found" },
			{ CIRI_PATH_NOT_FOUND, "Path not found" },
			{ CIRI_SHADER_COMPILE_FAILED, "Shader compile failed" },
			{ CIRI_SHADER_LINK_FAILED, "Shader link failed" },
			{ CIRI_SHADER_INCOMPLETE, "Shader data incomplete" },
			{ CIRI_SHADER_INVALID, "Shader is invalid" },
			{ CIRI_INVALID_ARGUMENT, "Invalid argument" },
			{ CIRI_STATIC_BUFFER_AS_DYNAMIC, "Attempted to treat a static buffer as a dynamic buffer" },
			{ CIRI_BUFFER_MAP_FAILED, "Failed to map a buffer" },
			{ CIRI_NOT_IMPLEMENTED, "Not yet implemented" }
		};

		static bool success( const ErrorCode& code ) {
			return CIRI_OK == code;
		}

		static bool failed( const ErrorCode& code ) {
			return code != CIRI_OK;
		}

		static const char* getString( const ErrorCode& code ) {
{'fraction_non_alphanumeric': 0.0930381777350016, 'fraction_numerical': 0.007699711260827719, 'mean_word_length': 3.76030534351145, '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': '3193107', 'n_tokens_mistral': 1364, 'n_tokens_neox': 1197, 'n_words': 274}