------------------------------------------------------------------------------
| 945 | |
| 946 | //------------------------------------------------------------------------------ |
| 947 | void ofxLua::writeTable(ofxLuaFileWriter& writer, bool recursive) { |
| 948 | if(!isValid()) { |
| 949 | return; |
| 950 | } |
| 951 | |
| 952 | if(tables.empty()) { |
| 953 | ofLogWarning("ofxLua") << "No table to write, did you push?"; |
| 954 | return; |
| 955 | } |
| 956 | |
| 957 | // in a table namespace |
| 958 | if(!lua_istable(L, LUA_STACK_TOP)) { |
| 959 | ofLogWarning("ofxLua") << "Couldn't write table \"" << (std::string)tables.back() |
| 960 | << "\", top of stack is not a table"; |
| 961 | return; |
| 962 | } |
| 963 | |
| 964 | writeTable(LUA_STACK_TOP, writer, recursive); |
| 965 | } |
| 966 | |
| 967 | void ofxLua::writeTable(const std::string& tableName, ofxLuaFileWriter& writer, bool recursive) { |
| 968 | if(!pushTable(tableName)) { |
no test coverage detected