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

#include "Resource.h"
#include "util/log.h"

using namespace crepe::api;

Resource::Resource(const std::string & src) {
	dbg_trace();
	this->src = std::filesystem::path(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(); }