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

Unified Diff: base/string_piece.h

Issue 6081007: Start sorting methods in class declarations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 9 years, 11 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 | « base/ref_counted_memory.h ('k') | base/synchronization/waitable_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_piece.h
diff --git a/base/string_piece.h b/base/string_piece.h
index 70c0480a4d26764a1ba8f8f7822a27514144e867..80c6cabf5edcbff5eb2941cd602c02317f3336a1 100644
--- a/base/string_piece.h
+++ b/base/string_piece.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Copied from strings/stringpiece.h with modifications
@@ -29,11 +29,19 @@ namespace base {
class StringPiece {
public:
+ // standard STL container boilerplate
typedef size_t size_type;
+ typedef char value_type;
+ typedef const char* pointer;
+ typedef const char& reference;
+ typedef const char& const_reference;
+ typedef ptrdiff_t difference_type;
+ typedef const char* const_iterator;
+ typedef const char* iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
- private:
- const char* ptr_;
- size_type length_;
+ static const size_type npos;
public:
// We provide non-explicit singleton constructors so users can pass
@@ -113,17 +121,6 @@ class StringPiece {
(wordmemcmp(ptr_ + (length_-x.length_), x.ptr_, x.length_) == 0));
}
- // standard STL container boilerplate
- typedef char value_type;
- typedef const char* pointer;
- typedef const char& reference;
- typedef const char& const_reference;
- typedef ptrdiff_t difference_type;
- static const size_type npos;
- typedef const char* const_iterator;
- typedef const char* iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- typedef std::reverse_iterator<iterator> reverse_iterator;
iterator begin() const { return ptr_; }
iterator end() const { return ptr_ + length_; }
const_reverse_iterator rbegin() const {
@@ -161,6 +158,10 @@ class StringPiece {
static int wordmemcmp(const char* p, const char* p2, size_type N) {
return memcmp(p, p2, N);
}
+
+ private:
+ const char* ptr_;
+ size_type length_;
};
bool operator==(const StringPiece& x, const StringPiece& y);
« no previous file with comments | « base/ref_counted_memory.h ('k') | base/synchronization/waitable_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698