| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <stddef.h> |
| 8 | 9 |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 12 #include "base/macros.h" |
| 11 #include "base/scoped_clear_errno.h" | 13 #include "base/scoped_clear_errno.h" |
| 12 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "build/build_config.h" |
| 14 | 17 |
| 15 namespace base { | 18 namespace base { |
| 16 | 19 |
| 17 namespace { | 20 namespace { |
| 18 | 21 |
| 19 // Overloaded wrappers around vsnprintf and vswprintf. The buf_size parameter | 22 // Overloaded wrappers around vsnprintf and vswprintf. The buf_size parameter |
| 20 // is the size of the buffer. These return the number of characters in the | 23 // is the size of the buffer. These return the number of characters in the |
| 21 // formatted string excluding the NUL terminator. If the buffer is not | 24 // formatted string excluding the NUL terminator. If the buffer is not |
| 22 // large enough to accommodate the formatted string without truncation, they | 25 // large enough to accommodate the formatted string without truncation, they |
| 23 // return the number of characters that would be in the fully-formatted string | 26 // return the number of characters that would be in the fully-formatted string |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 StringAppendVT(dst, format, ap); | 180 StringAppendVT(dst, format, ap); |
| 178 } | 181 } |
| 179 | 182 |
| 180 #if defined(OS_WIN) | 183 #if defined(OS_WIN) |
| 181 void StringAppendV(std::wstring* dst, const wchar_t* format, va_list ap) { | 184 void StringAppendV(std::wstring* dst, const wchar_t* format, va_list ap) { |
| 182 StringAppendVT(dst, format, ap); | 185 StringAppendVT(dst, format, ap); |
| 183 } | 186 } |
| 184 #endif | 187 #endif |
| 185 | 188 |
| 186 } // namespace base | 189 } // namespace base |
| OLD | NEW |