lib/icu: migrate from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-11-02 09:54:13 +01:00
parent e9c2885f34
commit 6d409d27ca
8 changed files with 23 additions and 88 deletions

View File

@@ -19,24 +19,21 @@
#include "config.h"
#include "Init.hxx"
#include "Error.hxx"
#include "Collate.hxx"
#include "util/Error.hxx"
#include "util/RuntimeError.hxx"
#include <unicode/uclean.h>
bool
IcuInit(Error &error)
void
IcuInit()
{
UErrorCode code = U_ZERO_ERROR;
u_init(&code);
if (U_FAILURE(code)) {
error.Format(icu_domain, int(code),
"u_init() failed: %s", u_errorName(code));
return false;
}
if (U_FAILURE(code))
throw FormatRuntimeError("u_init() failed: %s",
u_errorName(code));
return IcuCollateInit(error);
IcuCollateInit();
}
void