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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu46/source/test/intltest/tmsgfmt.cpp ('k') | icu46/source/test/intltest/tokiter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu46/source/test/intltest/tokiter.h
===================================================================
--- icu46/source/test/intltest/tokiter.h (revision 0)
+++ icu46/source/test/intltest/tokiter.h (revision 0)
@@ -0,0 +1,71 @@
+/*
+**********************************************************************
+* Copyright (c) 2004-2006, International Business Machines
+* Corporation and others. All Rights Reserved.
+**********************************************************************
+* Author: Alan Liu
+* Created: March 22 2004
+* Since: ICU 3.0
+**********************************************************************
+*/
+#ifndef __ICU_INTLTEST_TOKITER__
+#define __ICU_INTLTEST_TOKITER__
+
+#include "intltest.h"
+
+class TextFile;
+
+/**
+ * An iterator class that returns successive string tokens from some
+ * source. String tokens are, in general, separated by rule white
+ * space in the source test. Furthermore, they may be delimited by
+ * either single or double quotes (opening and closing quotes must
+ * match). Escapes are processed using standard ICU unescaping.
+ */
+class TokenIterator {
+ public:
+
+ /**
+ * Construct an iterator over the tokens returned by the given
+ * TextFile, ignoring blank lines and comment lines (first
+ * non-blank character is '#'). Note that trailing comments on a
+ * line, beginning with the first unquoted '#', are recognized.
+ */
+ TokenIterator(TextFile* r);
+
+ virtual ~TokenIterator();
+
+ /**
+ * Return the next token from this iterator.
+ * @return TRUE if a token was read, or FALSE if no more tokens
+ * are available or an error occurred.
+ */
+ UBool next(UnicodeString& token, UErrorCode& ec);
+
+ /**
+ * Return the one-based line number of the line of the last token
+ * returned by next(). Should only be called after a call to
+ * next(); otherwise the return value is undefined.
+ */
+ int32_t getLineNumber() const;
+
+ /**
+ * Return a string description of the position of the last line
+ * returned by readLine() or readLineSkippingComments().
+ */
+ //public String describePosition() {
+ // return reader.describePosition() + ':' + (lastpos+1);
+ //}
+
+ private:
+ UBool nextToken(UnicodeString& token, UErrorCode& ec);
+
+ TextFile* reader; // alias
+ UnicodeString line;
+ UBool done;
+ UBool haveLine;
+ int32_t pos;
+ int32_t lastpos;
+};
+
+#endif
Property changes on: icu46/source/test/intltest/tokiter.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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