text: // Copyright(c) 2016 Ruoyu Fan (Windy Darian), Xueyin Wan
  // MIT License.
  
  #include "util.h"
  
  #include <tiny_obj_loader.h> //TODO
  
  #include <fstream>
  #include <unordered_map>
  #include <tuple>
  #include <array>
  
  // TODO
  
  std::vector<char> util::readFile(const std::string & filename)
  {
  	std::ifstream file_stream(filename, std::ios::ate | std::ios::binary);
  
  	if (!file_stream.is_open())
  	{
  		throw std::runtime_error("failed to open file!");
  	}
  
  	// starts reading at the end of file to determine file size (ate)
  	size_t file_size = (size_t)file_stream.tellg();
  	std::vector<char> buffer(file_size);
  
  	file_stream.seekg(0);
  	file_stream.read(buffer.data(), file_size);
  
  	file_stream.close();
  	return buffer;
  }
  
  