Created
July 8, 2016 05:53
-
-
Save Lunaphied/d1555d53e6b8c891a971b05d619445e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| std::string read_file ( const char* file_path ) | |
| { | |
| std::ifstream in ( file_path, std::ios::in ); | |
| if ( in ) { | |
| std::vector<char> contents; | |
| in.seekg ( 0, std::ios::end ); | |
| contents.resize ( in.tellg() ); | |
| in.seekg ( 0, std::ios::beg ); | |
| in.read ( &contents[0], contents.size() ); | |
| in.close(); | |
| return std::string(contents.data()); | |
| } | |
| std::abort(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment