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

Unified Diff: base/string_util.h

Issue 6003: Portable swscanf.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 12 years, 3 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 | « no previous file | base/string_util_posix.h » ('j') | base/string_util_win.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util.h
===================================================================
--- base/string_util.h (revision 2710)
+++ base/string_util.h (working copy)
@@ -33,6 +33,9 @@
// s2 > s1 according to a lexicographic comparison.
int strncasecmp(const char* s1, const char* s2, size_t count);
+// Wrapper for swscanf.
+int vswscanf(const wchar_t* ws, const wchar_t* format, va_list arguments);
+
// Wrapper for vsnprintf that always null-terminates and always returns the
// number of characters that would be in an untruncated formatted
// string, even when truncation occurs.
@@ -47,6 +50,14 @@
// Some of these implementations need to be inlined.
+inline int swscanf(const wchar_t* ws, const wchar_t* format, ...) {
+ va_list arguments;
+ va_start(arguments, format);
+ int result = vswscanf(ws, format, arguments);
+ va_end(arguments);
+ return result;
+}
+
inline int snprintf(char* buffer, size_t size, const char* format, ...) {
va_list arguments;
va_start(arguments, format);
« no previous file with comments | « no previous file | base/string_util_posix.h » ('j') | base/string_util_win.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698