1/******************************************************************** 2 * COPYRIGHT: 3 * Copyright (c) 2008-2010, International Business Machines Corporation and 4 * others. All Rights Reserved. 5 ********************************************************************/ 6// 7// file: regextxt.h 8// 9// This file contains utility code for supporting UText in the regular expression engine. 10// 11// This class is internal to the regular expression implementation. 12// For the public Regular Expression API, see the file "unicode/regex.h" 13// 14 15#ifndef _REGEXTXT_H 16#define _REGEXTXT_H 17 18#include "unicode/utypes.h" 19#include "unicode/utext.h" 20 21U_NAMESPACE_BEGIN 22 23#define UTEXT_USES_U16(ut) (NULL==((ut)->pFuncs->mapNativeIndexToUTF16)) 24 25#if 0 26#define REGEX_DISABLE_CHUNK_MODE 1 27#endif 28 29#ifdef REGEX_DISABLE_CHUNK_MODE 30# define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) (FALSE) 31#else 32# define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) ((0==((ut)->chunkNativeStart))&&((len)==((ut)->chunkNativeLimit))&&((len)==((ut)->nativeIndexingLimit))) 33#endif 34 35struct URegexUTextUnescapeCharContext { 36 UText *text; 37 int32_t lastOffset; 38}; 39#define U_REGEX_UTEXT_UNESCAPE_CONTEXT(text) { (text), -1 } 40 41U_CFUNC UChar U_CALLCONV 42uregex_utext_unescape_charAt(int32_t offset, void * /* struct URegexUTextUnescapeCharContext* */ context); 43U_CFUNC UChar U_CALLCONV 44uregex_ucstr_unescape_charAt(int32_t offset, void * /* UChar* */ context); 45 46U_NAMESPACE_END 47 48#endif 49