| 211 | } |
| 212 | |
| 213 | static 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 | { |
no test coverage detected