]> git.saurik.com Git - apple/icu.git/blame - icuSources/layout/SingleTableProcessor.cpp
ICU-461.12.tar.gz
[apple/icu.git] / icuSources / layout / SingleTableProcessor.cpp
CommitLineData
b75a7d8f 1/*
b75a7d8f 2 *
374ca955 3 * (C) Copyright IBM Corp. 1998-2004 - 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 "SingleTableProcessor.h"
374ca955 13#include "LEGlyphStorage.h"
b75a7d8f
A
14#include "LESwaps.h"
15
16U_NAMESPACE_BEGIN
17
374ca955 18UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SingleTableProcessor)
b75a7d8f
A
19
20SingleTableProcessor::SingleTableProcessor()
21{
22}
23
24SingleTableProcessor::SingleTableProcessor(const MorphSubtableHeader *moprhSubtableHeader)
25 : NonContextualGlyphSubstitutionProcessor(moprhSubtableHeader)
26{
27 const NonContextualGlyphSubstitutionHeader *header = (const NonContextualGlyphSubstitutionHeader *) moprhSubtableHeader;
28
29 singleTableLookupTable = (const SingleTableLookupTable *) &header->table;
30}
31
32SingleTableProcessor::~SingleTableProcessor()
33{
34}
35
374ca955 36void SingleTableProcessor::process(LEGlyphStorage &glyphStorage)
b75a7d8f
A
37{
38 const LookupSingle *entries = singleTableLookupTable->entries;
39 le_int32 glyph;
374ca955 40 le_int32 glyphCount = glyphStorage.getGlyphCount();
b75a7d8f
A
41
42 for (glyph = 0; glyph < glyphCount; glyph += 1) {
374ca955 43 const LookupSingle *lookupSingle = singleTableLookupTable->lookupSingle(entries, glyphStorage[glyph]);
b75a7d8f
A
44
45 if (lookupSingle != NULL) {
374ca955 46 glyphStorage[glyph] = SWAPW(lookupSingle->value);
b75a7d8f
A
47 }
48 }
49}
50
51U_NAMESPACE_END