2014-10-08 00:52:15 +00:00
|
|
|
#ifndef RESTYPE_H
|
|
|
|
#define RESTYPE_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <iosfwd>
|
|
|
|
|
|
|
|
class ResType
|
|
|
|
{
|
2019-08-18 11:21:00 +00:00
|
|
|
int x;
|
2014-10-08 00:52:15 +00:00
|
|
|
public:
|
2019-08-18 11:21:00 +00:00
|
|
|
ResType() : x(0) {}
|
|
|
|
ResType(int x) : x(x) {}
|
|
|
|
ResType(const std::string& s);
|
|
|
|
ResType(const char* s);
|
2014-10-08 00:52:15 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
operator int() const { return x; }
|
|
|
|
bool operator<(ResType y) const { return x < y.x; }
|
2014-10-08 00:52:15 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
operator std::string();
|
2014-10-08 00:52:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
{
|
2019-08-18 11:21:00 +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
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
ResType& type() { return first; }
|
|
|
|
ResType type() const { return first; }
|
|
|
|
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
|