summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-08 23:50:43 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-08 23:50:43 +0000
commitb4d8f2090d0b2909c4929fbac253ad93376218f6 (patch)
tree889039eea401bc13981a1c066046b832a315ad1c /base
parentb0b96d8fb1904e3e1c95fc031a9947524b9803ce (diff)
downloadchromium_src-b4d8f2090d0b2909c4929fbac253ad93376218f6.zip
chromium_src-b4d8f2090d0b2909c4929fbac253ad93376218f6.tar.gz
chromium_src-b4d8f2090d0b2909c4929fbac253ad93376218f6.tar.bz2
Implement the missing memory information functions that memory_test uses.
BUG=none TEST=none Review URL: http://codereview.chromium.org/266009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/string_util.cc14
-rw-r--r--base/string_util.h2
2 files changed, 14 insertions, 2 deletions
diff --git a/base/string_util.cc b/base/string_util.cc
index ee0a9a5..c819373 100644
--- a/base/string_util.cc
+++ b/base/string_util.cc
@@ -1270,8 +1270,8 @@ std::wstring JoinString(const std::vector<std::wstring>& parts, wchar_t sep) {
return JoinStringT(parts, sep);
}
-void SplitStringAlongWhitespace(const std::wstring& str,
- std::vector<std::wstring>* result) {
+template<typename STR>
+void SplitStringAlongWhitespaceT(const STR& str, std::vector<STR>* result) {
const size_t length = str.length();
if (!length)
return;
@@ -1310,6 +1310,16 @@ void SplitStringAlongWhitespace(const std::wstring& str,
}
}
+void SplitStringAlongWhitespace(const std::wstring& str,
+ std::vector<std::wstring>* result) {
+ SplitStringAlongWhitespaceT(str, result);
+}
+
+void SplitStringAlongWhitespace(const std::string& str,
+ std::vector<std::string>* result) {
+ SplitStringAlongWhitespaceT(str, result);
+}
+
template<class StringType>
StringType DoReplaceStringPlaceholders(const StringType& format_string,
const std::vector<StringType>& subst,
diff --git a/base/string_util.h b/base/string_util.h
index c6b9fb1..5bacfcd 100644
--- a/base/string_util.h
+++ b/base/string_util.h
@@ -511,6 +511,8 @@ std::string JoinString(const std::vector<std::string>& parts, char s);
// characters is added to result.
void SplitStringAlongWhitespace(const std::wstring& str,
std::vector<std::wstring>* result);
+void SplitStringAlongWhitespace(const std::string& str,
+ std::vector<std::string>* result);
// Replace $1-$2-$3..$9 in the format string with |a|-|b|-|c|..|i| respectively.
// Additionally, $$ is replaced by $. The offsets parameter here can