aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/textcodec.h
blob: c6426d62661b1ce4022fc1da9a5b0a2432627197 (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-2023 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