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

Side by Side Diff: source/i18n/ufieldpositer.cpp

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/i18n/udatpg.cpp ('k') | source/i18n/unicode/calendar.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 ******************************************************************************** *********
3 * Copyright (C) 2015, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 ******************************************************************************** *********
6 */
7
8 #include "unicode/utypes.h"
9
10 #if !UCONFIG_NO_FORMATTING
11
12 #include "unicode/ufieldpositer.h"
13 #include "unicode/fpositer.h"
14 #include "unicode/localpointer.h"
15
16 U_NAMESPACE_USE
17
18
19 U_CAPI UFieldPositionIterator* U_EXPORT2
20 ufieldpositer_open(UErrorCode* status)
21 {
22 if (U_FAILURE(*status)) {
23 return NULL;
24 }
25 FieldPositionIterator* fpositer = new FieldPositionIterator();
26 if (fpositer == NULL) {
27 *status = U_MEMORY_ALLOCATION_ERROR;
28 }
29 return (UFieldPositionIterator*)fpositer;
30 }
31
32
33 U_CAPI void U_EXPORT2
34 ufieldpositer_close(UFieldPositionIterator *fpositer)
35 {
36 delete (FieldPositionIterator*)fpositer;
37 }
38
39
40 U_CAPI int32_t U_EXPORT2
41 ufieldpositer_next(UFieldPositionIterator *fpositer,
42 int32_t *beginIndex, int32_t *endIndex)
43 {
44 FieldPosition fp;
45 int32_t field = -1;
46 if (((FieldPositionIterator*)fpositer)->next(fp)) {
47 field = fp.getField();
48 if (beginIndex) {
49 *beginIndex = fp.getBeginIndex();
50 }
51 if (endIndex) {
52 *endIndex = fp.getEndIndex();
53 }
54 }
55 return field;
56 }
57
58
59 #endif /* #if !UCONFIG_NO_FORMATTING */
OLDNEW
« no previous file with comments | « source/i18n/udatpg.cpp ('k') | source/i18n/unicode/calendar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698