MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / printNamespaceEntries

Method printNamespaceEntries

Engine/source/console/consoleDoc.cpp:225–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225void 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 }

Callers

nothing calls this directly

Calls 9

printClassMethodFunction · 0.85
printGroupStartFunction · 0.85
printGroupEndFunction · 0.85
printfFunction · 0.85
getArgumentsStringMethod · 0.80
getFunctionArgsMethod · 0.80
c_strMethod · 0.45
getDocStringMethod · 0.45
getPrototypeStringMethod · 0.45

Tested by

no test coverage detected