From 96759377ae8a4394d325747f597fe5b60afabf6e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 11 Nov 2019 05:01:29 -0800 Subject: Working on TextBuilder & Text. Seriously thinking about changing Text to just use full codepoints. It would be much less work, more reliable and predictable, easier to use, but would use twice the memory. --- src/unstable/textcodec.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src/unstable/textcodec.h') diff --git a/src/unstable/textcodec.h b/src/unstable/textcodec.h index e69de29..6ae392e 100644 --- a/src/unstable/textcodec.h +++ b/src/unstable/textcodec.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2007-2019 Xagasoft, All rights reserved. + * + * This file is part of the libbu++ library and is released under the + * terms of the license contained in the file LICENSE. + */ + +#ifndef TEXT_CODEC_H +#define TEXT_CODEC_H + +#include "bu/text.h" +#include "bu/blob.h" + +namespace Bu +{ + class Text; + class Blob; + class TextBuilder; + class BlobBuilder; + + /** + * Represents a textual format and the routines to convert from that + * format to unicode code points and vica versa. + */ + class TextCodec + { + public: + TextCodec(); + virtual ~TextCodec(); + +// virtual Blob encode( const Text &rSource ); +// virtual Text decode( const Blob &rSource, int32_t &rBytesUsed ); + + virtual void encode( BlobBuilder &rTarget, const Text &rSource )=0; + virtual int32_t decode( TextBuilder &rTarget, const Blob &rSource )=0; + + private: + }; +}; + +#endif -- cgit v1.2.3