2014-10-08 00:52:15 +00:00
|
|
|
#ifndef RESTYPE_H
|
|
|
|
#define RESTYPE_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <iosfwd>
|
|
|
|
|
|
|
|
class ResType
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
public:
|
|
|
|
ResType() : x(0) {}
|
|
|
|
ResType(int x) : x(x) {}
|
|
|
|
ResType(const std::string& s);
|
2014-10-12 17:12:10 +00:00
|
|
|
ResType(const char* s);
|
2014-10-08 00:52:15 +00:00
|
|
|
|
|
|
|
operator int() const { return x; }
|
|
|
|
bool operator<(ResType y) const { return x < y.x; }
|
|
|
|
|
|
|
|
operator std::string();
|
|
|
|
};
|
|
|
|
|
|
|
|
std::ostream& operator<<(std::ostream& out, ResType t);
|
|
|
|
|
2015-07-20 01:27:26 +00:00
|
|
|
struct ResRef : public std::pair<ResType, short>
|
2014-10-12 17:12:10 +00:00
|
|
|
{
|
2015-07-20 01:27:26 +00:00
|
|
|
ResRef() : std::pair<ResType, short>(ResType(), 0) {}
|
|
|
|
ResRef(ResType t, int id) : std::pair<ResType, short>(t,id) {}
|
2014-10-12 17:12:10 +00:00
|
|
|
|
|
|
|
ResType& type() { return first; }
|
|
|
|
ResType type() const { return first; }
|
2015-07-20 01:27:26 +00:00
|
|
|
short& id() { return second; }
|
|
|
|
short id() const { return second; }
|
2014-10-12 17:12:10 +00:00
|
|
|
};
|
|
|
|
|
2014-10-08 00:52:15 +00:00
|
|
|
#endif // RESTYPE_H
|