Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: source/common/uinvchar.h

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/common/uinit.cpp ('k') | source/common/ulistformatter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ******************************************************************************* 2 *******************************************************************************
3 * 3 *
4 * Copyright (C) 1999-2010, International Business Machines 4 * Copyright (C) 1999-2015, International Business Machines
5 * Corporation and others. All Rights Reserved. 5 * Corporation and others. All Rights Reserved.
6 * 6 *
7 ******************************************************************************* 7 *******************************************************************************
8 * file name: uinvchar.h 8 * file name: uinvchar.h
9 * encoding: US-ASCII 9 * encoding: US-ASCII
10 * tab size: 8 (not used) 10 * tab size: 8 (not used)
11 * indentation:2 11 * indentation:2
12 * 12 *
13 * created on: 2004sep14 13 * created on: 2004sep14
14 * created by: Markus W. Scherer 14 * created by: Markus W. Scherer
15 * 15 *
16 * Definitions for handling invariant characters, moved here from putil.c 16 * Definitions for handling invariant characters, moved here from putil.c
17 * for better modularization. 17 * for better modularization.
18 */ 18 */
19 19
20 #ifndef __UINVCHAR_H__ 20 #ifndef __UINVCHAR_H__
21 #define __UINVCHAR_H__ 21 #define __UINVCHAR_H__
22 22
23 #include "unicode/utypes.h" 23 #include "unicode/utypes.h"
24 #ifdef __cplusplus
25 #include "unicode/unistr.h"
26 #endif
24 27
25 /** 28 /**
26 * Check if a char string only contains invariant characters. 29 * Check if a char string only contains invariant characters.
27 * See utypes.h for details. 30 * See utypes.h for details.
28 * 31 *
29 * @param s Input string pointer. 32 * @param s Input string pointer.
30 * @param length Length of the string, can be -1 if NUL-terminated. 33 * @param length Length of the string, can be -1 if NUL-terminated.
31 * @return TRUE if s contains only invariant characters. 34 * @return TRUE if s contains only invariant characters.
32 * 35 *
33 * @internal (ICU 2.8) 36 * @internal (ICU 2.8)
34 */ 37 */
35 U_INTERNAL UBool U_EXPORT2 38 U_INTERNAL UBool U_EXPORT2
36 uprv_isInvariantString(const char *s, int32_t length); 39 uprv_isInvariantString(const char *s, int32_t length);
37 40
38 /** 41 /**
39 * Check if a Unicode string only contains invariant characters. 42 * Check if a Unicode string only contains invariant characters.
40 * See utypes.h for details. 43 * See utypes.h for details.
41 * 44 *
42 * @param s Input string pointer. 45 * @param s Input string pointer.
43 * @param length Length of the string, can be -1 if NUL-terminated. 46 * @param length Length of the string, can be -1 if NUL-terminated.
44 * @return TRUE if s contains only invariant characters. 47 * @return TRUE if s contains only invariant characters.
45 * 48 *
46 * @internal (ICU 2.8) 49 * @internal (ICU 2.8)
47 */ 50 */
48 U_INTERNAL UBool U_EXPORT2 51 U_INTERNAL UBool U_EXPORT2
49 uprv_isInvariantUString(const UChar *s, int32_t length); 52 uprv_isInvariantUString(const UChar *s, int32_t length);
50 53
54 #ifdef __cplusplus
55
56 /**
57 * Check if a UnicodeString only contains invariant characters.
58 * See utypes.h for details.
59 *
60 * @param s Input string.
61 * @return TRUE if s contains only invariant characters.
62 */
63 U_INTERNAL inline UBool U_EXPORT2
64 uprv_isInvariantUnicodeString(const icu::UnicodeString &s) {
65 return uprv_isInvariantUString(s.getBuffer(), s.length());
66 }
67
68 #endif /* __cplusplus */
69
51 /** 70 /**
52 * \def U_UPPER_ORDINAL 71 * \def U_UPPER_ORDINAL
53 * Get the ordinal number of an uppercase invariant character 72 * Get the ordinal number of an uppercase invariant character
54 * @internal 73 * @internal
55 */ 74 */
56 #if U_CHARSET_FAMILY==U_ASCII_FAMILY 75 #if U_CHARSET_FAMILY==U_ASCII_FAMILY
57 # define U_UPPER_ORDINAL(x) ((x)-'A') 76 # define U_UPPER_ORDINAL(x) ((x)-'A')
58 #elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY 77 #elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
59 # define U_UPPER_ORDINAL(x) (((x) < 'J') ? ((x)-'A') : \ 78 # define U_UPPER_ORDINAL(x) (((x) < 'J') ? ((x)-'A') : \
60 (((x) < 'S') ? ((x)-'J'+9) : \ 79 (((x) < 'S') ? ((x)-'J'+9) : \
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 * Copy ASCII to EBCDIC 135 * Copy ASCII to EBCDIC
117 * @internal 136 * @internal
118 * @see uprv_strncpy 137 * @see uprv_strncpy
119 */ 138 */
120 U_INTERNAL uint8_t* U_EXPORT2 139 U_INTERNAL uint8_t* U_EXPORT2
121 uprv_eastrncpy(uint8_t *dst, const uint8_t *src, int32_t n); 140 uprv_eastrncpy(uint8_t *dst, const uint8_t *src, int32_t n);
122 141
123 142
124 143
125 #endif 144 #endif
OLDNEW
« no previous file with comments | « source/common/uinit.cpp ('k') | source/common/ulistformatter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698