OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_STRINGS_STRING_TOKENIZER_H_ | 5 #ifndef BASE_STRINGS_STRING_TOKENIZER_H_ |
6 #define BASE_STRINGS_STRING_TOKENIZER_H_ | 6 #define BASE_STRINGS_STRING_TOKENIZER_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/string_piece.h" | 11 #include "base/strings/string_piece.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 | 14 |
15 // StringTokenizerT is a simple string tokenizer class. It works like an | 15 // StringTokenizerT is a simple string tokenizer class. It works like an |
16 // iterator that with each step (see the Advance method) updates members that | 16 // iterator that with each step (see the Advance method) updates members that |
17 // refer to the next token in the input string. The user may optionally | 17 // refer to the next token in the input string. The user may optionally |
18 // configure the tokenizer to return delimiters. | 18 // configure the tokenizer to return delimiters. |
19 // | 19 // |
20 // Warning: be careful not to pass a C string into the 2-arg constructor: | 20 // Warning: be careful not to pass a C string into the 2-arg constructor: |
21 // StringTokenizer t("this is a test", " "); // WRONG | 21 // StringTokenizer t("this is a test", " "); // WRONG |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 typedef StringTokenizerT<std::string, std::string::const_iterator> | 252 typedef StringTokenizerT<std::string, std::string::const_iterator> |
253 StringTokenizer; | 253 StringTokenizer; |
254 typedef StringTokenizerT<std::wstring, std::wstring::const_iterator> | 254 typedef StringTokenizerT<std::wstring, std::wstring::const_iterator> |
255 WStringTokenizer; | 255 WStringTokenizer; |
256 typedef StringTokenizerT<std::string, const char*> CStringTokenizer; | 256 typedef StringTokenizerT<std::string, const char*> CStringTokenizer; |
257 | 257 |
258 } // namespace base | 258 } // namespace base |
259 | 259 |
260 #endif // BASE_STRINGS_STRING_TOKENIZER_H_ | 260 #endif // BASE_STRINGS_STRING_TOKENIZER_H_ |
OLD | NEW |