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

Unified Diff: base/stringprintf.cc

Issue 10449042: Remove wchar/wstring version of StringPrintf. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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/stringprintf.h ('k') | base/stringprintf_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/stringprintf.cc
diff --git a/base/stringprintf.cc b/base/stringprintf.cc
index 5607d39e4eb0d21e08a86e5c809a67fb28d21461..de8336bda409b4c9f50227a78d9c9cd3a3041bd3 100644
--- a/base/stringprintf.cc
+++ b/base/stringprintf.cc
@@ -13,12 +13,11 @@ namespace base {
namespace {
-// Overloaded wrappers around vsnprintf and vswprintf. The buf_size parameter
-// is the size of the buffer. These return the number of characters in the
-// formatted string excluding the NUL terminator. If the buffer is not
-// large enough to accommodate the formatted string without truncation, they
-// return the number of characters that would be in the fully-formatted string
-// (vsnprintf, and vswprintf on Windows), or -1 (vswprintf on POSIX platforms).
+// Wrapper around vsnprintf. The buf_size parameter is the size of the buffer.
+// These return the number of characters in the formatted string excluding the
+// NUL terminator. If the buffer is not large enough to accommodate the
+// formatted string without truncation, they return the number of characters
+// that would be in the fully-formatted string.
inline int vsnprintfT(char* buffer,
brettw 2012/06/01 19:27:13 I think we can just remove this and call base::vsn
size_t buf_size,
const char* format,
@@ -26,13 +25,6 @@ inline int vsnprintfT(char* buffer,
return base::vsnprintf(buffer, buf_size, format, argptr);
}
-inline int vsnprintfT(wchar_t* buffer,
- size_t buf_size,
- const wchar_t* format,
- va_list argptr) {
- return base::vswprintf(buffer, buf_size, format, argptr);
-}
-
// Templatized backend for StringPrintF/StringAppendF. This does not finalize
// the va_list, the caller is expected to do that.
template <class StringType>
@@ -116,15 +108,6 @@ std::string StringPrintf(const char* format, ...) {
return result;
}
-std::wstring StringPrintf(const wchar_t* format, ...) {
- va_list ap;
- va_start(ap, format);
- std::wstring result;
- StringAppendV(&result, format, ap);
- va_end(ap);
- return result;
-}
-
std::string StringPrintV(const char* format, va_list ap) {
std::string result;
StringAppendV(&result, format, ap);
@@ -140,16 +123,6 @@ const std::string& SStringPrintf(std::string* dst, const char* format, ...) {
return *dst;
}
-const std::wstring& SStringPrintf(std::wstring* dst,
- const wchar_t* format, ...) {
- va_list ap;
- va_start(ap, format);
- dst->clear();
- StringAppendV(dst, format, ap);
- va_end(ap);
- return *dst;
-}
-
void StringAppendF(std::string* dst, const char* format, ...) {
va_list ap;
va_start(ap, format);
@@ -157,19 +130,8 @@ void StringAppendF(std::string* dst, const char* format, ...) {
va_end(ap);
}
-void StringAppendF(std::wstring* dst, const wchar_t* format, ...) {
- va_list ap;
- va_start(ap, format);
- StringAppendV(dst, format, ap);
- va_end(ap);
-}
-
void StringAppendV(std::string* dst, const char* format, va_list ap) {
StringAppendVT(dst, format, ap);
}
-void StringAppendV(std::wstring* dst, const wchar_t* format, va_list ap) {
- StringAppendVT(dst, format, ap);
-}
-
} // namespace base
« no previous file with comments | « base/stringprintf.h ('k') | base/stringprintf_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698