aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Resource.cpp
blob: 6bb081db3916ca317dd7df0e6e8c60cdae73d68e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <filesystem>

#include "Resource.h"

using namespace crepe::api;

Resource::Resource(const std::string & src) {
	this->src = std::filesystem::canonical(src);
	this->file = std::ifstream(this->src, std::ios::in | std::ios::binary);
}

const std::istream & Resource::read() {
	return this->file;
}

const char * Resource::canonical() {
	return this->src.c_str();
}