SkSLErrorReporter.h 582 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright 2016 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef SKSL_ERRORREPORTER
  8. #define SKSL_ERRORREPORTER
  9. #include "src/sksl/SkSLPosition.h"
  10. namespace SkSL {
  11. /**
  12. * Interface for the compiler to report errors.
  13. */
  14. class ErrorReporter {
  15. public:
  16. virtual ~ErrorReporter() {}
  17. void error(int offset, const char* msg) {
  18. this->error(offset, String(msg));
  19. }
  20. virtual void error(int offset, String msg) = 0;
  21. virtual int errorCount() = 0;
  22. };
  23. } // namespace
  24. #endif