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

Side by Side Diff: base/string_piece.h

Issue 9730: NO CODE CHANGE. Update string_piece.h to new include style. Really just wan... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/string_piece.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // Copied from strings/stringpiece.h with modifications 4 // Copied from strings/stringpiece.h with modifications
5 // 5 //
6 // A string-like object that points to a sized piece of memory. 6 // A string-like object that points to a sized piece of memory.
7 // 7 //
8 // Functions or methods may use const StringPiece& parameters to accept either 8 // Functions or methods may use const StringPiece& parameters to accept either
9 // a "const char*" or a "string" value that will be implicitly converted to 9 // a "const char*" or a "string" value that will be implicitly converted to
10 // a StringPiece. The implicit conversion means that it is often appropriate 10 // a StringPiece. The implicit conversion means that it is often appropriate
11 // to include this .h file in other files rather than forward-declaring 11 // to include this .h file in other files rather than forward-declaring
12 // StringPiece as would be appropriate for most other Google classes. 12 // StringPiece as would be appropriate for most other Google classes.
13 // 13 //
14 // Systematic usage of StringPiece is encouraged as it will reduce unnecessary 14 // Systematic usage of StringPiece is encouraged as it will reduce unnecessary
15 // conversions from "const char*" to "string" and back again. 15 // conversions from "const char*" to "string" and back again.
16 // 16 //
17 17
18 #ifndef BASE_STRING_PIECE_H__ 18 #ifndef BASE_STRING_PIECE_H_
19 #define BASE_STRING_PIECE_H__ 19 #define BASE_STRING_PIECE_H_
20 20
21 #include <algorithm> 21 #include <algorithm>
22 #include <iosfwd> 22 #include <iosfwd>
23 #include <string> 23 #include <string>
24 24
25 #include "base/basictypes.h" 25 #include "base/basictypes.h"
26 26
27 class StringPiece { 27 class StringPiece {
28 public: 28 public:
29 typedef size_t size_type; 29 typedef size_t size_type;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 return !(x > y); 174 return !(x > y);
175 } 175 }
176 176
177 inline bool operator>=(const StringPiece& x, const StringPiece& y) { 177 inline bool operator>=(const StringPiece& x, const StringPiece& y) {
178 return !(x < y); 178 return !(x < y);
179 } 179 }
180 180
181 // allow StringPiece to be logged (needed for unit testing). 181 // allow StringPiece to be logged (needed for unit testing).
182 extern std::ostream& operator<<(std::ostream& o, const StringPiece& piece); 182 extern std::ostream& operator<<(std::ostream& o, const StringPiece& piece);
183 183
184 #endif // BASE_STRING_PIECE_H__ 184 #endif // BASE_STRING_PIECE_H_
185
OLDNEW
« no previous file with comments | « no previous file | base/string_piece.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698