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

Unified Diff: base/containers/stack_container.h

Issue 11360174: Move stack_container and linked_list to the new containers subdirectory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/containers/linked_list_unittest.cc ('k') | base/containers/stack_container_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/containers/stack_container.h
diff --git a/base/stack_container.h b/base/containers/stack_container.h
similarity index 90%
rename from base/stack_container.h
rename to base/containers/stack_container.h
index c5897836db96b163d144121e4337ca190476523d..b3e508b98e9f537c1f2fd40037b1be56bb832935 100644
--- a/base/stack_container.h
+++ b/base/containers/stack_container.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_STACK_CONTAINER_H_
-#define BASE_STACK_CONTAINER_H_
+#ifndef BASE_CONTAINERS_STACK_CONTAINER_H_
+#define BASE_CONTAINERS_STACK_CONTAINER_H_
#include <string>
#include <vector>
@@ -11,6 +11,9 @@
#include "base/basictypes.h"
#include "build/build_config.h"
#include "base/memory/aligned_memory.h"
+#include "base/string16.h"
+
+namespace base {
// This allocator can be used with STL containers to provide a stack buffer
// from which to allocate memory and overflows onto the heap. This stack buffer
@@ -169,7 +172,8 @@ class StackContainer {
DISALLOW_COPY_AND_ASSIGN(StackContainer);
};
-// StackString
+// StackString -----------------------------------------------------------------
+
template<size_t stack_capacity>
class StackString : public StackContainer<
std::basic_string<char,
@@ -188,27 +192,28 @@ class StackString : public StackContainer<
DISALLOW_COPY_AND_ASSIGN(StackString);
};
-// StackWString
+// StackStrin16 ----------------------------------------------------------------
+
template<size_t stack_capacity>
-class StackWString : public StackContainer<
- std::basic_string<wchar_t,
- std::char_traits<wchar_t>,
- StackAllocator<wchar_t, stack_capacity> >,
+class StackString16 : public StackContainer<
+ std::basic_string<char16,
+ base::string16_char_traits,
+ StackAllocator<char16, stack_capacity> >,
stack_capacity> {
public:
- StackWString() : StackContainer<
- std::basic_string<wchar_t,
- std::char_traits<wchar_t>,
- StackAllocator<wchar_t, stack_capacity> >,
+ StackString16() : StackContainer<
+ std::basic_string<char16,
+ base::string16_char_traits,
+ StackAllocator<char16, stack_capacity> >,
stack_capacity>() {
}
private:
- DISALLOW_COPY_AND_ASSIGN(StackWString);
+ DISALLOW_COPY_AND_ASSIGN(StackString16);
};
-// StackVector
-//
+// StackVector -----------------------------------------------------------------
+
// Example:
// StackVector<int, 16> foo;
// foo->push_back(22); // we have overloaded operator->
@@ -248,4 +253,6 @@ class StackVector : public StackContainer<
}
};
-#endif // BASE_STACK_CONTAINER_H_
+} // namespace base
+
+#endif // BASE_CONTAINERS_STACK_CONTAINER_H_
« no previous file with comments | « base/containers/linked_list_unittest.cc ('k') | base/containers/stack_container_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698