aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/textcodec.h
blob: 6ae392e6a1bed55127e43f58ab07d7c3f5f40e6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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