File: convfact.cxx

package info (click to toggle)
swath 0.3.0.cvs20030404
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,564 kB
  • ctags: 545
  • sloc: sh: 6,926; cpp: 3,643; makefile: 151
file content (28 lines) | stat: -rw-r--r-- 676 bytes parent folder | download | duplicates (2)
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
//
// convfact.h - Text Agent Factory
// Created: 19 Jan 1999
// Author:  Theppitak Karoonboonyanan <thep@links.nectec.or.th>
//

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

TextReader* CreateTextReader(ETextFormat format, std::istream& input)
{
    switch (format) {
        case TIS620:  return new TIS620Reader(input);
        case UTF8:    return new UTF8Reader(input);
        default:      return 0;
    }
}

TextWriter* CreateTextWriter(ETextFormat format, std::ostream& output)
{
    switch (format) {
        case TIS620:  return new TIS620Writer(output);
        case UTF8:    return new UTF8Writer(output);
        default:      return 0;
    }
}