AuroraRuntime/Source/Locale/Encoding/EncoderAdapter.hpp
2021-09-06 11:58:08 +01:00

27 lines
747 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: EncoderAdapter.hpp
Date: 2021-8-19
Author: Reece
***/
#pragma once
namespace Aurora::Locale::Encoding
{
struct EncoderAdapter
{
void *iconv {};
ECodePage page;
bool decode;
EncoderAdapter();
~EncoderAdapter();
void Init(ECodePage page, bool decode);
AuStreamReadWrittenPair_t CPToUTF8(void *in, AuUInt32 length, void *utf8, AuUInt32 utf8Len);
AuStreamReadWrittenPair_t CPToUTF8(const void *in, AuUInt32 length, void *utf8, AuUInt32 utf8Len);
AuStreamReadWrittenPair_t UTF8ToCp(const void *utf8, AuUInt32 utf8Length, void *cp, AuUInt32 cpLen);
};
}