#ifndef LOADER_COMPILER_H_
#define LOADER_COMPILER_H_
+#include "ObjectFile.h"
+
#include <iosfwd>
#include <map>
#include <memory>
public:
void Write(std::ostream &);
- struct Export {
- int nameOffset;
- int typeId;
- int dataOffset;
- };
-
- struct External {
- int nameOffset;
- int referenceOffset;
- int inlined;
- };
-
- struct ImageProperties {
- Uint32 flags;
- int width;
- int height;
- int depth;
- Uint32 rmask;
- Uint32 gmask;
- Uint32 bmask;
- Uint32 amask;
- };
-
private:
void WriteHeader(std::ostream &);
void WriteExports(std::ostream &);
int ReferenceOffset(int typeId, int objectId, std::ptrdiff_t fieldOffset) const;
int ObjectOffset(int typeId, int objectId) const;
- int TypeOffset(int typeId) const;
+ int GetTypeOffset(int typeId) const;
private:
const Interpreter &intp;
int cursor;
- int exportsOffset;
- int externalsOffset;
- int externalStringsOffset;
- int exportStringsOffset;
- int imagesOffset;
- int objectsOffset;
+ ObjectFileHeader fileHeader;
std::map<int, int> objectOffsets;