quake-tools/source/quam/archive.cc

28 lines
515 B
C++
Raw Normal View History

2019-10-03 12:17:16 -07:00
#include "quam/archive.h"
#include <QMetaEnum>
Arc::FileType Arc::getFileType(int n) {
if(int t = QMetaEnum::fromType<Arc::FileType>().value(n); n != -1) {
return Arc::FileType(t);
} else {
throw std::range_error("invalid file type");
}
}
ArcNode::ArcNode(ArcDir &&t, std::string &&n, Arc::FileType ty) :
super_type(std::move(t)),
name(std::move(n)),
type(ty)
{
}
ArcNode::ArcNode(ArcFile &&t, std::string &&n, Arc::FileType ty) :
super_type(std::move(t)),
name(std::move(n)),
type(ty)
{
}
// EOF