- Timestamp:
- 07/15/13 23:43:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_state.cc
r162 r163 372 372 } 373 373 } 374 375 void lua::state::register_enum( type_database* db, const std::string& name, const std::string& prefix /*= std::string() */ ) 376 { 377 type_entry* et = db->get_type( name ); 378 379 for ( const auto& entry : et->enum_list ) 380 { 381 lua_pushinteger( L, entry.value ); 382 if ( prefix.empty() ) 383 { 384 lua_setglobal( L, entry.name.c_str() ); 385 } 386 else 387 { 388 lua_setglobal( L, ( prefix + entry.name ).c_str() ); 389 } 390 } 391 }
Note: See TracChangeset
for help on using the changeset viewer.