2007-08-10 23:45:47 +00:00
|
|
|
#ifndef FINDER_H
|
|
|
|
#define FINDER_H
|
2007-06-07 00:30:16 +00:00
|
|
|
|
|
|
|
#include "common.h"
|
2007-07-20 14:36:31 +00:00
|
|
|
#include "system.h"
|
2007-06-07 00:30:16 +00:00
|
|
|
|
2007-06-18 21:13:21 +00:00
|
|
|
namespace vm {
|
|
|
|
|
2007-08-10 23:45:47 +00:00
|
|
|
class Finder {
|
2007-06-07 00:30:16 +00:00
|
|
|
public:
|
2007-06-20 19:20:25 +00:00
|
|
|
class Data {
|
|
|
|
public:
|
|
|
|
virtual ~Data() { }
|
|
|
|
virtual const uint8_t* start() = 0;
|
|
|
|
virtual size_t length() = 0;
|
|
|
|
virtual void dispose() = 0;
|
|
|
|
};
|
|
|
|
|
2007-08-10 23:45:47 +00:00
|
|
|
virtual ~Finder() { }
|
|
|
|
virtual Data* find(const char* name) = 0;
|
|
|
|
virtual bool exists(const char* name) = 0;
|
2007-08-27 13:46:17 +00:00
|
|
|
virtual const char* path() = 0;
|
2007-07-20 14:36:31 +00:00
|
|
|
virtual void dispose() = 0;
|
2007-06-07 00:30:16 +00:00
|
|
|
};
|
|
|
|
|
2007-08-10 23:45:47 +00:00
|
|
|
Finder*
|
|
|
|
makeFinder(System* s, const char* path);
|
2007-07-20 14:36:31 +00:00
|
|
|
|
2007-06-18 21:13:21 +00:00
|
|
|
} // namespace vm
|
|
|
|
|
2007-08-10 23:45:47 +00:00
|
|
|
#endif//FINDER_H
|