MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / dumpFunction

Function dumpFunction

Engine/source/console/engineDoc.cpp:213–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213static void dumpFunction( Stream &stream,
214 bool isClassMethod,
215 Namespace::Entry* entry )
216{
217 String doc = entry->getDocString().trim();
218 String prototype = entry->getPrototypeString().trim();
219
220 // If the doc string contains @hide, skip this function.
221
222 if( dStrstr( doc.c_str(), "@hide" ) || dStrstr( doc.c_str(), "@internal" ) )
223 return;
224
225 // Make sure we have a valid function prototype.
226
227 if( prototype.isEmpty() )
228 {
229 Con::errorf( "Function '%s::%s' has no prototype!", entry->mNamespace->mName, entry->mFunctionName );
230 return;
231 }
232
233 // See if it's a static method.
234
235 bool isStaticMethod = false;
236 if( entry->mHeader )
237 isStaticMethod = entry->mHeader->mIsStatic;
238
239 // Emit the doc comment.
240
241 if( !doc.isEmpty() )
242 {
243 stream.writeText( "/*!\r\n" );
244
245 // If there's no @brief, take the first line of the doc text body
246 // as the description.
247
248 const char* brief = dStrstr( doc, "@brief" );
249 if( !brief )
250 {
251 String brief = entry->getBriefDescription( &doc );
252
253 brief.trim();
254 if( !brief.isEmpty() )
255 {
256 stream.writeText( "@brief " );
257 stream.writeText( brief );
258 stream.writeText( "\r\n\r\n" );
259 }
260 }
261
262 stream.writeText( doc );
263
264 // Emit @ingroup if it's not a class method.
265
266 if ( !isClassMethod && !isStaticMethod ) // Extra static method check for static classes (which will come out as non-class namespaces).
267 {
268 const char *group = dStrstr( doc, "@ingroup" );
269 if( group )
270 {

Callers 1

dumpNamespaceEntriesFunction · 0.85

Calls 11

dStrstrFunction · 0.85
errorfFunction · 0.85
dSscanfFunction · 0.85
trimMethod · 0.80
getBriefDescriptionMethod · 0.80
insertUniqueMethod · 0.80
getDocStringMethod · 0.45
getPrototypeStringMethod · 0.45
c_strMethod · 0.45
isEmptyMethod · 0.45
writeTextMethod · 0.45

Tested by

no test coverage detected