1 //===- BinaryStreamError.h - Error extensions for Binary Streams *- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_SUPPORT_BINARYSTREAMERROR_H
11 #define LLVM_SUPPORT_BINARYSTREAMERROR_H
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/Error.h"
19 enum class stream_error_code {
27 /// Base class for errors originating when parsing raw PDB files
28 class BinaryStreamError : public ErrorInfo<BinaryStreamError> {
31 explicit BinaryStreamError(stream_error_code C);
32 explicit BinaryStreamError(StringRef Context);
33 BinaryStreamError(stream_error_code C, StringRef Context);
35 void log(raw_ostream &OS) const override;
36 std::error_code convertToErrorCode() const override;
38 StringRef getErrorMessage() const;
40 stream_error_code getErrorCode() const { return Code; }
44 stream_error_code Code;
48 #endif // LLVM_SUPPORT_BINARYSTREAMERROR_H