/*
*******************************************************************************
*
-* Copyright (C) 2001-2004, International Business Machines
+* Copyright (C) 2001-2010, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
U_CFUNC UChar32 U_CALLCONV
utrans_rep_caseContextIterator(void *context, int8_t dir)
{
+ U_NAMESPACE_USE
+
UCaseContext *csc=(UCaseContext *)context;
Replaceable *rep=(Replaceable *)csc->p;
UChar32 c;
U_NAMESPACE_BEGIN
-UOBJECT_DEFINE_RTTI_IMPLEMENTATION(CaseMapTransliterator)
+UOBJECT_DEFINE_ABSTRACT_RTTI_IMPLEMENTATION(CaseMapTransliterator)
/**
* Constructs a transliterator.
*/
-CaseMapTransliterator::CaseMapTransliterator(const Locale &loc, const UnicodeString &id, UCaseMapFull *map) :
+CaseMapTransliterator::CaseMapTransliterator(const UnicodeString &id, UCaseMapFull *map) :
Transliterator(id, 0),
- fLoc(loc), fLocName(NULL),
- fCsp(NULL),
+ fCsp(ucase_getSingleton()),
fMap(map)
{
- UErrorCode errorCode = U_ZERO_ERROR;
- fCsp = ucase_getSingleton(&errorCode); // expect to get NULL if failure
- fLocName=fLoc.getName();
-
// TODO test incremental mode with context-sensitive text (e.g. greek sigma)
// TODO need to call setMaximumContextLength()?!
}
*/
CaseMapTransliterator::CaseMapTransliterator(const CaseMapTransliterator& o) :
Transliterator(o),
- fLoc(o.fLoc), fLocName(NULL), fCsp(o.fCsp), fMap(o.fMap)
+ fCsp(o.fCsp), fMap(o.fMap)
{
- fLocName=fLoc.getName();
}
/**
* Assignment operator.
*/
-CaseMapTransliterator& CaseMapTransliterator::operator=(const CaseMapTransliterator& o) {
+/*CaseMapTransliterator& CaseMapTransliterator::operator=(const CaseMapTransliterator& o) {
Transliterator::operator=(o);
- fLoc = o.fLoc;
- fLocName = fLoc.getName();
fCsp = o.fCsp;
fMap = o.fMap;
return *this;
-}
+}*/
/**
* Transliterator API.
*/
-Transliterator* CaseMapTransliterator::clone(void) const {
+/*Transliterator* CaseMapTransliterator::clone(void) const {
return new CaseMapTransliterator(*this);
-}
+}*/
/**
* Implements {@link Transliterator#handleTransliterate}.
c=text.char32At(textPos);
csc.cpLimit=textPos+=U16_LENGTH(c);
- result=fMap(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, fLocName, &locCache);
+ result=fMap(fCsp, c, utrans_rep_caseContextIterator, &csc, &s, "", &locCache);
if(csc.b1 && isIncremental) {
// fMap() tried to look beyond the context limit
// wait for more input
- break;
+ offsets.start=csc.cpStart;
+ return;
}
if(result>=0) {