!249 一致性整改

Merge pull request !249 from zhangdd_ewan/cherry-240712
This commit is contained in:
openharmony_ci 2024-07-23 11:24:59 +00:00 committed by Gitee
commit 70101c403f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
15 changed files with 1056 additions and 610 deletions

View File

@ -269,7 +269,6 @@ icu_common_source = [
"//third_party/icu/icu4c/source/common/servnotf.cpp",
"//third_party/icu/icu4c/source/common/emojiprops.cpp",
"//third_party/icu/icu4c/source/common/lstmbe.cpp",
"//third_party/icu/icu4c/source/ohos/distro_tzdata_loader.cpp",
"//third_party/icu/icu4c/source/ohos/init_data.cpp",
]
@ -542,9 +541,6 @@ ohos_shared_library("shared_icuuc") {
"DISTRO_TZDATA_DIR=${distro_tzdata_dir}",
"SYSTEM_TZDATA_DIR=${system_tzdata_dir}",
]
if (!is_mingw) {
defines += [ "ICU_SUPPORT_DISTRO" ]
}
sources = icu_common_source
deps = [
":ohos_icudat",
@ -648,9 +644,6 @@ if (defined(is_arkui_x) && is_arkui_x) {
"UCONFIG_USE_WINDOWS_LCID_MAPPING_API=0",
"_REENTRANT",
]
if (!is_mingw) {
defines += [ "ICU_SUPPORT_DISTRO" ]
}
sources = icu_common_source
cflags_cc = [
"-W",

View File

@ -38,10 +38,9 @@ ohos_shared_library("shared_icuuc_host") {
"UPRV_BLOCK_MACRO_END=",
"UCONFIG_USE_WINDOWS_LCID_MAPPING_API=0",
"_REENTRANT",
"DISTRO_TZDATA_DIR=\"/system/etc/tzdata_distro\"",
"SYSTEM_TZDATA_DIR=\"/system/etc/icu_tzdata\"",
]
if (!is_mingw) {
defines += [ "ICU_SUPPORT_DISTRO" ]
}
sources = [
"//third_party/icu/icu4c/source/common/appendable.cpp",
"//third_party/icu/icu4c/source/common/bmpset.cpp",
@ -241,7 +240,6 @@ ohos_shared_library("shared_icuuc_host") {
"//third_party/icu/icu4c/source/common/uvectr32.cpp",
"//third_party/icu/icu4c/source/common/uvectr64.cpp",
"//third_party/icu/icu4c/source/common/wintz.cpp",
"//third_party/icu/icu4c/source/ohos/distro_tzdata_loader.cpp",
"//third_party/icu/icu4c/source/ohos/init_data.cpp",
"//third_party/icu/icu4c/source/stubdata/stubdata.cpp",
]

View File

@ -1309,18 +1309,16 @@ doOpenChoice(const char *path, const char *type, const char *name,
/**** Time zone individual files override */
if (isICUData && isTimeZoneFile(name, type)) {
#ifdef DISTRO_TZDATA_DIR
const char* distroTzdataDir = DISTRO_TZDATA_DIR;
retVal = doLoadFromIndividualFiles(/* pkgName.data() */ "", distroTzdataDir, tocEntryPathSuffix,
/* path */ "", type, name, isAcceptable, context, &subErrorCode, pErrorCode);
retVal = doLoadFromIndividualFiles("", DISTRO_TZDATA_DIR, tocEntryPathSuffix,
"", type, name, isAcceptable, context, &subErrorCode, pErrorCode);
if((retVal != NULL) || U_FAILURE(*pErrorCode)) {
return retVal;
}
#endif
#ifdef SYSTEM_TZDATA_DIR
const char* systemTzdataDir = SYSTEM_TZDATA_DIR;
retVal = doLoadFromIndividualFiles(/* pkgName.data() */ "", systemTzdataDir, tocEntryPathSuffix,
/* path */ "", type, name, isAcceptable, context, &subErrorCode, pErrorCode);
retVal = doLoadFromIndividualFiles("", SYSTEM_TZDATA_DIR, tocEntryPathSuffix,
"", type, name, isAcceptable, context, &subErrorCode, pErrorCode);
if((retVal != NULL) || U_FAILURE(*pErrorCode)) {
return retVal;
}

View File

@ -1,8 +0,0 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
/**
* generated alias target
*/
nb_NO{
___{""}
}

View File

@ -1,5 +0,0 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
nds{
Version{"37"}
}

View File

@ -1,8 +0,0 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
de_LU{
Languages{
be{"Belarussisch"}
}
Version{"37"}
}

View File

@ -1,8 +0,0 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
/**
* generated alias target
*/
nb_NO{
___{""}
}

View File

@ -1,5 +0,0 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
nds{
Version{"37"}
}

View File

@ -1,6 +0,0 @@
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
en_MM{
%%Parent{"en_GB"}
Version{"2.1.38.69"}
}

View File

@ -1,46 +0,0 @@
/*
* Copyright (c) 2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifdef ICU_SUPPORT_DISTRO
#include <stdlib.h>
#endif
#include <sys/stat.h>
#include "distro_tzdata_loader.h"
namespace OHOS {
namespace Global {
namespace I18n {
const char *DistroTZDataLoader::ICU_TZDATA_PATH = "/system/etc/tzdata_distro/icu_tzdata.dat";
const char *DistroTZDataLoader::DISTRO_TZDATA_PATH = "/system/etc/tzdata_distro";
const char *DistroTZDataLoader::TZDATA_PATH = "/system/etc/icu_tzdata";
const char *DistroTZDataLoader::ICU_TIMEZONE_FILES_DIR = "ICU_TIMEZONE_FILES_DIR";
void DistroTZDataLoader::SetDistroTZDataPath()
{
#ifdef ICU_SUPPORT_DISTRO
#endif
}
bool DistroTZDataLoader::CheckFileExist()
{
struct stat s;
if (stat(ICU_TZDATA_PATH, &s) != 0 || !(s.st_mode & S_IFREG)) {
return false;
}
return true;
}
} // namespace I18n
} // namespace Global
} // namespace OHOS

View File

@ -1,32 +0,0 @@
/*
* Copyright (c) 2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace OHOS {
namespace Global {
namespace I18n {
class DistroTZDataLoader {
public:
static void SetDistroTZDataPath();
private:
static bool CheckFileExist();
static const char *ICU_TZDATA_PATH;
static const char *DISTRO_TZDATA_PATH;
static const char *TZDATA_PATH;
static const char *ICU_TIMEZONE_FILES_DIR;
};
} // namespace I18n
} // namespace Global
} // namespace OHOS

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@ -13,7 +13,6 @@
* limitations under the License.
*/
#include "distro_tzdata_loader.h"
#include "init_data.h"
#include <cstring>
#include <mutex>
@ -34,7 +33,6 @@ void SetHwIcuDirectory( )
return;
}
u_setDataDirectory(g_hwDirectory);
OHOS::Global::I18n::DistroTZDataLoader::SetDistroTZDataPath();
status = 1;
}
@ -52,5 +50,4 @@ extern "C" void SetOhosIcuDirectory()
return;
}
u_setDataDirectory(g_hwDirectory);
OHOS::Global::I18n::DistroTZDataLoader::SetDistroTZDataPath();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

File diff suppressed because it is too large Load Diff

Binary file not shown.