#pragma once
#include "default.h"

namespace uf {
	namespace locale {
		class UF_API Ansi : public Encoding {
		public:
			typedef uint8_t literal_t;
		protected:
			typedef literal_t Literal;
			Literal m_literal;
		public:
		// 	Converts from UTF-8 to UTF-32
			template<typename Input>
			static Input UF_API_CALL decode( Input input, Input dead, Encoding::Literal& output, Encoding::Literal fallback = 0 );
			template<typename Input>
			inline static Encoding::Literal UF_API_CALL decode( Input input, Input dead = 0, Encoding::Literal fallback = 0 ) {
				Encoding::Literal literal;
				Ansi::decode(input, dead, literal, fallback);
				return literal;
			}
		// 	Converts from UTF-32 to UTF-8
			template<typename Input, typename Output>
			static Output UF_API_CALL encode( Input input, Output output, Literal fallback = 0 );
		// 	Go to the next character in UTF-8's sequence
			template<typename Input>
			static Input UF_API_CALL next(Input begin, Input end);
		// 	Number of characters in UTF-8's sequence
			template<typename Input>
			static Input UF_API_CALL length(Input begin, Input end);
		// 	Encoding's name
			static uf::stl::string UF_API_CALL getName() { return "ANSI"; }
		};
	}
}
/*
#include "encoding_constructor.h"
ENCODING_CONSTRUCTOR(Ansi: public Encoding, uint8_t, "UTF-8")
*/
#include "ansi.inl"