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);
42 // Object and children.
53 StringRef getData() const;
54 StringRef getFileName() const;
57 unsigned int getType() const { return TypeID; }
58 static inline bool classof(const Binary *v) { return true; }
61 error_code createBinary(MemoryBuffer *Source, OwningPtr<Binary> &Result);
62 error_code createBinary(StringRef Path, OwningPtr<Binary> &Result);