2001-06-11 19:51:46 +00:00
|
|
|
/*
|
|
|
|
**********************************************************************
|
|
|
|
* Copyright (C) 2001, International Business Machines
|
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
**********************************************************************
|
|
|
|
* Date Name Description
|
|
|
|
* 05/24/01 aliu Creation.
|
|
|
|
**********************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "unicode/toupptrn.h"
|
|
|
|
|
2001-10-08 23:26:58 +00:00
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2001-06-11 19:51:46 +00:00
|
|
|
const char* UppercaseTransliterator::_ID = "Any-Upper";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructs a transliterator.
|
|
|
|
*/
|
|
|
|
UppercaseTransliterator::UppercaseTransliterator(const Locale& theLoc,
|
|
|
|
UnicodeFilter* adoptedFilter) :
|
|
|
|
TransformTransliterator(_ID, adoptedFilter),
|
|
|
|
loc(theLoc) {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor.
|
|
|
|
*/
|
|
|
|
UppercaseTransliterator::~UppercaseTransliterator() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Copy constructor.
|
|
|
|
*/
|
|
|
|
UppercaseTransliterator::UppercaseTransliterator(const UppercaseTransliterator& o) :
|
|
|
|
TransformTransliterator(o),
|
|
|
|
loc(o.loc) {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Assignment operator.
|
|
|
|
*/
|
|
|
|
UppercaseTransliterator& UppercaseTransliterator::operator=(
|
|
|
|
const UppercaseTransliterator& o) {
|
|
|
|
TransformTransliterator::operator=(o);
|
|
|
|
loc = o.loc;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Transliterator API.
|
|
|
|
*/
|
|
|
|
Transliterator* UppercaseTransliterator::clone(void) const {
|
|
|
|
return new UppercaseTransliterator(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TransformTransliterator framework method.
|
|
|
|
*/
|
|
|
|
UBool UppercaseTransliterator::hasTransform(UChar32 c) const {
|
|
|
|
return c != u_toupper(c);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TransformTransliterator framework method.
|
|
|
|
*/
|
|
|
|
void UppercaseTransliterator::transform(UnicodeString& s) const {
|
|
|
|
s.toUpper(loc);
|
|
|
|
}
|
2001-10-08 23:26:58 +00:00
|
|
|
|
|
|
|
U_NAMESPACE_END
|
|
|
|
|