OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "net/tools/flip_server/split.h" | 5 #include "net/tools/flip_server/split.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/string_piece.h" | 11 #include "base/strings/string_piece.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 // Yea, this could be done with less code duplication using | 15 // Yea, this could be done with less code duplication using |
16 // template magic, I know. | 16 // template magic, I know. |
17 void SplitStringPieceToVector(const base::StringPiece& full, | 17 void SplitStringPieceToVector(const base::StringPiece& full, |
18 const char* delim, | 18 const char* delim, |
19 std::vector<base::StringPiece>* vec, | 19 std::vector<base::StringPiece>* vec, |
20 bool omit_empty_strings) { | 20 bool omit_empty_strings) { |
21 vec->clear(); | 21 vec->clear(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 --e; | 63 --e; |
64 if (e != s || !omit_empty_strings) { | 64 if (e != s || !omit_empty_strings) { |
65 vec->push_back(base::StringPiece(s, e - s)); | 65 vec->push_back(base::StringPiece(s, e - s)); |
66 } | 66 } |
67 } | 67 } |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 } // namespace net | 71 } // namespace net |
72 | 72 |
OLD | NEW |