1 //===- Binary.h - A generic binary file -------------------------*- 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 // This file declares the Binary class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_OBJECT_BINARY_H
15 #define LLVM_OBJECT_BINARY_H
17 #include "llvm/ADT/OwningPtr.h"
18 #include "llvm/Object/Error.h"
30 Binary(const Binary &other); // = delete
37 Binary(unsigned int Type, MemoryBuffer *Source);
50 StringRef getData() const;
51 StringRef getFileName() const;
54 unsigned int getType() const { return TypeID; }
55 static inline bool classof(Binary const *v) { return true; }
58 error_code createBinary(MemoryBuffer *Source, OwningPtr<Binary> &Result);
59 error_code createBinary(StringRef Path, OwningPtr<Binary> &Result);