1 #ifndef LOADER_LOADER_H_
2 #define LOADER_LOADER_H_
4 #include "ObjectFile.h"
5 #include "TypeDescription.h"
22 void Load(const std::string &file);
24 const std::map<std::string, LoadedExport> &Exports() const { return exports; }
26 std::ostream &Dump(std::ostream &) const;
29 void LoadExports(char *src, Export *begin, Export *end);
30 void LoadExternals(char *src, External *begin, External *end);
31 void LoadImages(char *src, Image *begin, Image *end);
32 void LoadObjects(char *src, Object *begin, Object *end);
33 void LoadObject(char *src, char *dest, const TypeDescription &);
34 void LoadArrays(char *src, Array *begin, Array *end);
35 void LoadScripts(char *src, Script *begin, Script *end);
37 void InitObjects(Object *begin, Object *end);
38 void InitObject(char *object, const TypeDescription &);
39 void InitArrays(Array *begin, Array *end);
41 struct MissingExternal {
42 std::string identifier;
47 void LinkExternal(const MissingExternal &, const LoadedExport &);
50 std::map<std::string, char *> objectFiles;
51 std::map<std::string, LoadedExport> exports;
52 std::map<std::string, SDL_Surface *> images;
53 std::vector<MissingExternal> unlinked;
62 inline ostream &operator <<(ostream &o, const loader::Loader &l) {