1// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef EXTENSIONS_COMMON_ERROR_UTILS_H_
6#define EXTENSIONS_COMMON_ERROR_UTILS_H_
7
8#include <string>
9
10#include "base/strings/string16.h"
11#include "base/strings/string_piece.h"
12
13namespace extensions {
14
15class ErrorUtils {
16 public:
17 // Creates an error messages from a pattern.
18 static std::string FormatErrorMessage(base::StringPiece format,
19 base::StringPiece s1);
20
21 static std::string FormatErrorMessage(base::StringPiece format,
22 base::StringPiece s1,
23 base::StringPiece s2);
24
25 static std::string FormatErrorMessage(base::StringPiece format,
26 base::StringPiece s1,
27 base::StringPiece s2,
28 base::StringPiece s3);
29
30 static base::string16 FormatErrorMessageUTF16(base::StringPiece format,
31 base::StringPiece s1);
32
33 static base::string16 FormatErrorMessageUTF16(base::StringPiece format,
34 base::StringPiece s1,
35 base::StringPiece s2);
36
37 static base::string16 FormatErrorMessageUTF16(base::StringPiece format,
38 base::StringPiece s1,
39 base::StringPiece s2,
40 base::StringPiece s3);
41};
42
43} // namespace extensions
44
45#endif // EXTENSIONS_COMMON_ERROR_UTILS_H_
46