| 223 | } |
| 224 | |
| 225 | void Namespace::printNamespaceEntries(Namespace * g, bool dumpScript, bool dumpEngine ) |
| 226 | { |
| 227 | static bool inGroup = false; |
| 228 | |
| 229 | // Go through all the entries. |
| 230 | // Iterate through the methods of the namespace... |
| 231 | for(Entry *ewalk = g->mEntryList; ewalk; ewalk = ewalk->mNext) |
| 232 | { |
| 233 | S32 eType = ewalk->mType; |
| 234 | const char * funcName = ewalk->mFunctionName; |
| 235 | |
| 236 | if( ( eType == Entry::ConsoleFunctionType ) && !dumpScript ) |
| 237 | continue; |
| 238 | |
| 239 | if( ( eType != Entry::ConsoleFunctionType ) && !dumpEngine ) |
| 240 | continue; |
| 241 | |
| 242 | // If it's a function |
| 243 | if( eType >= Entry::ConsoleFunctionType ) |
| 244 | { |
| 245 | if (ewalk->mHeader != NULL) |
| 246 | { |
| 247 | // The function was defined with types, so we can print out the actual return type |
| 248 | printClassMethod(true, ewalk->mHeader->mReturnString, funcName, ewalk->getArgumentsString().c_str(), |
| 249 | ewalk->getDocString().c_str()); |
| 250 | } |
| 251 | else |
| 252 | { |
| 253 | printClassMethod(true, typeNames[eType], funcName, (ewalk->getArgumentsString() + "...").c_str(), |
| 254 | ewalk->getDocString().c_str()); |
| 255 | } |
| 256 | } |
| 257 | else if(ewalk->mType == Entry::GroupMarker) |
| 258 | { |
| 259 | if(!inGroup) |
| 260 | printGroupStart(ewalk->cb.mGroupName, ewalk->mUsage); |
| 261 | else |
| 262 | printGroupEnd(); |
| 263 | |
| 264 | inGroup = !inGroup; |
| 265 | } |
| 266 | else if(ewalk->mType == Entry::ScriptCallbackType) |
| 267 | { |
| 268 | // It's a script callback - emit some sort of appropriate info. |
| 269 | Con::printf(" /*! %s */", ewalk->getDocString().c_str()); |
| 270 | Con::printf(" %s;", ewalk->getPrototypeString().c_str()); |
| 271 | Con::printf(""); |
| 272 | } |
| 273 | else if(ewalk->mFunctionOffset) // If it's a builtin function... |
| 274 | { |
| 275 | String args = ewalk->mCode->getFunctionArgs(ewalk->mFunctionOffset); |
| 276 | printClassMethod(false, typeNames[ewalk->mType], ewalk->mFunctionName, args, ""); |
| 277 | } |
| 278 | else |
| 279 | { |
| 280 | Con::printf(" // got an unknown thing?? %d", ewalk->mType ); |
| 281 | } |
| 282 | } |
nothing calls this directly
no test coverage detected