Changeset 367 for trunk/src/lua/lua_state.cc
- Timestamp:
- 05/16/15 23:12:22 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_state.cc
r365 r367 356 356 } 357 357 358 int lua::state::load_stream( std::istream& stream, string_ref name )359 {360 NV_LOG_NOTICE( "Loading Lua stream '", name, "'");361 return load_string( std::string(362 (std::istreambuf_iterator<char>(stream)),363 std::istreambuf_iterator<char>()), name );364 }365 366 358 int lua::state::load_file( string_ref filename ) 367 359 { … … 380 372 } 381 373 return do_current( name, rvalues ) == 0; 382 }383 384 bool lua::state::do_stream( std::istream& stream, string_ref name )385 {386 lua::stack_guard( this );387 int result = load_stream(stream,name);388 if (result)389 {390 NV_LOG_WARNING( "Failed to open stream ", name, ": ", lua_tostring( m_state, -1 ) );391 return false;392 }393 return do_current( name ) == 0;394 374 } 395 375
Note: See TracChangeset
for help on using the changeset viewer.