Changeset 378 for trunk/src/stl/string.cc
- Timestamp:
- 05/29/15 12:12:47 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/stl/string.cc
r374 r378 11 11 #include <cstdio> 12 12 #include <cstdlib> 13 #include <fstream> // for slurp only 13 14 14 15 using namespace nv; … … 16 17 static const double s_power_10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 17 18 10000000, 100000000, 1000000000 }; 19 20 std::string nv::slurp( const std::string& filename ) 21 { 22 std::ifstream input( filename ); 23 // if ( !input.is_open() ) NV_THROW( std::runtime_error, "File "+filename+" not found!"); 24 std::stringstream sstr; 25 while ( input >> sstr.rdbuf() ); 26 return sstr.str(); 27 } 18 28 19 29 static inline void string_reverse( char* begin, char* end )
Note: See TracChangeset
for help on using the changeset viewer.