00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __RT_RBILOADER__
00011 #define __RT_RBILOADER__
00012
00013 #include <rtstring.h>
00014 #include <rtdelphi.h>
00015
00016 #include "robbase.h"
00017 #include "robvars.h"
00018
00019 using namespace lrt;
00020
00021 namespace rt {
00022
00023
00024 class RbiLoader : public ProgramLoader
00025 {
00026 public:
00027
00028 RbiLoader(const ErrorHandler* handler);
00029 virtual ~RbiLoader();
00030
00031 virtual ProgramLoader* create(const String& filename, const Globals& glob);
00032 virtual bool canLoad(const String& filename);
00033 virtual String getFormatName();
00034
00035 protected:
00036 virtual LoadReturnType load();
00037 virtual LoadReturnType loadHeaders();
00038
00039 private:
00040 int errval;
00041
00042 typedef Instr::Op Op;
00043
00044
00045 RbiLoader(const RbiLoader* example, const String& filename, const Globals& glob);
00046 bool isExample;
00047
00048
00049 LoadReturnType error(RbiLoadReturnType num);
00050
00051 RbiLoadReturnType doLoadHeaders(DelphiDataInputStream* in);
00052
00053 RbiLoadReturnType doLoad(DelphiDataInputStream* in);
00054
00055 RbiLoadReturnType readOps(unsigned char* buf, Array<Op>& ops, bool* dest);
00056 RbiLoadReturnType convertParamDest(int type, int value, Op& op);
00057 RbiLoadReturnType convertParamSrc(int type, int value, Op& op);
00058
00059
00060 };
00061
00062 }
00063
00064 #endif