| 177 | |
| 178 | |
| 179 | void CScriptObjectScript::Debug_Elements( IScriptObject *pCurrent, string &sPath, std::set<const void *> &setVisited ) |
| 180 | { |
| 181 | assert(pCurrent); |
| 182 | |
| 183 | pCurrent->BeginIteration(); |
| 184 | |
| 185 | while(pCurrent->MoveNext()) |
| 186 | { |
| 187 | char *szKeyName; |
| 188 | |
| 189 | if(!pCurrent->GetCurrentKey(szKeyName)) |
| 190 | szKeyName="NO"; |
| 191 | |
| 192 | ScriptVarType type=pCurrent->GetCurrentType(); |
| 193 | |
| 194 | if(type==svtObject) // svtNull,svtFunction,svtString,svtNumber,svtUserData,svtObject |
| 195 | { |
| 196 | const void *pVis; |
| 197 | |
| 198 | pCurrent->GetCurrentPtr(pVis); |
| 199 | |
| 200 | if(setVisited.count(pVis)!=0) |
| 201 | continue; |
| 202 | |
| 203 | setVisited.insert(pVis); |
| 204 | |
| 205 | { |
| 206 | IScriptObject *pNewObject = m_pScriptSystem->CreateEmptyObject(); |
| 207 | |
| 208 | pCurrent->GetCurrent(pNewObject); |
| 209 | |
| 210 | #if defined(LINUX) |
| 211 | string s = sPath+string("/")+szKeyName; |
| 212 | DWORD dwSubTableCount = Debug_Buckets_recursive(pNewObject,s,setVisited,0xffffffff); |
| 213 | #else |
| 214 | DWORD dwSubTableCount = Debug_Buckets_recursive(pNewObject,sPath+string("/")+szKeyName,setVisited,0xffffffff); |
| 215 | #endif |
| 216 | |
| 217 | pNewObject->Release(); |
| 218 | |
| 219 | GetISystem()->GetILog()->Log(" %8d '%s' '%s'\n",dwSubTableCount,sPath.c_str(),szKeyName); |
| 220 | } |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | pCurrent->EndIteration(); |
| 225 | } |
| 226 | |
| 227 | |
| 228 |
nothing calls this directly
no test coverage detected