]> git.saurik.com Git - apple/icu.git/blame - icuSources/layout/NonContextualGlyphSubstProc.cpp
ICU-57166.0.1.tar.gz
[apple/icu.git] / icuSources / layout / NonContextualGlyphSubstProc.cpp
CommitLineData
b75a7d8f 1/*
b75a7d8f 2 *
57a6839d 3 * (C) Copyright IBM Corp. 1998-2013 - All Rights Reserved
b75a7d8f
A
4 *
5 */
6
7#include "LETypes.h"
8#include "MorphTables.h"
9#include "SubtableProcessor.h"
10#include "NonContextualGlyphSubst.h"
11#include "NonContextualGlyphSubstProc.h"
12#include "SimpleArrayProcessor.h"
13#include "SegmentSingleProcessor.h"
14#include "SegmentArrayProcessor.h"
15#include "SingleTableProcessor.h"
16#include "TrimmedArrayProcessor.h"
17#include "LESwaps.h"
18
19U_NAMESPACE_BEGIN
20
21NonContextualGlyphSubstitutionProcessor::NonContextualGlyphSubstitutionProcessor()
22{
23}
24
57a6839d
A
25NonContextualGlyphSubstitutionProcessor::NonContextualGlyphSubstitutionProcessor(const LEReferenceTo<MorphSubtableHeader> &morphSubtableHeader, LEErrorCode &success)
26 : SubtableProcessor(morphSubtableHeader, success)
b75a7d8f
A
27{
28}
29
30NonContextualGlyphSubstitutionProcessor::~NonContextualGlyphSubstitutionProcessor()
31{
32}
33
57a6839d 34SubtableProcessor *NonContextualGlyphSubstitutionProcessor::createInstance(const LEReferenceTo<MorphSubtableHeader> &morphSubtableHeader, LEErrorCode &success)
b75a7d8f 35{
57a6839d 36 LEReferenceTo<NonContextualGlyphSubstitutionHeader> header(morphSubtableHeader, success);
b75a7d8f 37
57a6839d
A
38 if(LE_FAILURE(success)) return NULL;
39
40 switch (SWAPW(header->table.format)) {
b75a7d8f 41 case ltfSimpleArray:
57a6839d 42 return new SimpleArrayProcessor(morphSubtableHeader, success);
b75a7d8f
A
43
44 case ltfSegmentSingle:
57a6839d 45 return new SegmentSingleProcessor(morphSubtableHeader, success);
b75a7d8f
A
46
47 case ltfSegmentArray:
57a6839d 48 return new SegmentArrayProcessor(morphSubtableHeader, success);
b75a7d8f
A
49
50 case ltfSingleTable:
57a6839d 51 return new SingleTableProcessor(morphSubtableHeader, success);
b75a7d8f
A
52
53 case ltfTrimmedArray:
57a6839d 54 return new TrimmedArrayProcessor(morphSubtableHeader, success);
b75a7d8f
A
55
56 default:
57 return NULL;
58 }
59}
60
61U_NAMESPACE_END