[email protected] | fc67082 | 2011-12-17 09:33:49 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | c661918 | 2009-05-12 14:59:32 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | e9f541a | 2012-11-19 21:52:31 | [diff] [blame] | 5 | #ifndef EXTENSIONS_COMMON_ERROR_UTILS_H_ |
| 6 | #define EXTENSIONS_COMMON_ERROR_UTILS_H_ |
[email protected] | c661918 | 2009-05-12 14:59:32 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
[email protected] | f439096 | 2013-06-11 07:29:22 | [diff] [blame] | 10 | #include "base/strings/string16.h" |
rdevlin.cronin | 24e8964 | 2016-12-28 23:48:40 | [diff] [blame] | 11 | #include "base/strings/string_piece.h" |
[email protected] | fc67082 | 2011-12-17 09:33:49 | [diff] [blame] | 12 | |
[email protected] | e9f541a | 2012-11-19 21:52:31 | [diff] [blame] | 13 | namespace extensions { |
| 14 | |
| 15 | class ErrorUtils { |
[email protected] | 11f485728 | 2009-11-13 19:56:17 | [diff] [blame] | 16 | public: |
[email protected] | 6657afa6 | 2009-11-04 02:15:20 | [diff] [blame] | 17 | // Creates an error messages from a pattern. |
rdevlin.cronin | 24e8964 | 2016-12-28 23:48:40 | [diff] [blame] | 18 | static std::string FormatErrorMessage(base::StringPiece format, |
| 19 | base::StringPiece s1); |
[email protected] | c661918 | 2009-05-12 14:59:32 | [diff] [blame] | 20 | |
rdevlin.cronin | 24e8964 | 2016-12-28 23:48:40 | [diff] [blame] | 21 | static std::string FormatErrorMessage(base::StringPiece format, |
| 22 | base::StringPiece s1, |
| 23 | base::StringPiece s2); |
[email protected] | 6657afa6 | 2009-11-04 02:15:20 | [diff] [blame] | 24 | |
rdevlin.cronin | 24e8964 | 2016-12-28 23:48:40 | [diff] [blame] | 25 | static std::string FormatErrorMessage(base::StringPiece format, |
| 26 | base::StringPiece s1, |
| 27 | base::StringPiece s2, |
| 28 | base::StringPiece s3); |
[email protected] | fc67082 | 2011-12-17 09:33:49 | [diff] [blame] | 29 | |
Karan Bhatia | 9e9ab272 | 2017-08-29 19:52:41 | [diff] [blame] | 30 | static std::string FormatErrorMessage(base::StringPiece format, |
| 31 | base::StringPiece s1, |
| 32 | base::StringPiece s2, |
| 33 | base::StringPiece s3, |
| 34 | base::StringPiece s4); |
| 35 | |
rdevlin.cronin | 24e8964 | 2016-12-28 23:48:40 | [diff] [blame] | 36 | static base::string16 FormatErrorMessageUTF16(base::StringPiece format, |
| 37 | base::StringPiece s1); |
[email protected] | fc67082 | 2011-12-17 09:33:49 | [diff] [blame] | 38 | |
rdevlin.cronin | 24e8964 | 2016-12-28 23:48:40 | [diff] [blame] | 39 | static base::string16 FormatErrorMessageUTF16(base::StringPiece format, |
| 40 | base::StringPiece s1, |
| 41 | base::StringPiece s2); |
[email protected] | fc67082 | 2011-12-17 09:33:49 | [diff] [blame] | 42 | |
rdevlin.cronin | 24e8964 | 2016-12-28 23:48:40 | [diff] [blame] | 43 | static base::string16 FormatErrorMessageUTF16(base::StringPiece format, |
| 44 | base::StringPiece s1, |
| 45 | base::StringPiece s2, |
| 46 | base::StringPiece s3); |
Karan Bhatia | 9e9ab272 | 2017-08-29 19:52:41 | [diff] [blame] | 47 | |
| 48 | static base::string16 FormatErrorMessageUTF16(base::StringPiece format, |
| 49 | base::StringPiece s1, |
| 50 | base::StringPiece s2, |
| 51 | base::StringPiece s3, |
| 52 | base::StringPiece s4); |
[email protected] | c661918 | 2009-05-12 14:59:32 | [diff] [blame] | 53 | }; |
| 54 | |
[email protected] | e9f541a | 2012-11-19 21:52:31 | [diff] [blame] | 55 | } // namespace extensions |
| 56 | |
| 57 | #endif // EXTENSIONS_COMMON_ERROR_UTILS_H_ |