MCPcopy Create free account
hub / github.com/Hopson97/MineCraft-One-Week-Challenge / getFileContents

Function getFileContents

Source/Util/FileUtil.cpp:7–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <stdexcept>
6
7std::string getFileContents(const std::string &filePath)
8{
9 std::ifstream inFile(filePath);
10 if (!inFile.is_open()) {
11 throw std::runtime_error("Unable to open file: " + filePath);
12 }
13
14 std::stringstream stream;
15
16 stream << inFile.rdbuf();
17 return stream.str();
18}

Callers 1

loadShadersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected