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

Unified Diff: base/string_tokenizer.h

Issue 276067: Adding support for Reset in StringTokenizerT and HttpHeadersIterator.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/string_tokenizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_tokenizer.h
===================================================================
--- base/string_tokenizer.h (revision 29282)
+++ base/string_tokenizer.h (working copy)
@@ -141,6 +141,11 @@
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 @@
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 @@
return true;
}
+ const_iterator start_pos_;
const_iterator token_begin_;
const_iterator token_end_;
const_iterator end_;
« no previous file with comments | « no previous file | base/string_tokenizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698