File: convfact.cxx

package info (click to toggle)
swath 0.6.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,472 kB
  • sloc: sh: 4,361; cpp: 2,332; makefile: 148
file content (30 lines) | stat: -rw-r--r-- 702 bytes parent folder | download | duplicates (4)
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
//
// convfact.h - Text Agent Factory
// Created: 19 Jan 1999
// Author:  Theppitak Karoonboonyanan <theppitak@gmail.com>
//

#include "convfact.h"
#include "utf8.h"
#include "tis620.h"

TextReader*
CreateTextReader (ETextFormat format, const char* inText)
{
    switch (format) {
        case TIS620:  return new TIS620Reader (inText);
        case UTF8:    return new UTF8Reader (inText);
        default:      return 0;
    }
}

TextWriter*
CreateTextWriter (ETextFormat format, char* outText, int outLen)
{
    switch (format) {
        case TIS620:  return new TIS620Writer (outText, outLen);
        case UTF8:    return new UTF8Writer (outText, outLen);
        default:      return 0;
    }
}