1 /*
2 *
3 * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved
4 *
5 */
6
7 #include "LETypes.h"
8 #include "MorphTables.h"
9 #include "SubtableProcessor2.h"
10 #include "NonContextualGlyphSubst.h"
11 #include "NonContextualGlyphSubstProc2.h"
12 #include "SimpleArrayProcessor2.h"
13 #include "SegmentSingleProcessor2.h"
14 #include "SegmentArrayProcessor2.h"
15 #include "SingleTableProcessor2.h"
16 #include "TrimmedArrayProcessor2.h"
17 #include "LESwaps.h"
18
19 U_NAMESPACE_BEGIN
20
NonContextualGlyphSubstitutionProcessor2()21 NonContextualGlyphSubstitutionProcessor2::NonContextualGlyphSubstitutionProcessor2()
22 {
23 }
24
NonContextualGlyphSubstitutionProcessor2(const LEReferenceTo<MorphSubtableHeader2> & morphSubtableHeader,LEErrorCode & success)25 NonContextualGlyphSubstitutionProcessor2::NonContextualGlyphSubstitutionProcessor2(
26 const LEReferenceTo<MorphSubtableHeader2> &morphSubtableHeader, LEErrorCode &success)
27 : SubtableProcessor2(morphSubtableHeader, success)
28 {
29 }
30
~NonContextualGlyphSubstitutionProcessor2()31 NonContextualGlyphSubstitutionProcessor2::~NonContextualGlyphSubstitutionProcessor2()
32 {
33 }
34
createInstance(const LEReferenceTo<MorphSubtableHeader2> & morphSubtableHeader,LEErrorCode & success)35 SubtableProcessor2 *NonContextualGlyphSubstitutionProcessor2::createInstance(
36 const LEReferenceTo<MorphSubtableHeader2> &morphSubtableHeader, LEErrorCode &success)
37 {
38 const LEReferenceTo<NonContextualGlyphSubstitutionHeader2> header(morphSubtableHeader, success);
39 if(LE_FAILURE(success)) return NULL;
40
41 switch (SWAPW(header->table.format))
42 {
43 case ltfSimpleArray:
44 return new SimpleArrayProcessor2(morphSubtableHeader, success);
45
46 case ltfSegmentSingle:
47 return new SegmentSingleProcessor2(morphSubtableHeader, success);
48
49 case ltfSegmentArray:
50 return new SegmentArrayProcessor2(morphSubtableHeader, success);
51
52 case ltfSingleTable:
53 return new SingleTableProcessor2(morphSubtableHeader, success);
54
55 case ltfTrimmedArray:
56 return new TrimmedArrayProcessor2(morphSubtableHeader, success);
57
58 default:
59 return NULL;
60 }
61 }
62
63 U_NAMESPACE_END
64