mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-4189 Reduce static library dependencies on conversion code,
and allow UCONFIG_NO_CONVERSION to work. X-SVN-Rev: 16921
This commit is contained in:
parent
d0d233155d
commit
a643013936
5 changed files with 48 additions and 30 deletions
|
@ -67,13 +67,12 @@ astro.o buddhcal.o islamcal.o japancal.o gregoimp.o hebrwcal.o chnsecal.o \
|
|||
sortkey.o bocsu.o coleitr.o coll.o ucoleitr.o \
|
||||
ucol.o ucol_bld.o ucol_cnt.o ucol_elm.o ucol_sit.o ucol_tok.o ucol_wgt.o tblcoll.o \
|
||||
strmatch.o usearch.o search.o stsearch.o \
|
||||
translit.o utrans.o esctrn.o unesctrn.o \
|
||||
funcrepl.o strrepl.o tridpars.o \
|
||||
translit.o utrans.o esctrn.o unesctrn.o funcrepl.o strrepl.o tridpars.o \
|
||||
cpdtrans.o rbt.o rbt_data.o rbt_pars.o rbt_rule.o rbt_set.o \
|
||||
nultrans.o remtrans.o casetrn.o titletrn.o tolowtrn.o toupptrn.o anytrans.o \
|
||||
name2uni.o uni2name.o nortrans.o quant.o transreg.o \
|
||||
regexcmp.o rematch.o repattrn.o regexst.o uregex.o ulocdata.o \
|
||||
measfmt.o currfmt.o curramt.o currunit.o measure.o utmscale.o
|
||||
regexcmp.o rematch.o repattrn.o regexst.o uregex.o uregexc.o \
|
||||
ulocdata.o measfmt.o currfmt.o curramt.o currunit.o measure.o utmscale.o
|
||||
|
||||
|
||||
STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O))
|
||||
|
|
|
@ -2274,6 +2274,10 @@ InputPath=.\unicode\uregex.h
|
|||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\uregexc.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "transforms"
|
||||
|
|
|
@ -1168,6 +1168,9 @@
|
|||
Outputs="..\..\include\unicode\$(InputFileName)"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\uregexc.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="transforms"
|
||||
|
|
|
@ -159,32 +159,6 @@ ErrorExit:
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
//
|
||||
// uregex_openC
|
||||
//
|
||||
//----------------------------------------------------------------------------------------
|
||||
U_CAPI URegularExpression * U_EXPORT2
|
||||
uregex_openC( const char *pattern,
|
||||
uint32_t flags,
|
||||
UParseError *pe,
|
||||
UErrorCode *status) {
|
||||
if (U_FAILURE(*status)) {
|
||||
return NULL;
|
||||
}
|
||||
if (pattern == NULL) {
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
UnicodeString patString(pattern);
|
||||
URegularExpression *re = uregex_open(patString.getBuffer(), patString.length(), flags, pe, status);
|
||||
return re;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
//
|
||||
// uregex_close
|
||||
|
|
38
icu4c/source/i18n/uregexc.cpp
Normal file
38
icu4c/source/i18n/uregexc.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2003-2004, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*******************************************************************************
|
||||
* file name: regexc.cpp
|
||||
* description: The purpose of this function is to separate the codepage
|
||||
* conversion from the rest of the uregex_ API. This can removes any
|
||||
* dependency on codepage conversion, which reduces the overhead of
|
||||
*/
|
||||
|
||||
#include "unicode/uregex.h"
|
||||
#include "unicode/unistr.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
//
|
||||
// uregex_openC
|
||||
//
|
||||
//----------------------------------------------------------------------------------------
|
||||
#if !UCONFIG_NO_CONVERSION
|
||||
U_CAPI URegularExpression * U_EXPORT2
|
||||
uregex_openC( const char *pattern,
|
||||
uint32_t flags,
|
||||
UParseError *pe,
|
||||
UErrorCode *status) {
|
||||
if (U_FAILURE(*status)) {
|
||||
return NULL;
|
||||
}
|
||||
if (pattern == NULL) {
|
||||
*status = U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
UnicodeString patString(pattern);
|
||||
URegularExpression *re = uregex_open(patString.getBuffer(), patString.length(), flags, pe, status);
|
||||
return re;
|
||||
}
|
||||
#endif
|
Loading…
Add table
Reference in a new issue