------------------------------------------------------------------------------
| 59 | #endif |
| 60 | //------------------------------------------------------------------------------ |
| 61 | inline void _PushValueToLuaTable(lua::NativeState hLua,lua::Table &table) |
| 62 | { |
| 63 | lua::NewTable(hLua); // ... [T] |
| 64 | |
| 65 | lua::Table::Iterator it = table.getBegin(); |
| 66 | |
| 67 | lua::Var key; |
| 68 | lua::Var value; |
| 69 | |
| 70 | for ( ; ! it.isEnd() ; it++ ) |
| 71 | { |
| 72 | // ... [T] |
| 73 | |
| 74 | it.getKeyValue( &key, &value ); |
| 75 | |
| 76 | if ( lua::VarType<lua::Str>(key) ) |
| 77 | { |
| 78 | lua::Str t_key = lua::VarCast<lua::Str>(key); |
| 79 | PushVarToLua(hLua,t_key); // ... [T] [key] |
| 80 | } |
| 81 | else if ( lua::VarType<lua::Int>(key) ) |
| 82 | { |
| 83 | lua::Int t_key = lua::VarCast<lua::Int>(key); |
| 84 | PushVarToLua(hLua,t_key); // ... [T] [key] |
| 85 | } |
| 86 | else if ( lua::VarType<lua::Num>(key) ) |
| 87 | { |
| 88 | lua::Num t_key = lua::VarCast<lua::Num>(key); |
| 89 | PushVarToLua(hLua,t_key); // ... [T] [key] |
| 90 | } |
| 91 | #ifdef _LUAPP_ENABLE_BOOLEAN_INDEX_OF_TABLE_ |
| 92 | else if ( lua::VarType<lua::Bool>(key) ) |
| 93 | { |
| 94 | lua::Bool t_key = lua::VarCast<lua::Bool>(key); |
| 95 | PushVarToLua(hLua,t_key); // ... [T] [key] |
| 96 | } |
| 97 | #endif |
| 98 | else |
| 99 | { |
| 100 | continue; // Just in case. |
| 101 | } |
| 102 | |
| 103 | if ( lua::VarType<lua::Str>(value) ) |
| 104 | { |
| 105 | lua::Str t_value = lua::VarCast<lua::Str>(value); |
| 106 | PushVarToLua(hLua,t_value); // ... [T] [key] [value] |
| 107 | } |
| 108 | else if ( lua::VarType<lua::Int>(value) ) |
| 109 | { |
| 110 | lua::Int t_value = lua::VarCast<lua::Int>(value); |
| 111 | PushVarToLua(hLua,t_value); // ... [T] [key] [value] |
| 112 | } |
| 113 | else if ( lua::VarType<lua::Num>(value) ) |
| 114 | { |
| 115 | lua::Num t_value = lua::VarCast<lua::Num>(value); |
| 116 | PushVarToLua(hLua,t_value); // ... [T] [key] [value] |
| 117 | } |
| 118 | else if ( lua::VarType<lua::Ptr>(value) ) |
no test coverage detected