ICU-1828 xformtrn.* is not used anymore.
X-SVN-Rev: 8327
This commit is contained in:
parent
79be9038f7
commit
548d5febae
@ -68,8 +68,7 @@ ucol.o ucol_bld.o ucol_cnt.o ucol_elm.o ucol_tok.o ucol_wgt.o tblcoll.o \
|
||||
strmatch.o usearch.o search.o stsearch.o \
|
||||
uniset.o unifltlg.o translit.o utrans.o \
|
||||
cpdtrans.o hextouni.o rbt.o rbt_data.o rbt_pars.o rbt_rule.o rbt_set.o \
|
||||
nultrans.o \
|
||||
remtrans.o titletrn.o tolowtrn.o toupptrn.o xformtrn.o \
|
||||
nultrans.o remtrans.o titletrn.o tolowtrn.o toupptrn.o \
|
||||
name2uni.o uni2name.o unitohex.o nortrans.o unifilt.o quant.o transreg.o \
|
||||
nfrs.o nfrule.o nfsubs.o rbnf.o upropset.o util.o esctrn.o unesctrn.o \
|
||||
funcrepl.o strrepl.o tridpars.o unifunct.o caniter.o
|
||||
|
@ -376,10 +376,6 @@ SOURCE=.\util.cpp
|
||||
|
||||
SOURCE=.\utrans.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xformtrn.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
@ -1645,10 +1641,6 @@ InputPath=.\unicode\utrans.h
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xformtrn.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
@ -1,70 +0,0 @@
|
||||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 2001, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* Date Name Description
|
||||
* 05/24/01 aliu Creation.
|
||||
**********************************************************************
|
||||
*/
|
||||
// THIS CLASS IS CURRENTLY UNUSED
|
||||
#if 0
|
||||
|
||||
#include "xformtrn.h"
|
||||
#include "unicode/unifilt.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* Constructs a transliterator. For use by subclasses.
|
||||
*/
|
||||
TransformTransliterator::TransformTransliterator(const UnicodeString& id,
|
||||
UnicodeFilter* adoptedFilter) :
|
||||
Transliterator(id, adoptedFilter) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements {@link Transliterator#handleTransliterate}.
|
||||
* Ignore isIncremental since we don't need the context, and
|
||||
* we work on codepoints.
|
||||
*/
|
||||
void TransformTransliterator::handleTransliterate(Replaceable& text, UTransPosition& offsets,
|
||||
UBool /*isIncremental*/) const {
|
||||
|
||||
int32_t start;
|
||||
for (start = offsets.start; start < offsets.limit; ++start) {
|
||||
// Scan for the first character that is != its transform.
|
||||
// If there are none, we fall out without doing anything.
|
||||
UChar32 c = text.charAt(start);
|
||||
if (hasTransform(c)) {
|
||||
// There is a transforming character at start.
|
||||
|
||||
int32_t len = offsets.limit - start;
|
||||
// assert(len >= 1);
|
||||
|
||||
// Temporary string used to do transformations
|
||||
UnicodeString str;
|
||||
for (int32_t i=start; i<offsets.limit; ++i) {
|
||||
str.append(text.charAt(i));
|
||||
}
|
||||
|
||||
// Transform the characters
|
||||
transform(str);
|
||||
text.handleReplaceBetween(start, start + len, str);
|
||||
start += str.length();
|
||||
|
||||
int32_t lenDelta = str.length() - len;
|
||||
offsets.limit += lenDelta;
|
||||
offsets.contextLimit += lenDelta;
|
||||
offsets.start = offsets.limit;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// assert(start == offsets.limit);
|
||||
offsets.start = offsets.limit;
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
// THIS CLASS IS CURRENTLY UNUSED
|
@ -1,65 +0,0 @@
|
||||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 2001, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* Date Name Description
|
||||
* 05/24/01 aliu Creation.
|
||||
**********************************************************************
|
||||
*/
|
||||
// THIS CLASS IS CURRENTLY UNUSED
|
||||
#if 0
|
||||
|
||||
#ifndef XFORMTRN_H
|
||||
#define XFORMTRN_H
|
||||
|
||||
#include "unicode/translit.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* An abstract class for transliterators based on a transform
|
||||
* operation. To create a transliterator that implements a
|
||||
* transformation, create a subclass of this class and implement the
|
||||
* abstract <code>transform()</code> and <code>hasTransform()</code>
|
||||
* methods.
|
||||
* @author Alan Liu
|
||||
*/
|
||||
class U_I18N_API TransformTransliterator : public Transliterator {
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Constructs a transliterator. For use by subclasses.
|
||||
*/
|
||||
TransformTransliterator(const UnicodeString& id,
|
||||
UnicodeFilter* adoptedFilter);
|
||||
|
||||
/**
|
||||
* Implements {@link Transliterator#handleTransliterate}.
|
||||
*/
|
||||
void handleTransliterate(Replaceable& text, UTransPosition& offset,
|
||||
UBool isIncremental) const;
|
||||
/**
|
||||
* Subclasses must implement this method to determine whether a
|
||||
* given character has a transform that is not equal to itself.
|
||||
* This is approximately equivalent to <code>c !=
|
||||
* transform(String.valueOf(c))</code>, where
|
||||
* <code>String.valueOf(c)</code> returns a String containing the
|
||||
* single character (not integer) <code>c</code>. Subclasses that
|
||||
* transform all their input can simply return <code>true</code>.
|
||||
*/
|
||||
virtual UBool hasTransform(UChar32 c) const = 0;
|
||||
|
||||
/**
|
||||
* Subclasses must implement this method to transform a string.
|
||||
*/
|
||||
virtual void transform(UnicodeString& s) const = 0;
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// THIS CLASS IS CURRENTLY UNUSED
|
Loading…
Reference in New Issue
Block a user