xref: /third_party/icu/icu4c/source/i18n/regextxt.h (revision 2e5b6d6d)
12e5b6d6dSopenharmony_ci// © 2016 and later: Unicode, Inc. and others.
22e5b6d6dSopenharmony_ci// License & terms of use: http://www.unicode.org/copyright.html
32e5b6d6dSopenharmony_ci/********************************************************************
42e5b6d6dSopenharmony_ci * COPYRIGHT:
52e5b6d6dSopenharmony_ci * Copyright (c) 2008-2010, International Business Machines Corporation and
62e5b6d6dSopenharmony_ci * others. All Rights Reserved.
72e5b6d6dSopenharmony_ci ********************************************************************/
82e5b6d6dSopenharmony_ci//
92e5b6d6dSopenharmony_ci//  file:  regextxt.h
102e5b6d6dSopenharmony_ci//
112e5b6d6dSopenharmony_ci//  This file contains utility code for supporting UText in the regular expression engine.
122e5b6d6dSopenharmony_ci//
132e5b6d6dSopenharmony_ci//  This class is internal to the regular expression implementation.
142e5b6d6dSopenharmony_ci//  For the public Regular Expression API, see the file "unicode/regex.h"
152e5b6d6dSopenharmony_ci//
162e5b6d6dSopenharmony_ci
172e5b6d6dSopenharmony_ci#ifndef _REGEXTXT_H
182e5b6d6dSopenharmony_ci#define _REGEXTXT_H
192e5b6d6dSopenharmony_ci
202e5b6d6dSopenharmony_ci#include "unicode/utypes.h"
212e5b6d6dSopenharmony_ci#include "unicode/utext.h"
222e5b6d6dSopenharmony_ci
232e5b6d6dSopenharmony_ciU_NAMESPACE_BEGIN
242e5b6d6dSopenharmony_ci
252e5b6d6dSopenharmony_ci#define UTEXT_USES_U16(ut) (NULL==((ut)->pFuncs->mapNativeIndexToUTF16))
262e5b6d6dSopenharmony_ci
272e5b6d6dSopenharmony_ci#if 0
282e5b6d6dSopenharmony_ci#define REGEX_DISABLE_CHUNK_MODE 1
292e5b6d6dSopenharmony_ci#endif
302e5b6d6dSopenharmony_ci
312e5b6d6dSopenharmony_ci#ifdef REGEX_DISABLE_CHUNK_MODE
322e5b6d6dSopenharmony_ci#  define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) (false)
332e5b6d6dSopenharmony_ci#else
342e5b6d6dSopenharmony_ci#  define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) ((0==((ut)->chunkNativeStart))&&((len)==((ut)->chunkNativeLimit))&&((len)==((ut)->nativeIndexingLimit)))
352e5b6d6dSopenharmony_ci#endif
362e5b6d6dSopenharmony_ci
372e5b6d6dSopenharmony_cistruct URegexUTextUnescapeCharContext {
382e5b6d6dSopenharmony_ci    UText *text;
392e5b6d6dSopenharmony_ci    int32_t lastOffset;
402e5b6d6dSopenharmony_ci};
412e5b6d6dSopenharmony_ci#define U_REGEX_UTEXT_UNESCAPE_CONTEXT(text) { (text), -1 }
422e5b6d6dSopenharmony_ci
432e5b6d6dSopenharmony_ciU_CFUNC UChar U_CALLCONV
442e5b6d6dSopenharmony_ciuregex_utext_unescape_charAt(int32_t offset, void * /* struct URegexUTextUnescapeCharContext* */ context);
452e5b6d6dSopenharmony_ciU_CFUNC UChar U_CALLCONV
462e5b6d6dSopenharmony_ciuregex_ucstr_unescape_charAt(int32_t offset, void * /* UChar* */ context);
472e5b6d6dSopenharmony_ci
482e5b6d6dSopenharmony_ciU_NAMESPACE_END
492e5b6d6dSopenharmony_ci
502e5b6d6dSopenharmony_ci#endif
51