1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
// // Created by thecharlesblake on 11/13/17. // #include <fstream> #include <sstream> #include "util.h" using namespace std; using namespace boost; const optional<string> util::read_file(const string& filename) { ifstream ifstr(filename); stringstream buf; buf << ifstr.rdbuf(); if (ifstr.fail()) { return none; } else { return buf.str(); } }