summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaszlo Boszormenyi (GCS) <gcs@debian.org>2018-11-12 23:05:48 +0700
committerDaniel Glassey <wdg@debian.org>2018-11-12 23:05:48 +0700
commit751f76b17098e0e9d043be7f614cec427601484e (patch)
tree07ef203ffc9fdc548ec13bc1cb27b1b10a28cf84 /src
parentec8b3183965e24f5dc037b84294febf92fa83e8e (diff)
fix FTBFS with ICU 63.1
Add icu namespace. Last-Update: 2018-11-04 Gbp-Pq: Name sword_ICU_63.1.patch
Diffstat (limited to 'src')
-rw-r--r--src/modules/filters/scsuutf8.cpp2
-rw-r--r--src/modules/filters/utf8nfc.cpp6
-rw-r--r--src/modules/filters/utf8scsu.cpp2
-rw-r--r--src/modules/filters/utf8transliterator.cpp36
4 files changed, 23 insertions, 23 deletions
diff --git a/src/modules/filters/scsuutf8.cpp b/src/modules/filters/scsuutf8.cpp
index 73e4a3f..df9734b 100644
--- a/src/modules/filters/scsuutf8.cpp
+++ b/src/modules/filters/scsuutf8.cpp
@@ -140,7 +140,7 @@ char SCSUUTF8::processText(SWBuf &text, const SWKey *key, const SWModule *module
#ifdef _ICU_
// Try decoding with ICU if possible
err = U_ZERO_ERROR;
- UnicodeString utf16Text(text.getRawData(), text.length(), scsuConv, err);
+ icu::UnicodeString utf16Text(text.getRawData(), text.length(), scsuConv, err);
err = U_ZERO_ERROR;
int32_t len = utf16Text.extract(text.getRawData(), text.size(), utf8Conv, err);
if (len > (int32_t)text.size()+1) {
diff --git a/src/modules/filters/utf8nfc.cpp b/src/modules/filters/utf8nfc.cpp
index 16a5c54..af1d9bd 100644
--- a/src/modules/filters/utf8nfc.cpp
+++ b/src/modules/filters/utf8nfc.cpp
@@ -46,11 +46,11 @@ char UTF8NFC::processText(SWBuf &text, const SWKey *key, const SWModule *module)
return -1;
err = U_ZERO_ERROR;
- UnicodeString source(text.getRawData(), text.length(), conv, err);
- UnicodeString target;
+ icu::UnicodeString source(text.getRawData(), text.length(), conv, err);
+ icu::UnicodeString target;
err = U_ZERO_ERROR;
- Normalizer::normalize(source, UNORM_NFC, 0, target, err);
+ icu::Normalizer::normalize(source, UNORM_NFC, 0, target, err);
err = U_ZERO_ERROR;
text.setSize(text.size()*2); // potentially, it can grow to 2x the original size
diff --git a/src/modules/filters/utf8scsu.cpp b/src/modules/filters/utf8scsu.cpp
index bf5bd41..63b193f 100644
--- a/src/modules/filters/utf8scsu.cpp
+++ b/src/modules/filters/utf8scsu.cpp
@@ -46,7 +46,7 @@ char UTF8SCSU::processText(SWBuf &text, const SWKey *key, const SWModule *module
return -1;
err = U_ZERO_ERROR;
- UnicodeString utf16Text(text.getRawData(), text.length(), utf8Conv, err);
+ icu::UnicodeString utf16Text(text.getRawData(), text.length(), utf8Conv, err);
err = U_ZERO_ERROR;
int32_t len = utf16Text.extract(text.getRawData(), text.size(), scsuConv, err);
if (len > (int32_t)text.size()+1) {
diff --git a/src/modules/filters/utf8transliterator.cpp b/src/modules/filters/utf8transliterator.cpp
index b5b1902..40e9cc2 100644
--- a/src/modules/filters/utf8transliterator.cpp
+++ b/src/modules/filters/utf8transliterator.cpp
@@ -107,14 +107,14 @@ const char UTF8Transliterator::SW_RESDATA[] = "/usr/local/lib/sword/";
class SWCharString {
public:
- inline SWCharString(const UnicodeString& str);
+ inline SWCharString(const icu::UnicodeString& str);
inline ~SWCharString();
inline operator const char*() { return ptr; }
private:
char buf[128];
char* ptr;
};
-SWCharString::SWCharString(const UnicodeString& str) {
+SWCharString::SWCharString(const icu::UnicodeString& str) {
// TODO This isn't quite right -- we should probably do
// preflighting here to determine the real length.
if (str.length() >= (int32_t)sizeof(buf)) {
@@ -176,9 +176,9 @@ void UTF8Transliterator::Load(UErrorCode &status)
colBund = ures_getByIndex(transIDs, row, 0, &status);
if (U_SUCCESS(status) && ures_getSize(colBund) == 4) {
- UnicodeString id = ures_getUnicodeStringByIndex(colBund, 0, &status);
- UChar type = ures_getUnicodeStringByIndex(colBund, 1, &status).charAt(0);
- UnicodeString resString = ures_getUnicodeStringByIndex(colBund, 2, &status);
+ icu::UnicodeString id = ures_getUnicodeStringByIndex(colBund, 0, &status);
+ icu::UChar type = ures_getUnicodeStringByIndex(colBund, 1, &status).charAt(0);
+ icu::UnicodeString resString = ures_getUnicodeStringByIndex(colBund, 2, &status);
SWLog::getSystemLog()->logDebug("ok so far");
if (U_SUCCESS(status)) {
@@ -223,7 +223,7 @@ void UTF8Transliterator::Load(UErrorCode &status)
#endif // _ICUSWORD_
}
-void UTF8Transliterator::registerTrans(const UnicodeString& ID, const UnicodeString& resource,
+void UTF8Transliterator::registerTrans(const icu::UnicodeString& ID, const icu::UnicodeString& resource,
UTransDirection dir, UErrorCode &status )
{
#ifndef _ICUSWORD_
@@ -238,10 +238,10 @@ void UTF8Transliterator::registerTrans(const UnicodeString& ID, const UnicodeSt
#endif
}
-bool UTF8Transliterator::checkTrans(const UnicodeString& ID, UErrorCode &status )
+bool UTF8Transliterator::checkTrans(const icu::UnicodeString& ID, UErrorCode &status )
{
#ifndef _ICUSWORD_
- Transliterator *trans = Transliterator::createInstance(ID, UTRANS_FORWARD, status);
+ icu::Transliterator *trans = icu::Transliterator::createInstance(ID, UTRANS_FORWARD, status);
if (!U_FAILURE(status))
{
// already have it, clean up and return true
@@ -259,14 +259,14 @@ bool UTF8Transliterator::checkTrans(const UnicodeString& ID, UErrorCode &status
UParseError parseError;
//UErrorCode status;
//std::cout << "unregistering " << ID << std::endl;
- //Transliterator::unregister(ID);
+ //icu::Transliterator::unregister(ID);
SWLog::getSystemLog()->logDebug("resource is %s", swstuff.resource.getBuffer());
// Get the rules
//std::cout << "importing: " << ID << ", " << resource << std::endl;
SWCharString ch(swstuff.resource);
UResourceBundle *bundle = ures_openDirect(SW_RESDATA, ch, &status);
- const UnicodeString rules = ures_getUnicodeStringByKey(bundle, SW_RB_RULE, &status);
+ const icu::UnicodeString rules = ures_getUnicodeStringByKey(bundle, SW_RB_RULE, &status);
ures_close(bundle);
//parser.parse(rules, isReverse ? UTRANS_REVERSE : UTRANS_FORWARD,
// parseError, status);
@@ -277,7 +277,7 @@ bool UTF8Transliterator::checkTrans(const UnicodeString& ID, UErrorCode &status
}
- Transliterator *trans = Transliterator::createFromRules(ID, rules, swstuff.dir,
+ icu::Transliterator *trans = icu::Transliterator::createFromRules(ID, rules, swstuff.dir,
parseError,status);
if (U_FAILURE(status)) {
SWLog::getSystemLog()->logError("UTF8Transliterator: ICU: Failed to create transliterator");
@@ -291,10 +291,10 @@ bool UTF8Transliterator::checkTrans(const UnicodeString& ID, UErrorCode &status
return false;
}
- Transliterator::registerInstance(trans);
+ icu::Transliterator::registerInstance(trans);
return true;
- //Transliterator *trans = instantiateTrans(ID, swstuff.resource, swstuff.dir, parseError, status);
+ //icu::Transliterator *trans = instantiateTrans(ID, swstuff.resource, swstuff.dir, parseError, status);
//return trans;
}
else
@@ -311,7 +311,7 @@ bool UTF8Transliterator::addTrans(const char* newTrans, SWBuf* transList) {
#ifdef ICU_CUSTOM_RESOURCE_BUILDING
#ifdef _ICUSWORD_
UErrorCode status;
- if (checkTrans(UnicodeString(newTrans), status)) {
+ if (checkTrans(icu::UnicodeString(newTrans), status)) {
#endif
#endif // ICU_CUSTOM_RESOURCE_BUILDING
*transList += newTrans;
@@ -328,9 +328,9 @@ bool UTF8Transliterator::addTrans(const char* newTrans, SWBuf* transList) {
}
-Transliterator * UTF8Transliterator::createTrans(const UnicodeString& ID, UTransDirection dir, UErrorCode &status )
+icu::Transliterator * UTF8Transliterator::createTrans(const icu::UnicodeString& ID, UTransDirection dir, UErrorCode &status )
{
- Transliterator *trans = Transliterator::createInstance(ID,UTRANS_FORWARD,status);
+ icu::Transliterator *trans = icu::Transliterator::createInstance(ID,UTRANS_FORWARD,status);
if (U_FAILURE(status)) {
delete trans;
return NULL;
@@ -906,9 +906,9 @@ char UTF8Transliterator::processText(SWBuf &text, const SWKey *key, const SWModu
addTrans("NFC", &ID);
err = U_ZERO_ERROR;
- Transliterator * trans = createTrans(UnicodeString(ID), UTRANS_FORWARD, err);
+ icu::Transliterator * trans = createTrans(icu::UnicodeString(ID), UTRANS_FORWARD, err);
if (trans && !U_FAILURE(err)) {
- UnicodeString target = UnicodeString(source);
+ icu::UnicodeString target = icu::UnicodeString(source);
trans->transliterate(target);
text.setSize(text.size()*2);
len = ucnv_fromUChars(conv, text.getRawData(), text.size(), target.getBuffer(), target.length(), &err);