summaryrefslogtreecommitdiffstats
path: root/base/word_iterator.h
diff options
context:
space:
mode:
authormaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-07 20:48:51 +0000
committermaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-07 20:48:51 +0000
commit10ddd7695814705c3b35d07c8fa20fcfb80a02f6 (patch)
tree6e99f566241cc05805daf4d6fadc723fc643f3e5 /base/word_iterator.h
parentdb27fbd4d21d50af688e622ce093c44424909c88 (diff)
downloadchromium_src-10ddd7695814705c3b35d07c8fa20fcfb80a02f6.zip
chromium_src-10ddd7695814705c3b35d07c8fa20fcfb80a02f6.tar.gz
chromium_src-10ddd7695814705c3b35d07c8fa20fcfb80a02f6.tar.bz2
Add a unit test for WordIterator. Fix word_iterator.* includes at the same time.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@536 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/word_iterator.h')
-rw-r--r--base/word_iterator.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/base/word_iterator.h b/base/word_iterator.h
index fc722ef..8329f64 100644
--- a/base/word_iterator.h
+++ b/base/word_iterator.h
@@ -30,6 +30,8 @@
#ifndef BASE_WORD_ITERATOR_H__
#define BASE_WORD_ITERATOR_H__
+#include <string>
+
#include "base/basictypes.h"
#include "unicode/umachine.h" // Needed for U_WCHAR_IS_UTF16.
@@ -87,10 +89,7 @@ class WordIterator {
// Return the word between prev() and pos().
// Advance() must have been called successfully at least once
// for pos() to have advanced to somewhere useful.
- std::wstring GetWord() const {
- DCHECK(prev_ >= 0 && pos_ >= 0);
- return string_.substr(prev_, pos_ - prev_);
- }
+ std::wstring GetWord() const;
private:
// ICU iterator.