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

Side by Side Diff: icu46/source/test/intltest/tokiter.h

Issue 5516007: Check in the pristine copy of ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « icu46/source/test/intltest/tmsgfmt.cpp ('k') | icu46/source/test/intltest/tokiter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 **********************************************************************
3 * Copyright (c) 2004-2006, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * Author: Alan Liu
7 * Created: March 22 2004
8 * Since: ICU 3.0
9 **********************************************************************
10 */
11 #ifndef __ICU_INTLTEST_TOKITER__
12 #define __ICU_INTLTEST_TOKITER__
13
14 #include "intltest.h"
15
16 class TextFile;
17
18 /**
19 * An iterator class that returns successive string tokens from some
20 * source. String tokens are, in general, separated by rule white
21 * space in the source test. Furthermore, they may be delimited by
22 * either single or double quotes (opening and closing quotes must
23 * match). Escapes are processed using standard ICU unescaping.
24 */
25 class TokenIterator {
26 public:
27
28 /**
29 * Construct an iterator over the tokens returned by the given
30 * TextFile, ignoring blank lines and comment lines (first
31 * non-blank character is '#'). Note that trailing comments on a
32 * line, beginning with the first unquoted '#', are recognized.
33 */
34 TokenIterator(TextFile* r);
35
36 virtual ~TokenIterator();
37
38 /**
39 * Return the next token from this iterator.
40 * @return TRUE if a token was read, or FALSE if no more tokens
41 * are available or an error occurred.
42 */
43 UBool next(UnicodeString& token, UErrorCode& ec);
44
45 /**
46 * Return the one-based line number of the line of the last token
47 * returned by next(). Should only be called after a call to
48 * next(); otherwise the return value is undefined.
49 */
50 int32_t getLineNumber() const;
51
52 /**
53 * Return a string description of the position of the last line
54 * returned by readLine() or readLineSkippingComments().
55 */
56 //public String describePosition() {
57 // return reader.describePosition() + ':' + (lastpos+1);
58 //}
59
60 private:
61 UBool nextToken(UnicodeString& token, UErrorCode& ec);
62
63 TextFile* reader; // alias
64 UnicodeString line;
65 UBool done;
66 UBool haveLine;
67 int32_t pos;
68 int32_t lastpos;
69 };
70
71 #endif
OLDNEW
« no previous file with comments | « icu46/source/test/intltest/tmsgfmt.cpp ('k') | icu46/source/test/intltest/tokiter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698