summaryrefslogtreecommitdiffstats
path: root/base/string_util.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-17 03:45:37 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-17 03:45:37 +0000
commite6811ed52ec6c97dfb6d9073c8841d7f67bba082 (patch)
tree3d6a1abc880b89e94382f9f7c8e028d765f33508 /base/string_util.h
parente486aef731a84a591451ec7e92e79724757a737d (diff)
downloadchromium_src-e6811ed52ec6c97dfb6d9073c8841d7f67bba082.zip
chromium_src-e6811ed52ec6c97dfb6d9073c8841d7f67bba082.tar.gz
chromium_src-e6811ed52ec6c97dfb6d9073c8841d7f67bba082.tar.bz2
Move StringPrintf into its own file and use the base namespace. Currently this has using
directives for the functions so I don't have to change all files to use the namespace. No code changes to logic. TEST=it compiles + the included unit tests BUG=none Review URL: http://codereview.chromium.org/3181016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56299 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util.h')
-rw-r--r--base/string_util.h32
1 files changed, 5 insertions, 27 deletions
diff --git a/base/string_util.h b/base/string_util.h
index 9edf85f..c69b2de 100644
--- a/base/string_util.h
+++ b/base/string_util.h
@@ -18,6 +18,11 @@
#include "base/string16.h"
#include "base/string_piece.h" // For implicit conversions.
+// TODO(brettw) remove this dependency. Previously StringPrintf lived in this
+// file. We need to convert the callers over to using stringprintf.h instead
+// and then remove this.
+#include "base/stringprintf.h"
+
// Safe standard library wrappers for all platforms.
namespace base {
@@ -449,33 +454,6 @@ void ReplaceSubstringsAfterOffset(std::string* str,
const std::string& find_this,
const std::string& replace_with);
-// Return a C++ string given printf-like input.
-std::string StringPrintf(const char* format, ...) PRINTF_FORMAT(1, 2);
-std::wstring StringPrintf(const wchar_t* format, ...) WPRINTF_FORMAT(1, 2);
-
-// Return a C++ string given vprintf-like input.
-std::string StringPrintV(const char* format, va_list ap) PRINTF_FORMAT(1, 0);
-
-// Store result into a supplied string and return it
-const std::string& SStringPrintf(std::string* dst, const char* format, ...)
- PRINTF_FORMAT(2, 3);
-const std::wstring& SStringPrintf(std::wstring* dst,
- const wchar_t* format, ...)
- WPRINTF_FORMAT(2, 3);
-
-// Append result to a supplied string
-void StringAppendF(std::string* dst, const char* format, ...)
- PRINTF_FORMAT(2, 3);
-void StringAppendF(std::wstring* dst, const wchar_t* format, ...)
- WPRINTF_FORMAT(2, 3);
-
-// Lower-level routine that takes a va_list and appends to a specified
-// string. All other routines are just convenience wrappers around it.
-void StringAppendV(std::string* dst, const char* format, va_list ap)
- PRINTF_FORMAT(2, 0);
-void StringAppendV(std::wstring* dst, const wchar_t* format, va_list ap)
- WPRINTF_FORMAT(2, 0);
-
// This is mpcomplete's pattern for saving a string copy when dealing with
// a function that writes results into a wchar_t[] and wanting the result to
// end up in a std::wstring. It ensures that the std::wstring's internal