diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 21:41:09 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 21:41:09 +0000 |
commit | cbb7d42a93299955a5bc6ed8b078e60737ca885b (patch) | |
tree | 5af908cc470d2c1b9a86c644ad68febdcaf8766d /base/string_tokenizer.h | |
parent | bac10610a94b68c1a9a75ebbae0c92119ee79643 (diff) | |
download | chromium_src-cbb7d42a93299955a5bc6ed8b078e60737ca885b.zip chromium_src-cbb7d42a93299955a5bc6ed8b078e60737ca885b.tar.gz chromium_src-cbb7d42a93299955a5bc6ed8b078e60737ca885b.tar.bz2 |
Adding support for Reset in StringTokenizerT and HttpHeadersIterator.
TEST=Run HeadersIterator_Reset and the Reset test for StringTokenizer
BUG=none
Review URL: http://codereview.chromium.org/276067
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_tokenizer.h')
-rw-r--r-- | base/string_tokenizer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/string_tokenizer.h b/base/string_tokenizer.h index eb9ac2d..a6b5870 100644 --- a/base/string_tokenizer.h +++ b/base/string_tokenizer.h @@ -141,6 +141,11 @@ class StringTokenizerT { return true; } + // Start iterating through tokens from the beginning of the string. + void Reset() { + token_end_ = start_pos_; + } + // Returns true if token is a delimiter. When the tokenizer is constructed // with the RETURN_DELIMS option, this method can be used to check if the // returned token is actually a delimiter. @@ -156,6 +161,7 @@ class StringTokenizerT { void Init(const_iterator string_begin, const_iterator string_end, const str& delims) { + start_pos_ = string_begin; token_end_ = string_begin; end_ = string_end; delims_ = delims; @@ -195,6 +201,7 @@ class StringTokenizerT { return true; } + const_iterator start_pos_; const_iterator token_begin_; const_iterator token_end_; const_iterator end_; |