error_utils.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #ifndef EXTENSIONS_COMMON_ERROR_UTILS_H_
  5. #define EXTENSIONS_COMMON_ERROR_UTILS_H_
  6. #include <string>
  7. #include "base/strings/string_piece.h"
  8. namespace extensions {
  9. class ErrorUtils {
  10. public:
  11. // Creates an error messages from a pattern.
  12. static std::string FormatErrorMessage(base::StringPiece format,
  13. base::StringPiece s1);
  14. static std::string FormatErrorMessage(base::StringPiece format,
  15. base::StringPiece s1,
  16. base::StringPiece s2);
  17. static std::string FormatErrorMessage(base::StringPiece format,
  18. base::StringPiece s1,
  19. base::StringPiece s2,
  20. base::StringPiece s3);
  21. static std::u16string FormatErrorMessageUTF16(base::StringPiece format,
  22. base::StringPiece s1);
  23. static std::u16string FormatErrorMessageUTF16(base::StringPiece format,
  24. base::StringPiece s1,
  25. base::StringPiece s2);
  26. static std::u16string FormatErrorMessageUTF16(base::StringPiece format,
  27. base::StringPiece s1,
  28. base::StringPiece s2,
  29. base::StringPiece s3);
  30. };
  31. } // namespace extensions
  32. #endif // EXTENSIONS_COMMON_ERROR_UTILS_H_