Changeset 305 for trunk/nv/lua/lua_state.hh
- Timestamp:
- 08/12/14 01:51:21 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/lua/lua_state.hh
r296 r305 130 130 } 131 131 132 template< typename R > 133 R get( const path& p, const R& def ) 134 { 135 if ( p.resolve( m_state, m_global ) ) 136 { 137 return detail::pop_return_value<R>( m_state, def ); 138 } 139 return R(); 140 } 141 142 template< typename R, typename T > 143 R get( const T& key, const R& def ) 144 { 145 if ( m_global ) push_global_table(); 146 detail::push_value( m_state, key ); 147 call_get(); 148 if ( m_global ) pop_global_table(); 149 return detail::pop_return_value<R>( m_state, def ); 150 } 151 152 template< typename R, typename T > 153 R raw_get( const T& key, const R& def ) 154 { 155 if ( m_global ) push_global_table(); 156 detail::push_value( m_state, key ); 157 call_get_raw(); 158 if ( m_global ) pop_global_table(); 159 return detail::pop_return_value<R>( m_state, def ); 160 } 132 161 bool is_defined( const path& p ) { return is_defined( p, m_global ); } 133 162 void register_native_function( lfunction f, const char* name );
Note: See TracChangeset
for help on using the changeset viewer.