intl/icu/source/i18n/uregexc.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/i18n/uregexc.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     1.4 +/*
     1.5 +*******************************************************************************
     1.6 +*   Copyright (C) 2003-2006, International Business Machines
     1.7 +*   Corporation and others.  All Rights Reserved.
     1.8 +*******************************************************************************
     1.9 +*   file name:   regexc.cpp
    1.10 +*   description: The purpose of this function is to separate the codepage
    1.11 +*       conversion from the rest of the uregex_ API. This can removes any
    1.12 +*       dependency on codepage conversion, which reduces the overhead of 
    1.13 +*/
    1.14 +
    1.15 +#include "unicode/uregex.h"
    1.16 +#include "unicode/unistr.h"
    1.17 +
    1.18 +U_NAMESPACE_USE
    1.19 +
    1.20 +//----------------------------------------------------------------------------------------
    1.21 +//
    1.22 +//    uregex_openC
    1.23 +//
    1.24 +//----------------------------------------------------------------------------------------
    1.25 +#if !UCONFIG_NO_CONVERSION && !UCONFIG_NO_REGULAR_EXPRESSIONS
    1.26 +
    1.27 +U_CAPI URegularExpression * U_EXPORT2
    1.28 +uregex_openC( const char           *pattern,
    1.29 +                    uint32_t        flags,
    1.30 +                    UParseError    *pe,
    1.31 +                    UErrorCode     *status) {
    1.32 +    if (U_FAILURE(*status)) {
    1.33 +        return NULL;
    1.34 +    }
    1.35 +    if (pattern == NULL) {
    1.36 +        *status = U_ILLEGAL_ARGUMENT_ERROR;
    1.37 +        return NULL;
    1.38 +    }
    1.39 +
    1.40 +    UnicodeString patString(pattern);
    1.41 +    return uregex_open(patString.getBuffer(), patString.length(), flags, pe, status);
    1.42 +}
    1.43 +#endif

mercurial